Private Network (Fakenet)
Create your own Private Network (Fakenet)
Fakenet is a private network optimized for your private testing. It'll generate a genesis containing N validators with equal stakes. To launch a validator in this network, all you need to do is specify a validator ID you're willing to launch.
Pay attention that validator's private keys are deterministically generated in this network, so you must use it only for private testing.
Maintaining your own private network is more involved as a lot of configurations taken for granted in the official networks need to be manually set up.
To run the fakenet with just one validator (which will work practically as a PoA blockchain), use:
To run the fakenet with 5 validators, run the command for each validator:
If you have to launch a non-validator node in fakenet, use 0 as ID:
After that, you have to connect your nodes. Either connect them statically or specify a bootnode:
Scripts
start network:
./start.sh
;stop network:
./stop.sh
;clean data and logs:
./clean.sh
;
You can specify number of genesis validators by setting N environment variable.
Balance transfer example
Start network:
Attach js-console to running node0:
Check the balance to ensure that node0 has something to transfer (node0 js-console):
output shows the balance value:
Get node1 address:
output shows address:
Transfer some amount from node0 to node1 address as receiver (node0 js-console):
output shows unique hash of the outgoing transaction:
Check the transaction status by its unique hash (js-console):
output shows number of block, transaction was included in:
As soon as transaction is included into a block you will see new balance of both node addresses:
outputs:
Last updated