王明月的博客

欢迎交流共同进步:微信may008008

EOS区块链 智能合约 教程1(发布合约)

EOS 智能合约

启动EOS单节点区块链
教程地址:https://github.com/EOSIO/eos/wiki/Local-Environment#2-building-eosio

命令:

cd build/programs/nodeos
./nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --resync-blockchain

创建钱包
命令:cleos wallet create

解锁钱包
命令:cleos wallet unlock

创建一个KEY
key,创建一对新的key,并打印出来,包括私钥和公钥
命令:cleos create key

创建账户
命令格式:cleos create account [options] <创建者> <账户名> OwnerKey ActiveKey,这里的ownerkey和activekey是前面通过cleos create key生成的两组key的public key

下面是创建一个账号的完整步骤命令
$ cleos create key # 创建OwnerKey

$ cleos create key # 创建ActiveKey

$ cleos create wallet unlock # 解锁钱包

$ cleos create account eosio bob2 public-OwnerKey public-ActiveKey

结果提示:
“creator”:”eosio”,”name”:”bob2”,

发布合约
命令:cleos set contract eosio ../contracts/eosio.bios -p eosio
返回结果:

Reading WAST/WASM from ../contracts/eosio.bios/eosio.bios.wasm...
Using already assembled WASM...
Publishing contract...
executed transaction: d4231ef159ce6445f770935335e23cd1fd5bce0c515b43c399944d7c20268608  3256 bytes  13714 us
#         eosio <= eosio::setcode               {"account":"eosio","vmtype":0,"vmversion":0,"code":"0061736d01000000015c1160037f7e7f0060057f7e7e7e7e...
#         eosio <= eosio::setabi                {"account":"eosio","abi":{"types":[],"structs":[{"name":"set_account_limits","base":"","fields":[{"n...
阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u011439012/article/details/80334568
个人分类: 区块链
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

EOS区块链 智能合约 教程1(发布合约)

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭