Fake RPC Server for Testing
Dependencies
Please follow the guide for multi-node testnet.And do add the[direction] –mainnet-url [/direction]option to specifiy a bitcoincashnode’s RPC endpoint, which can be a real one or a fake one, just as following:
Running a Fake RPC Server for Testing
The[direction]bchnode[/direction] tool mimics a real bitcoincashnode’s RPC behavior. You can use it with the following steps:
Start the bchnode RPC Server
Add a New Validator's public key and voting power
The format is [direction]pubkey[/direction]-[direction]votingPower[/direction]-[direction]action[/direction], where the action can be “add”, “edit” or “retire”.
The [direction]bchnode[/direction] produces blocks with fixed interval (default is 3 seconds) to vote for the validators.
Adjust block interval
To change the block interval to 10 seconds:
Simulate a Block Reorg
The[direction] bchnode[/direction] will simulate a fork at the height which is 8 blocks less than current height, and re-generate the recent 8 blocks.
The Suggested Scenarios for Test
1. Configure[direction] bchnode[/direction] to follow the voting power and pubkeys specified in genesis.json
2. Keep the current voting power and pubkeys for three epochs.
3. Change the voting power setting of[direction] bchnode[/direction], such that at new epochs, the smartbchd follows the new voting power.
4. Run block reorg at [direction]bchnode[/direction], and smartbchd can work normally.
5. Add new validators in and let [direction]bchnode[/direction] vote them to be active.
6. Restart smartbchd and it can also work fine.
2. Keep the current voting power and pubkeys for three epochs.
3. Change the voting power setting of[direction] bchnode[/direction], such that at new epochs, the smartbchd follows the new voting power.
4. Run block reorg at [direction]bchnode[/direction], and smartbchd can work normally.
5. Add new validators in and let [direction]bchnode[/direction] vote them to be active.
6. Restart smartbchd and it can also work fine.