Your Vote Matters #3: EOS Block Producer Voting Using the Command Line

0_cgTxZxS-atep_ite.jpg

The EOS mainnet will not be considered valid and activated until at least 15% of all issued tokens have staked a vote. While there will be a few launch options to vote we want to provide a tutorial on the most basic way for you to vote, the command line. In our third installment of the "Your Vote Matters" series our head of Block Production, Buddy Deck, will guide you through this process using Docker and an isolated testnet. While this is just a testnet the same procedure can be used to vote on the mainnet after the June launch.

Before we begin:

  1. Following these instructions will require that you have Docker installed. Docker is not available on all Windows platforms so you may need to set-up a free AWS instance using the EOSDocs guide

  2. How to install docker on Windows

  3. Following these instructions will be easier with some basic command line experience but it is not required.

Step 1: Docker Run Command

The first command we will run will start the eosio interactive Docker image. I am using the latest docker image however for the main launch you should look to the docker repos for the latest stable version.

> docker run -it eosio/eos:latest /bin/bash

If this is your first time running this command it will cache the image locally and that will take some time. Subsequent calls to docker will run more quickly.

Step 2: keosd start tail

The next set of commands we will run will all revolve around keosd the command line wallet provided by the eosio software. We will start the wallet daemon, create the wallet, and import the private key.

First we start the wallet.

keosd &> /var/log/keosd.log &

and check the output.

tail /var/log/keosd.log
3491124ms thread-0   http_plugin.cpp:325           add_handler          ] add api url: /v1/wallet/get_public_keys
3491124ms thread-0   http_plugin.cpp:325           add_handler          ] add api url: /v1/wallet/import_key
3491124ms thread-0   http_plugin.cpp:325           add_handler          ] add api url: /v1/wallet/list_keys
3491124ms thread-0   http_plugin.cpp:325           add_handler          ] add api url: /v1/wallet/list_wallets
3491124ms thread-0   http_plugin.cpp:325           add_handler          ] add api url: /v1/wallet/lock
3491124ms thread-0   http_plugin.cpp:325           add_handler          ] add api url: /v1/wallet/lock_all
3491124ms thread-0   http_plugin.cpp:325           add_handler          ] add api url: /v1/wallet/open
3491124ms thread-0   http_plugin.cpp:325           add_handler          ] add api url: /v1/wallet/set_timeout
3491124ms thread-0   http_plugin.cpp:325           add_handler          ] add api url: /v1/wallet/sign_transaction
3491124ms thread-0   http_plugin.cpp:325           add_handler          ] add api url: /v1/wallet/unlock

Step 3: Create Wallet & Import Key

cleos --wallet-url http://localhost:8888/ wallet create
Creating wallet: default
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5J4LVh75aUwZtEd25GyyepcRv23FY95QdJVWJXFrdu2rxSG3THb"

cleos --wallet-url http://localhost:8888/ wallet import 5KTDQ5mBXyRjUpnURPsWyJ1qkrPyiBvcXTmiEdftsEicZWHqRoT
imported private key for: EOS6rc3LWmQHZLhSE1BBCRScUKv1zGvbyCzRJ25izHdhKD8GtyXbD

Step 4: ID Endpoint

In the next stage, we will identify the HTTP/API endpoint we will be connecting too. In this case, I know the IP and port combination of the testnet since I created it. However, after mainnet launch, the BPs and Standby BPs will likely distribute information about how to connect to their nodes via their websites and social media accounts. (EOS New York will be providing this information in our channels as well.)

The first thing I like to do is to get information on the network.

Step 5: Get Info

cleos --wallet-url http://localhost:8888 --url http://35.232.212.69:8888 get info
{
  "server_version": "4e99cf47",
  "head_block_num": 2027,
  "last_irreversible_block_num": 2026,
  "last_irreversible_block_id": "000007ea1c98fb79d9b9a5de901fb436dd26766acc56940175fe1fc5744afd1c",
  "head_block_id": "000007eb2896acf39cdeb62a469a355d0e8319009a24a06e644d55b5b2ae51b8",
  "head_block_time": "2018-05-24T22:58:53",
  "head_block_producer": "eosio",
  "virtual_block_cpu_limit": 795214796,
  "virtual_block_net_limit": 7956885,
  "block_cpu_limit": 104857500,
  "block_net_limit": 1048576
}

Step 6: Get Account Info

cleos --wallet-url http://localhost:8888 --url http://35.232.212.69:8888 get account eosuseraaaaa
privileged: false
permissions: 
     owner     1:    1 EOS6rc3LWmQHZLhSE1BBCRScUKv1zGvbyCzRJ25izHdhKD8GtyXbD
        active     1:    1 EOS6rc3LWmQHZLhSE1BBCRScUKv1zGvbyCzRJ25izHdhKD8GtyXbD
memory: 
     quota:     7.828 Kb     used:     3.506 Kb   

net bandwidth: (averaged over 3 days)
     staked:      20000.0000 EOS           (total stake delegated from account to self)
     delegated:     100.0000 EOS           (total staked delegated to account from others)
     used:               679 bytes
     available:        13.14 Gb   
     limit:            13.14 Gb   

cpu bandwidth: (averaged over 3 days)
     staked:      20000.0000 EOS           (total stake delegated from account to self)
     delegated:     100.0000 EOS           (total staked delegated to account from others)
     used:             7.263 ms   
     available:        391.8 hr   
     limit:            391.8 hr   

producers:
     aaaaaaaaaaa1    aaaaaaaaaaa3

Step 7: Delegate

As you can, see by the output I currently have cpu/networking delegated and I have already voted for 2 producers. But if you hadn't delegated the bandwidth already now would be the time to do it.

cleos --wallet-url http://localhost:8888 --url http://35.232.212.69:8888 system delegatebw eosuseraaaaa eosuseraaaaa "10000.0000 EOS" "10000.0000 EOS"

73278736ms thread-0   main.cpp:1083                 operator()           ] act_payload: {"from":"eosuseraaaaa","receiver":"eosuseraaaaa","stake_net_quantity":"10000.0000 EOS","stake_cpu_quantity":"10000.0000 EOS","transfer":false} 
3278810ms thread-0   main.cpp:419                  create_action        ] result: {"binargs":"608c31e62aac3155608c31e62aac315500e1f5050000000004454f530000000000e1f5050000000004454f530000000000"} arg: {"code":"eosio","action":"delegatebw","args":{"from":"eosuseraaaaa","receiver":"eosuseraaaaa","stake_net_quantity":"10000.0000 EOS","stake_cpu_quantity":"10000.0000 EOS","transfer":false}} 
executed transaction: 73ce9408e4839e89b71d321cc105e0f0c9027a446afe8b5b7dadc4c90808d357  232 bytes  1771 us
#         eosio <= eosio::delegatebw            {"from":"eosuseraaaaa","receiver":"eosuseraaaaa","stake_net_quantity":"10000.0000 EOS","stake_cpu_qu...
#   eosio.token <= eosio.token::transfer        {"from":"eosuseraaaaa","to":"eosio","quantity":"20000.0000 EOS","memo":"stake bandwidth"}
#  eosuseraaaaa <= eosio.token::transfer        {"from":"eosuseraaaaa","to":"eosio","quantity":"20000.0000 EOS","memo":"stake bandwidth"}
#         eosio <= eosio.token::transfer        {"from":"eosuseraaaaa","to":"eosio","quantity":"20000.0000 EOS","memo":"stake bandwidth"}
warning: transaction executed locally, but may not be confirmed by the network yet

Step 8: Listproducers

cleos --wallet-url http://localhost:8888 --url http://35.232.212.69:8888 system listproducers

Producer      Producer key                                           Url                                                         Scaled votes
aaaaaaaaaaa1  EOS5tMrfp4Rmwda2gsVivxch6aGmyUnNkXnH9XZqKBE1ubet1UFjk  http://aaaaaaaaaaa1/                                        0.5000
aaaaaaaaaaa3  EOS6tQst4P393PdwauhdmuRfjibiSQuWkiHfJY6YsFTBj1AY7HSFF  http://aaaaaaaaaaa3/                                        0.5000
aaaaaaaaaaa2  EOS8fSM4HSohcVy2AaKP65E36j2rJsZNAcc5GhrrP2bb8DSi1gYDq  http://aaaaaaaaaaa2/                                        0.0000
aaaaaaaaaaa4  EOS84sXSacSjyn5k4eFaSsE7feUFnEvW7agdpxCt7oz6FowrfzXeU  http://aaaaaaaaaaa4/                                        0.0000

Step 9: Vote

So it looks like 1 and 3 have a lot of votes and now it is time for the other two producers to take a turn.

cleos --wallet-url http://localhost:8888 --url http://35.232.212.69:8888 system voteproducer prods eosuseraaaaa aaaaaaaaaaa2 aaaaaaaaaaa4 

1878239ms thread-0   main.cpp:419                  create_action        ] result: {"binargs":"608c31e62aac3155000000000000000002208c31c618638c31408c31c618638c31"} arg: {"code":"eosio","action":"voteproducer","args":{"voter":"eosuseraaaaa","proxy":"","producers":["aaaaaaaaaaa2","aaaaaaaaaaa4"]}} 
executed transaction: e980f0917450a0483012c4fc354ec19617c98ba065428d4bff2b70d8bc2e5c58  216 bytes  2033 us
#         eosio <= eosio::voteproducer          {"voter":"eosuseraaaaa","proxy":"","producers":["aaaaaaaaaaa2","aaaaaaaaaaa4"]}
warning: transaction executed locally, but may not be confirmed by the network yet

And now after we check out the producers we can tell that the even-numbered producers now have the higher votes.

cleos --wallet-url http://localhost:8888 --url http://35.192.152.77:8888 system listproducers

Producer      Producer key                                           Url                                                         Scaled votes
aaaaaaaaaaa2  EOS8fSM4HSohcVy2AaKP65E36j2rJsZNAcc5GhrrP2bb8DSi1gYDq  http://aaaaaaaaaaa2/                                        0.4998
aaaaaaaaaaa4  EOS84sXSacSjyn5k4eFaSsE7feUFnEvW7agdpxCt7oz6FowrfzXeU  http://aaaaaaaaaaa4/                                        0.4998
aaaaaaaaaaa1  EOS5tMrfp4Rmwda2gsVivxch6aGmyUnNkXnH9XZqKBE1ubet1UFjk  http://aaaaaaaaaaa1/                                        0.0002
aaaaaaaaaaa3  EOS6tQst4P393PdwauhdmuRfjibiSQuWkiHfJY6YsFTBj1AY7HSFF  http://aaaaaaaaaaa3/                                        0.0002

Congratulations! You've voted!

Congratulations on taking part in the EOS mainnet governance process. We hope this tutorial was helpful and if you have any questions please reach out to us in the comments or anywhere you can find EOS New York.


Picture1.png

EOS New York is a Block Producer Candidate for the EOS.IO Blockchain

Website
Twitter
Medium
STEEM
Meetup
Telegram

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now