创建配置文件proposal.json
{
"module": "proposal",
"method": "Propose",
"args" : {
"min_vote_percent": 51,
"stop_vote_height": 29
},
"trigger": {
"height": 30,
"module": "consensus",
"method": "update_consensus",
"args" : {
"name": "tdpos",
"config": {
"version":"100",
"proposer_num": "2",
"period": "3000",
"alternate_interval": "3000",
"term_interval": "6000",
"block_num": "20",
"vote_unit_price": "1",
"init_proposer": {
"1": [
"dpzuVdosQrF2kmzumhVeFQZa1aYcdgFpN","RdQqDzChUjznMUowZXbHGhkWTVtsDoBTh"
]
},
"init_proposer_neturl": {
"1": [
"/ip4/127.0.0.1/tcp/47101/p2p/QmVxeNubpg1ZQjQT8W5yZC9fD7ZB1ViArwvyGUB53sqf8e",
"/ip4/127.0.0.1/tcp/47102/p2p/QmVjfvZHJ9AvGBeyiH278V1d5YdVASQWYeBT3RUGELRXoH"
]
}
}
}
}
}
将配置信息写入链上
./xchain-cli transfer --to dpzuVdosQrF2kmzumhVeFQZa1aYcdgFpN --desc proposal.json --amount 1
使用./xchain-cli tx query f0db6d4c793db780ea4d643c9a694bcfbb533693f07bd82d4d0a1bceb764f47a
查询上链信息
查询资质总量./xchain-cli status --host localhost:37101 | grep -i total
发送投票,Hash值为上一步生成的Hash值
./xchain-cli vote --amount 100000000000000000000 --frozen 33 f0db6d4c793db780ea4d643c9a694bcfbb533693f07bd82d4d0a1bceb764f47a
查看冻结资金
/xchain-cli account balance -Z
等到超过生效高度时,./xchain-cli tdpos status
查看tdpos状态
注意
stop_vote_height < height <frozen 即停止投票交易高度小于共识生效高度,同时小于解冻高度
最终投票金额必须是全网金额的51%以上
网友评论