Simple setup to test basics of parity's block reward contracts
- install parity 1.11 (tested on 1.11.0)
- clone repository
git clone https://github.com/phahulin/test-block-reward.git
cd test-block-reward- install dependencies
npm install- start two parity nodes for two validators in separate terminal windows
parity --config node1.tomland
parity --config node2.toml- wait till you see both
enode://...printed to logs, then tell nodes about each other:
$ ./mate.sh
true
trueyou should see 1/25 peers appear in each log
- start script to track balances
node catch-all.js
- to reset the network and remove chain files, run
./clear-all.sh
Up until block 20 you should see validators receive 1 eth reward to their mining key in round-robin fashion. From block 20 onwards they will start receiving 10 eth reward to payout key + 5 eth will be sent to vault address.
Note that this contract cannot emit events
- BlockReward contract source
- spec.json notice
blockRewardContractAddressandblockRewardContractTransitionparameters. Bytecode is stored in correspondingaccountsection - Validator keys:
- mining
0x6546ed725e88fa728a908f9ee9d61f50edc40ad6, payout0x7546ed725e88fa728a908f9ee9d61f50edc40ad6 - mining
0x1a22d96792666863f429a85623e6d4ca173d26ab, payout0x2a22d96792666863f429a85623e6d4ca173d26ab
- mining
- Vault address:
0xe9d0bb7fa991960cf9bcff4899e8fec3b25e77f2