Market

How to start Testnet on Dawn 3 release.

5 comments

eluzgin
40
8 months agoBusy3 min read

About Dawn 3 Block Producer bootstrap process:

In the latest Dawn 3 release there is a bootstrap main BP account called eosio with a known private key that is used to bootstrap the chain, create wallet and smart bios contract (code provided).
That smart contract is then populated with a list of 21 Block Producer public keys.
After those Block Producers join the Blockchain they will be allowed to produce blocks in turns.
After they start main bootstrap node eosio can be shutdown.
This post describes this process step by step.

Checkout latest codebase:

Got to your /opt folder and checkout EOS project:
git clone https://github.com/eosio/eos --recursive
cd eos
git checkout dawn-v3.0.0
git submodule update --recursive

Compile it:

./eosio_build.sh
cd build
make install
After this step all eos related commands will be placed on your user path and available directly without specifying direct path to executable files.

Create Main Node folder and copy genesis:

mkdir /opt/MainNode
cp /opt/eos/build/genesis.json /opt/MainNode/

Create config.ini and start/stop scripts under /opt/MainNode/

Example config.ini and start/stop scripts available here:
https://github.com/EOSTribe/arrowhead
Modify them to match your path and needs.
Node: --enable-stale-production true in start script we need only on the beginning and only for first node in our network.

Start up the main node:

Start the node by running ./start.sh.
Node log output will be in stderr.txt file.
If everything is ok we will see something like this:
eosio generated block 07930d61... #6261 @ 2018-04-06T21:35:21.000 with 0 trxs, lib: 6260
eosio generated block 083dd0f7... #6262 @ 2018-04-06T21:35:21.500 with 0 trxs, lib: 6261
eosio generated block 5d563133... #6263 @ 2018-04-06T21:35:22.000 with 0 trxs, lib: 6262
This means that eosio started producing blocks.

Now create default wallet with imported eosio key:

cleos -p 8888 --wallet-port 8888 wallet create
image.png
Record you wallet password!

Next unlock default wallet:
cleos -p 8888 --wallet-port 8888 wallet unlock --password PW5JSPxuKBf6gu34upQydhs68iEE1uLvy8otMoibb7GpucNmL3EX4

Then import eosio private key (public information):
cleos -p 8888 --wallet-port 8888 wallet import 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
image.png

Add eosio.bios smart contract to user eosio:

cleos -p 8888 --wallet-port 8888 set contract eosio /opt/eos/build/contracts/eosio.bios/
You should see a JSON response back without errors:

Reading WAST...
Assembling WASM...
Publishing contract...
executed transaction: f42dd2cc58e9ecf21425f7e91443c859e756b774a1233464e75b3817c0fcbce9 3288 bytes 2200576 cycles
#eosio <= eosio::setcode {"account":"eosio","vmtype":0,"vmversion":0,"code":"0061736d0100000001581060037f7e7f0060057f7e7e7e7e...
#eosio <= eosio::setabi {"account":"eosio","abi":{"types":[],"structs":[{"name":"set_account_limits","base":"","fields":[{"n...

Create a new account for a BP node (each BP needs to do this step):

cleos -p 8888 --wallet-port 8888 create key
Screen Shot 2018-04-06 at 4.03.43 PM.png
Save private and public keys.
Public key is used in the next step.

Collect public keys from all BP nodes and create a list of producers in setbp.json file:

Screen Shot 2018-04-06 at 4.07.50 PM.png

Last step - unable new block producer list in eosio.bios contract:

cleos -p 8888 --wallet-port 8888 push action eosio setprods "$(cat setbp.json)" -p [email protected]

Conclusion

After the steps above complete - each BP node should be able to join the cain and start producing blocks.

References

This article is build upon original article by CryptoLions:
https://steemit.com/eos/@cryptolions/how-to-start-a-dawn3-testnetwork-and-add-producers-using-eosio-bios
with changes learned through experience with latest Dawn 3.0 codebase and configuring Arrowhead Testnet.

Telegram channels for more info:
EOS Net - https://t.me/joinchat/GCDtvUqDVpSZ_mYd0y6vJQ
Arrowhead - https://t.me/joinchat/GjJY7BJrnbIW_S67Zchexg

Comments

Sort byBest