零基础EOS 节点部署,BP出块(三)-->开始部署
1.进入eosio主机终端
//eosio节点创建钱包
cleos wallet create
//保存解锁密钥
PW5K2Rg4rSYanfdcjnMcPhLUKZoBd2rq1W9mDZSoebgmKG55JXugU
//导入eosio帐号私钥
cleos wallet import 5KeqsXty9Sa8GfJgNfkckYxKKGcAWE4AWmUHiw6ifDcn3jjUg2i
//创建 eosio.token
cleos create account eosio eosio.token EOS5M2sNqDPZtQoBcRMnPQEnY1MJaVtdWWPx7A3UpcLgtzdLusFVW EOS5M2sNqDPZtQoBcRMnPQEnY1MJaVtdWWPx7A3UpcLgtzdLusFVW
//导入eosio.token私钥
cleos wallet import 5JvL5wbJeQdgpKDDLRFUyWmHwBpRDgvARn99cS4pXoxZt8p7p4w
//创建系统预留账户
cleos create account eosio eosio.bpay EOS5iezVa6bsmvZ3HNxdqgyX6GFRMWzE7FsjS3cui8Foavxnj8CfR EOS5iezVa6bsmvZ3HNxdqgyX6GFRMWzE7FsjS3cui8Foavxnj8CfR
cleos create account eosio eosio.msig EOS8K1wkfCzPmxAjjfqvqw6zQ1Dbc82YsQyR8MmwNFLcRHcJtth89 EOS8K1wkfCzPmxAjjfqvqw6zQ1Dbc82YsQyR8MmwNFLcRHcJtth89
cleos create account eosio eosio.names EOS5ps938c5zj6UqhdCfssyAy7WSbHgfZoraqD6HrnbpmpEwPwX7S EOS5ps938c5zj6UqhdCfssyAy7WSbHgfZoraqD6HrnbpmpEwPwX7S
cleos create account eosio eosio.ram EOS7DA8jGA6HfZXYcGSGJNsWJL5Q6t5bWcvm4zNykN3Jw7tASzBCR EOS7DA8jGA6HfZXYcGSGJNsWJL5Q6t5bWcvm4zNykN3Jw7tASzBCR
cleos create account eosio eosio.ramfee EOS7R1Ds4zLMPN6onVXjL8XGgKHHCMWjLT7wn3bHcHnQX3dVLErjE EOS7R1Ds4zLMPN6onVXjL8XGgKHHCMWjLT7wn3bHcHnQX3dVLErjE
cleos create account eosio eosio.saving EOS4uDMpca1dAK7HZZRQ1SqWZHvJNnakzsSuTmM12crvzwRorwQcQ EOS4uDMpca1dAK7HZZRQ1SqWZHvJNnakzsSuTmM12crvzwRorwQcQ
cleos create account eosio eosio.stake EOS6BDfFaFZgvx889BQbdaGTMYSn5tUuxaynGQDhpDGD662eBGwkF EOS6BDfFaFZgvx889BQbdaGTMYSn5tUuxaynGQDhpDGD662eBGwkF
cleos create account eosio eosio.upay EOS7zS7sHctU54oD6is2oPfq11duCMSWfda3HXJAghSfqqr2BZZnV EOS7zS7sHctU54oD6is2oPfq11duCMSWfda3HXJAghSfqqr2BZZnV
//切换到contracts目录
cd /eos/build/contracts
//部署eosio.token合约
cleos set contract eosio.token eosio.token
//创建代币 (BM将线上代码EOS 改成了SYS,之后上线后还是EOS)
cleos push action eosio.token create '["eosio","10000000000.0000 SYS",0,0,0]' -p eosio.token
//发布代币
cleos push action eosio.token issue '["eosio","10000000000.0000 SYS","issue"]' -p eosio
//查询代币数量
cleos get currency balance eosio.token eosio
//部署eosio.bios合约
cleos set contract eosio eosio.bios/ -p eosio
//部署eosio.system合约
cleos set contract eosio eosio.system -p eosio
//创建BP节点账户
cleos system newaccount eosio eosio.bp1 EOS7mcXeVUSLCZxEf8eBPm2MbmiswNovoB6rk71pPqaZoxwSAeK7b EOS7mcXeVUSLCZxEf8eBPm2MbmiswNovoB6rk71pPqaZoxwSAeK7b --stake-net '50.00 SYS' --stake-cpu '50.00 SYS' --buy-ram-kbytes 10000
cleos system newaccount eosio eosio.bp2 EOS6hfh1yup4tZjbjhD3oPuZwMFqL4iUVehgMsukuvx5ojTWuurtT EOS6hfh1yup4tZjbjhD3oPuZwMFqL4iUVehgMsukuvx5ojTWuurtT --stake-net '50.00 SYS' --stake-cpu '50.00 SYS' --buy-ram-kbytes 10000
//创建Voter账户
cleos system newaccount eosio voter1 EOS6wLrhcEQDZJvfZSCgVkFzsKcv34XTsTTjXXQZajWaBbEhvLPMg EOS6wLrhcEQDZJvfZSCgVkFzsKcv34XTsTTjXXQZajWaBbEhvLPMg --stake-net '50.00 SYS' --stake-cpu '50.00 SYS' --buy-ram-kbytes 10000
cleos system newaccount eosio voter2 EOS6u8i7rknHyAd7AdziWSnEsAbyJHA3U9So4R8p2z58cA1KeEDv2 EOS6u8i7rknHyAd7AdziWSnEsAbyJHA3U9So4R8p2z58cA1KeEDv2 --stake-net '50.00 SYS' --stake-cpu '50.00 SYS' --buy-ram-kbytes 10000
cleos system newaccount eosio voter3 EOS8LyieKTsMAZGp7DSEhBPEPmPXvQKT5c3EXgEvACcdRwwRwDzoy EOS8LyieKTsMAZGp7DSEhBPEPmPXvQKT5c3EXgEvACcdRwwRwDzoy --stake-net '50.00 SYS' --stake-cpu '50.00 SYS' --buy-ram-kbytes 10000
//导入Voter私钥
cleos wallet import 5Jb2DtzYFU9c3LSEP5PPAfN7Je8d8yLGdDN42n561zy34UFwzTN
cleos wallet import 5JsFet6W3Xmp3DvcHJsJ6GVcksSZJunGhmjpQaE9Np2ZtK4JYbc
cleos wallet import 5JdQRPPCXtVLKBj5qhg6QtVq5PHuKoKnrcpePG6CsryPuYkiWX6
//给Voter账户转账
cleos push action eosio.token transfer '["eosio", "voter1","100000000.0000 SYS","vote"]' -p eosio
cleos push action eosio.token transfer '["eosio", "voter2","100000000.0000 SYS","vote"]' -p eosio
cleos push action eosio.token transfer '["eosio", "voter3","100000000.0000 SYS","vote"]' -p eosio
//锁定Voter账户需要投票的代币
cleos system delegatebw voter1 voter2 '25000000.0000 SYS' '25000000.0000 SYS' --transfer
cleos system delegatebw voter2 voter3 '25000000.0000 SYS' '25000000.0000 SYS' --transfer
cleos system delegatebw voter3 voter1 '25000000.0000 SYS' '25000000.0000 SYS' --transfer
2.进入eosio.bp1 主机终端
//BP1节点创建钱包
cleos wallet create
//保存解锁密钥
PW5HsYdyQdQfTgHJnpaiGRjFVDLs7Cb48A6PzeneaDNdSf8UnrntT
//导入私钥
cleos wallet import 5JzWCZ9W7VNWLYroQpjYG2z6H6UjJUkKdinZpumf6Ru2xoxSrKT
//BP1节点申请BP
cleos system regproducer eosio.bp1 EOS7mcXeVUSLCZxEf8eBPm2MbmiswNovoB6rk71pPqaZoxwSAeK7b http://eosio.bp1.ip:8888
3.进入eosio.bp2 主机终端
//BP2节点创建钱包
cleos wallet create
//保存私钥
PW5JaB4WtawXWE6wmDymsprEdh9xPiL5EakY83JDywdvpFbK9fWpG
//导入私钥
cleos wallet import 5HragVTsSmmAg1mznNMDSeAp2ZezcNBw6SbczrNpNtUqRcx4vhh
//BP2申请BP
cleos system regproducer eosio.bp2 EOS6hfh1yup4tZjbjhD3oPuZwMFqL4iUVehgMsukuvx5ojTWuurtT http://eosio.bp2.ip:8888
4.回到eosio主机终端
//BP节点申请BP
cleos system regproducer eosio EOS5DkKbBZnSKNSV1iu27ovnygGhoCA99eH69KyNNkSkNrrbBoiRe http://eosio.eosio.ip:8888
//开始投票
cleos system voteproducer prods voter1 eosio.bp1
cleos system voteproducer prods voter2 eosio.bp1
cleos system voteproducer prods voter3 eosio.bp1
cleos system voteproducer prods voter1 eosio.bp2
cleos system voteproducer prods voter2 eosio.bp2
cleos system voteproducer prods voter3 eosio.bp2
cleos system voteproducer prods voter1 eosio
cleos system voteproducer prods voter2 eosio
cleos system voteproducer prods voter3 eosio
此时 eosio, eosio.bp1, eosio.bp2 已出块
当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »