`

eos rpc create

    博客分类:
  • EOS
 
阅读更多
1.创建公私钥对
xjdeMacBook-Pro:safecode.contracts xj$ cleos create key --to-console
Private key: 5J9RmXH1pP4zKBpyMy2AF8LngJet3xEoEmKjDzG2tfbXD8X9au5
Public key: EOS62PB2MqjPGZjf2CDvjb8etM5jBqDbh9VR7UEABFP87WAKM3apR

2.create account:创建帐号
Positionals:
  creator TEXT                The name of the account creating the new account (required)
  name TEXT                   The name of the new account (required)
  OwnerKey TEXT               The owner public key for the new account (required)
  ActiveKey TEXT              The active public key for the new account

xjdeMacBook-Pro:programs xj$ cleos create account eosio xj12 EOS7gvkGGtJvixFLNh7PV5McVYhrYN4Swmh3Eu9Na9RFKx8FxYJht EOS7gvkGGtJvixFLNh7PV5McVYhrYN4Swmh3Eu9Na9RFKx8FxYJht
executed transaction: 55a7def6b647e28b8692de2078046a8b0e9b21aeca00caf396614700909b894c  200 bytes  794 us
#         eosio <= eosio::newaccount            {"creator":"eosio","name":"xj12","owner":{"threshold":1,"keys":[{"key":"EOS7gvkGGtJvixFLNh7PV5McVYhr...
warning: transaction executed locally, but may not be confirmed by the network yet         ]

客户端:
1.解析参数列表,校验owerkey,activekey是否是publickey
2.获取creator帐户权限
3.创建交易,将创建帐户的action打包到交易中(send_action)

服务端:
真正执行的是:apply_eosio_newaccount
trx_context.exec();
1.验证ower和active key
2.验证名字,最长12个字符
3.创建account_object
4.创建account_sequence_object
5.分别创建owner和active的允许对象(permission_usage_object,permission_object)
6.初始化帐户,根据account_name创建resource_limits_object
7.增加ram使用
trx_context.finalize();
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics