Please follow the guide for multi-node testnet. And do add the
--mainnet-url option to specifiy a bitcoincashnode's RPC endpoint, which can be a real one or a fake one, just as following:
./smartbchd start --mainnet-url=http://node-ip-address:port-number
bchnode tool mimics a real bitcoincashnode's RPC behavior. You can use it with the following steps:
Git clone https://github.com/smartbch/testkit.gitcd bchnodego run main.go &
The format is
action, where the action can be "add", "edit" or "retire".
cd scripts ;# there are some utility scripts in the directory testkit/bchnode/scripts./pubkey.sh eeed4fae3da010e393efed2aacd271971fd2383fc68109a475d6c9ef65435d52-9-add
bchnode produces blocks with fixed interval (default is 3 seconds) to vote for the validators.
To change the block interval to 10 seconds:
bchnode will simulate a fork at the height which is 8 blocks less than current height, and re-generate the recent 8 blocks.
bchnode to follow the voting power and pubkeys specified in genesis.json
Keep the current voting power and pubkeys for three epochs.
Change the voting power setting of
bchnode, such that at new epochs, the smartbchd follows the new voting power.
Run block reorg at
bchnode, and smartbchd can work normally.
Add new validators in and let
bchnode vote them to be active.
Restart smartbchd and it can also work fine.
NumBlocksInEpoch int64 = 30NumBlocksToClearMemory int64 = 1000sWaitingBlockDelayTime int64 = 2sSwitchEpochDelayTime int64 = 10sMinVotingPercentPerEpoch = 10 //10 percent in NumBlocksInEpoch, like 2016 / 10 = 201MinVotingPubKeysPercentPerEpoch = 34 //34 percent in active validators,