-
Notifications
You must be signed in to change notification settings - Fork 249
Custom Network
To start your own custom network, you need to manually configure the genesis file. Once you finished the setup, it allows you to connect to your own network rather than connect to official network(mainnet/testnet)
- Make sure the network has at least two nodes running as a authority master node
- Thor version ≥ v1.0.7
Build your custom network requires understanding the mechanism of blockchain. Make sure you go through thor wiki especially the article about Builtin Contract and Proof of Authority. This will help you understanding the next steps.
You can find an example genesis file by this link
-
launchTime
: Launch time(unix timestamp) of your network(I.e. the time of genesis block). If you set the time in the future, master node would not propose block before that. -
gasLimit
: Initial block gas limit -
extraData
: Additional data set to genesis block, limited to 28 characters. -
accounts
: Preallocated accounts in genesis block, includingbalance
,energy
,storage
andcode
. -
authority
: Authority master nodes. -
params
: Governance parameters. -
executor
: Executor params for on-chain governance, setting approvers means using vechain builtin executor, omit means an external address.
For setting the authority node, you need to get your authority node's master address first, simply running the following command
thor master-key
The master address will be shown. Endorsor Address
is the endorser's address for authority node, you need to ensure the Endorsor Address
reach the minimum amount of proposerEndorsement
. You can adjust the minimum endorsement amount of VET by changing proposerEndorsement”
. Identity
is an identifier of the authority node.
-
rewardRatio
: Reward ratio for block proposer. -
baseGasPrice
: Base gas price inwei
. -
proposerEndorsement
: Authority node endorsement inwei
. -
executorAddress
: Executor address, if there is approver inexecutor
, the address will be set code ofBuiltin Executor Contract
and set up the approves, otherwise the executor will be an external address.
Start all your nodes by running thor --network genesis.json
, waiting for the nodes connects to each other and the master nodes will start packing the blocks.
Start a custom network will use the foundation's bootnode to discover nodes by default. This means you need at least 1 node with public IP attached. Thor provides the ability to specify bootnode.
- Start thor by
thor --network genesis.json
then getNode ID
in the startup info, it looks likeenode://0b9f...6932@[extip]:11235
. - Replace
[extip]
with the real ip address of your machine. - Launch nodes by running
thor --network genesis.json --bootnode "NodeID-1,NodeID-2..."
.