Skip to content

Instantly share code, notes, and snippets.

@JohnnyZhao
Last active June 5, 2018 23:13
Show Gist options
  • Select an option

  • Save JohnnyZhao/147636a325118ccc51da48e9e8e68de7 to your computer and use it in GitHub Desktop.

Select an option

Save JohnnyZhao/147636a325118ccc51da48e9e8e68de7 to your computer and use it in GitHub Desktop.
EOSIO: How to register producer an vote using Dawn 4.0

Run 4 nodeos instance, 1 eosio bios node, 3 BP nodes, with producer names bp1 bp2 bp3.

1. Deploy eosio.bios contract to eosio account.

cleos set contract eosio contracts/eosio.bios 

2. Create eosio.token account

cleos create account eosio eosio.token PUBKEY PUBKEY

3. Deploy eosio.token contract to eosio.token

cleos set contract eosio.token contracts/eosio.token

4. Create EOS token and issue some to eosio:

cleos push action eosio.token create '{"issuer":"eosio", "maximum_supply": "1000000000.0000 EOS", "can_freeze": 0, "can_recall": 0, "can_whitelist": 0}' -p eosio.token

cleos push action eosio.token issue '{"to":"eosio","quantity":"100000000.0000 EOS","memo":"issue"}' -p eosio

5. Deploy eosio.system contract to eosio

cleos set contract eosio contracts/eosio.system

6. Create accounts for BPs, bp1 bp2 bp3

7. Register BPs, bp1 bp2 bp3

cleos system regproducer bp1 Pubkey_of_bp1 http://bp1-website.com

8. Create voters accounts, voter1, voter2, voter3

9. Issue EOS token to voters, at least 50M each.

10. Stake EOS for voters

cleos system delegatebw voter1 voter1 "25000000 EOS" "25000000 EOS" --transfer

11. Voting!

voter1 votes for bp1, bp2 and bp3.

cleos system voteproducer voter1 bp1 bp2 bp3

12. Check votes

cleos system listproducers.

Once no less than 15% EOS has been staked and voted, Producers will auto shift to bp1, bp2 and bp3, eosio will stop producing blocks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment