Setup VeChainThor 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](https://github.com/vechain/thor/releases/tag/v1.0.7)
Before You Start¶
Build your custom network requires understanding the mechanism of blockchain. Make sure you go through [thor wiki](https://github.com/vechain/thor/wiki) especially the article about [Builtin Contract](https://github.com/vechain/thor/wiki/Builtin-Contract) and [Proof of Authority](https://github.com/vechain/thor/wiki/Proof-of-Authority). This will help you understand the next steps.
Configure Your Genesis File¶
You can find an example genesis file [by this link](https://github.com/vechain/thor/blob/master/genesis/example.json)
Genesis Description Object¶
- 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, including balance, energy, storage and code.
- 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.
- rewardRatio: Reward ratio for block proposer.
- baseGasPrice: Base gas price in wei.
- proposerEndorsement: Authority node endorsement in wei.
- executorAddress: Executor address, if there is approver in executor, the address will be set code of Builtin Executor Contract and set up the approves, otherwise the executor will be an external address.
Launch Custom Network¶
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.