-
Install OpenEthereum 3.1 and Node.js 8.x LTS (with npm) if they are not installed.
-
Perform the next commands:
$ git clone https://github.com/varasev/test-block-reward
$ cd test-block-reward
$ npm i
$ npm start
-
Watch a log in the console. It should be seen that
payoutKey
balances are being increased alternately by 1 eth and the vault's balance is being increased by 1 eth every 5 seconds. We also can see that the gas fee is being accrued alternately to mining keys when a sender transfers some amount to a receiver. An example log is available here: https://github.com/varasev/test-block-reward/blob/master/example.log -
To make charging of one coin to an extra receiver's account, perform the next command:
$ npm run accrue 1
You'll see in the log that the balance of an extra receiver increased by one coin on the next block.
- To restart this setup from scratch, perform the next command:
$ npm restart
- To completely stop and clear, perform the next command:
$ npm run clear
Do the next command for contracts compilation, for saving their bytecodes to config/spec.json
and for saving their ABIs to contracts/abis
:
$ npm run build
Note that you have to perform npm restart
after npm run build
if you started it before.