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

in eos •  20 days ago

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

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

To be honest, I will be waiting for a nice GUI.

Will block.one be voting for the main net with their 10% stake?

·

me too, it's strange that B1 doesn't provide a simple UI at the start... there's no way I use an unknown 3rd party or the CLI.

·

There will be nice GUI portals at launch. This is the backup.

·
·

Still looking for that nice GUI portal :)

·
·
·

You are not alone.

·
·
·

You can use eosportal.io and the Scatter wallet. A good tutorial:

FYI - I found the following documentation useful for understanding EOS accounts and wallets, and the associated cleos/keosd commands.
https://eosio-nodeos.readme.io/docs/learn-about-wallets-keys-and-accounts-with-cleos

·

Here is another good guide about voting with cleos:
https://eosio.stackexchange.com/questions/725/how-to-vote-using-cleos

Great work. Thanks!

Thanks for the instructions, maybe it can be a bit simpler with docker-compose

Great tutorial, thanks. That's was what I was waiting for :-)

Yeah I don't think I would be able to vote like this.

Thank you for providing the knowledge! Yet looking at the length of tutorial and technical expertise required, certainly not something for a regular token holder...

This will be much appreciated by large token holders!

Sounds like we're back again to medieval age of computing in an era of artificial intelligence. WTF!😳

Ordinary stakeholders be like: I don't have time for this shit!😂

Please give an example of how to do this with a 1 EOS wallet. If 1 EOS won't work, state the minimum. I have a 5 EOS wallet that I'd like to test voting with before I use my larger wallet. But 5 EOS seems too small to try your example.

Is EOS compatible with sub $1 USD wallets like BTC and ETH are or does EOS have a $12 min like XRP wallets have? I'll save my larger EOS paper wallets until I learn it better.

Your tutorial is great and really detailed. Thank you that you put so much effort in preparation of this material.

Personally I believe, that whoever have a skills to follow those instruction, should do that - I mean, use official tools.

I am @noisy from Tokenika.io, and we believe voting will be extremely important. As you wrote that down, without enough vote network will not be fully activated.

The EOS mainnet will not be considered valid and activated until at least 15% of all issued tokens have staked a vote.

Knowing that default voting procedure can be too difficult for many people, we decided to prepare a much simpler voting tool which will not require installation of any tools... and will allow people to generate and sign a transaction OFFLINE:

https://tokenika.github.io/secure-bp-voting/

Very soon we are going to release on our @tokenika blog some additional materials (article + video), which will show how people will be able to vote securely with this tool in just few minutes.

PS. We also recommended there your article :)