【EOS教程】EOS给待选节点的投票方法
2018年06月12日 ,截止文章创作日期EOS投票已经达到3.5%,而EOS主网正式启动需要投票量达到15%。本文接下来就描述可对竞选超级节点投票的方法。
投票前需要条件:
1.EOS主网启动前映射过EOS地址;
2.自己的EOS地址必持有EOS;
3.有保存自己的EOS私钥;
使用eos自带的cleos(命令行)投票
在使用eos自带的cleos投票前,首选需要搭建EOS的环境,即在自己的设备上部署EOS。部署EOS环境可以使用以下两种方法:
1.通过拷贝eos的源码,执行eos的build脚本来进行部署。
https://github.com/EOSIO/eos/wiki/Local-Environment#2-building-eosio
2.通过docker创建eos环境来进行部署(建议)。
https://github.com/EOSIO/eos/wiki/Local-Environment#3-docker
当具备EOS的环境后
1.首先启动钱包
keosd
得到以下输出
1360371ms thread-0 wallet_plugin.cpp:41 plugin_initialize ] initializing wallet plugin
1360371ms thread-0 http_plugin.cpp:285 plugin_initialize ] configured http to listen on 127.0.0.1:8888
1360371ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/keosd/stop
1360371ms thread-0 http_plugin.cpp:323 plugin_startup ] start listening for http requests
1360372ms thread-0 wallet_api_plugin.cpp:68 plugin_startup ] starting wallet_api_plugin
1360372ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/wallet/create
1360372ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/wallet/create_key
1360372ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/wallet/get_public_keys
1360372ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/wallet/import_key
1360372ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/wallet/list_keys
1360372ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/wallet/list_wallets
1360372ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/wallet/lock
1360372ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/wallet/lock_all
1360372ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/wallet/open
1360372ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/wallet/set_timeout
1360372ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/wallet/sign_digest
1360372ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/wallet/sign_transaction
1360372ms thread-0 http_plugin.cpp:369 add_handler ] add api url: /v1/wallet/unlock
按下ctrl+c回到命令行
2.接下来创建电子钱包
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.
"<钱包密钥>"
//输出************的是电子钱包的密码 用于解锁使用,需要备份好
3.下一步导入EOS钱包私钥
cleos --wallet-url http://localhost:8888/ wallet import <EOS私约>
4.接下来找到一个你信任的可以使用的EOS待票选节点
例如 现在票数排名第二的
http://vote.liquideos.com/
的节点
http://node2.liquideos.com:8888
或者你可以通过社交网络直接联系你信任的待票选节点提供他们的节点信息
接下来使用节点先查看节点的信息
cleos --wallet-url http://localhost:8888 --url http://node2.liquideos.com:8888 get info
{
"server_version": "db570801",
"chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906",
"head_block_num": 314066,
"last_irreversible_block_num": 314065,
"last_irreversible_block_id": "0004cad1336dd53a222aac400fba95e1b1bef846048f97ee076c50eb32d3661d",
"head_block_id": "0004cad29ea2d4951069d3da91a6071e0ab0e264dc8931ea7c479632874aab2d",
"head_block_time": "2018-06-12T06:35:22",
"head_block_producer": "genesisblock",
"virtual_block_cpu_limit": 200000000,
"virtual_block_net_limit": 1048576000,
"block_cpu_limit": 199900,
"block_net_limit": 1048576
}
有类似上面信息显示以后以后证明节点是可用的。
5.通过节点和EOS共钥查询你的EOS用户名
cleos --wallet-url http://localhost:8888 --url http://node2.liquideos.com:8888 get accounts <EOS公钥>
{
"account_names": [
"your account name"
]
}
其中返回的 your account name 就是你的EOS账户名称,账户名称用于投票使用,可以先记下来。
6.通过以下命令获取待票选节点
cleos --wallet-url http://localhost:8888 --url http://node2.liquideos.com:8888 system listproducers
Producer Producer key Url Scaled votes
eosauthority EOS4va3CTmAcAAXsT26T3EBWqYHgQLshyxsozYRgxWm9tjmy17pVV https://eosauthority.com 0.0377
eosliquideos EOS4v1n2j5kXbCum8LLEc8zQLpeLK9rKVFmsUgLCWgMDN38P6PcrW http://vote.liquideos.com/ 0.0372
eosyskoreabp EOS7TjKVBkBcSmjsXF4jJfZ1QU9RqVHuBkkcHNJoEcHGR79CoLf2f http://eosys.io 0.0366
eosnewyorkio EOS6GVX8eUqC1gN1293B3ivCNbifbr1BT6gzTFaQBXzWH9QNKVM4X https://bp.eosnewyork.io 0.0343
eoseouldotio EOS6SSA4gYCSZ3q9NWpxGsYDv5MWjSwKseyq25RRZexwj8EM6YHDa https://portal.eoseoul.io 0.0333
...
可以显示待票选节点的信息,或者也可以直接访问 http://eosportal.io来查看待票选的节点。
其中命令行查询到的Producer字段,或者是上述网站的Account字段下面的名称就是待票选的节点,可以查看他们的网站连接,来决定你是否要给他们投上一票,如果决定要为他们投票,在这里记下它的名称。
7.解锁钱包
cleos --wallet-url http://localhost:8888 wallet unlock --password <钱包密钥>
8.投票
cleos --wallet-url http://localhost:8888 --url http://node2.liquideos.com:8888 system voteproducer prods <你的EOS用户名> <想投票的节点名称1> <想投票的节点名称2>
9.确认投票结果
cleos --wallet-url http://localhost:8888 --url http://node2.liquideos.com:8888 get account <你的EOS用户名>
最后输出的内容就是你投票的节点了
producers:
总结
现在也有一些APP或者是浏览器插件支持给EOS进行投票,但是再EOS公布可靠的投票应用以及钱包之前,本人还是保守的使用eos源码提供的命令行来进行投票。该投票方式在EOS主网上线之后仍然有效。希望本教程对你有帮助。若教程中有不对的地方,希望大家指正。
Congratulations @oubenruing! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!