通过打印结果可以观察到三个候选节点的收到的投票数,公钥,url等属性,其中unpaid_blocks属性是还未申领奖励的区块数(属于该节点出的块),last_claim_time属性是上一次申领时间。
五,区块生产者认领奖励与比特币和以太坊相同的是,EOS的出块者也有挖矿奖励,只是比起前二者自动发放奖励,EOS出块者需要自行申领奖励,
root@iZ2ze5wsiqz8cj0lqgf73tZ:~/lwb-work/eos/tutorials/bios-boot-tutorial/nodes# cleos --wallet-url :6666 --url :8000 system claimrewards producer111a 301762ms thread-0 main.cpp:429 create_action ] result: {"binargs":"60420857219de8ad"} arg: {"code":"eosio","action":"claimrewards","args":{"owner":"producer111a"}} executed transaction: 4b7e9b1bec0f04f4d96aa4e61f9bc45516411cf6be3f82720e9c8cb6dfb7a162 104 bytes 6343 us # eosio <= eosio::claimrewards {"owner":"producer111a"} # eosio.token <= eosio.token::issue {"to":"eosio","quantity":"1855.4398 SYS","memo":"issue tokens for producer pay and savings"} # eosio.token <= eosio.token::transfer {"from":"eosio","to":"eosio.saving","quantity":"1484.3519 SYS","memo":"unallocated inflation"} # eosio <= eosio.token::transfer {"from":"eosio","to":"eosio.saving","quantity":"1484.3519 SYS","memo":"unallocated inflation"} # eosio.saving <= eosio.token::transfer {"from":"eosio","to":"eosio.saving","quantity":"1484.3519 SYS","memo":"unallocated inflation"} # eosio.token <= eosio.token::transfer {"from":"eosio","to":"eosio.bpay","quantity":"92.7719 SYS","memo":"fund per-block bucket"} # eosio <= eosio.token::transfer {"from":"eosio","to":"eosio.bpay","quantity":"92.7719 SYS","memo":"fund per-block bucket"} # eosio.bpay <= eosio.token::transfer {"from":"eosio","to":"eosio.bpay","quantity":"92.7719 SYS","memo":"fund per-block bucket"} # eosio.token <= eosio.token::transfer {"from":"eosio","to":"eosio.vpay","quantity":"278.3160 SYS","memo":"fund per-vote bucket"} # eosio <= eosio.token::transfer {"from":"eosio","to":"eosio.vpay","quantity":"278.3160 SYS","memo":"fund per-vote bucket"} # eosio.vpay <= eosio.token::transfer {"from":"eosio","to":"eosio.vpay","quantity":"278.3160 SYS","memo":"fund per-vote bucket"} # eosio.token <= eosio.token::transfer {"from":"eosio.bpay","to":"producer111a","quantity":"53.4400 SYS","memo":"producer block pay"} # eosio.bpay <= eosio.token::transfer {"from":"eosio.bpay","to":"producer111a","quantity":"53.4400 SYS","memo":"producer block pay"} # producer111a <= eosio.token::transfer {"from":"eosio.bpay","to":"producer111a","quantity":"53.4400 SYS","memo":"producer block pay"} warning: transaction executed locally, but may not be confirmed by the network yet从打印结果可以看到申领奖励的执行路径,这时候我们再来检查一下producer111a账户的余额,
root@iZ2ze5wsiqz8cj0lqgf73tZ:~/lwb-work/eos/tutorials/bios-boot-tutorial/nodes# cleos --wallet-url :6666 --url :8000 get currency balance eosio.token producer111a 63.4400 SYS刚刚发放的奖励53.4400 SYS已打入余额中,而之前的10 SYS是哪里来的?
脚本参数--max-unstaked,默认值为10,在股权账户被创建的时候,会读取这个参数的值,根据这个值来计算抵押创建账户消耗的资源,账户创建过程中,资源抵押的token是由eosio支付的,当账户创建完毕,资源被释放(即unstake),则会将10 SYS从eosio转账到账户中去。
六,代理投票投票过程说实在有点麻烦,因此有了代理投票的功能,代理投票分为两步:
注册代理我们通过命令将某个股权账户注册为一个代理,可接受小白的授权。
root@iZ2ze5wsiqz8cj0lqgf73tZ:~/lwb-work/eos/tutorials/bios-boot-tutorial/nodes# cleos --wallet-url :6666 --url :8000 system regproxy useraaaaaaab 2212425ms thread-0 main.cpp:429 create_action ] result: {"binargs":"708c31c6187315d601"} arg: {"code":"eosio","action":"regproxy","args":{"proxy":"useraaaaaaab","isproxy":true}} executed transaction: 4a8f2bad3a6f2e0d34d5ec1134e241f850e8a0c659cc65ce3cf4bedfaf28c97c 104 bytes 1216 us # eosio <= eosio::regproxy {"proxy":"useraaaaaaab","isproxy":1} warning: transaction executed locally, but may not be confirmed by the network yet可以看到useraaaaaaab账户的isproxy项已置为1,成为代理。
代理授权 root@iZ2ze5wsiqz8cj0lqgf73tZ:~/lwb-work/eos/tutorials/bios-boot-tutorial/nodes# cleos --wallet-url :6666 --url :8000 system voteproducer proxy useraaaaaaaa useraaaaaaab 2402472ms thread-0 main.cpp:429 create_action ] result: {"binargs":"608c31c6187315d6708c31c6187315d600"} arg: {"code":"eosio","action":"voteproducer","args":{"voter":"useraaaaaaaa","proxy":"useraaaaaaab","producers":[]}} executed transaction: c5501c7487d9ffcf6ce86b76f5c75d9fd68e22c84b376612d5266ea76199d37e 112 bytes 3062 us # eosio <= eosio::voteproducer {"voter":"useraaaaaaaa","proxy":"useraaaaaaab","producers":[]} # useraaaaaaab <= eosio::voteproducer {"voter":"useraaaaaaaa","proxy":"useraaaaaaab","producers":[]} warning: transaction executed locally, but may not be confirmed by the network yet我们成功将账户useraaaaaaaa的投票权代理给了代理账户useraaaaaaab。
代理投票