美文网首页
Eos创建钱包,账户,部署合约,发行代币,转账

Eos创建钱包,账户,部署合约,发行代币,转账

作者: stevenlife | 来源:发表于2018-10-16 20:17 被阅读0次
    1. 启动keosd以及nodeos:同时启动在不同的端口。

       ./keosd --http-server-address 127.0.0.1:9000
      
       ./nodeos  --http-server-address 127.0.0.1:8888
      

    2.创建钱包

     cleos wallet create -n "wallet-name"
    

    3.创建密钥

    cleos create key
    

    我们创建两对密钥[public_key1, private_key1],[public_key2, private_key2],一对给合约账户(contacttoken)使用,一对给代币方账户(issuetoken)以及普通账户使用

    4.导入私钥

    cleos wallet import -n "wallet-name" private_key1
    
    cleos wallet import -n "wallet-name" private_key2 
    

    5.创建账户

    cleos create account eosio contacttoken public_key1
    cleos create account eosio issuetoken public_key2
    cleos create account eosio user public_key2
    

    创建三个账户:合约方账户contacttoken ,代币方账户issuetoken ,普通用户账户user

    6.部署合约到合约账户contacttoken

    cleos set contract contacttoken ../../contracts/eosio.token -p contacttoken
    

    7.创建代币

    cleos push action contacttoken create '[ "eosio", "1000000000.0000 NSH", 0, 0, 0]' -p contacttoken
    

    8.将代币总量转给发行方账户issuetoken

    cleos push action contacttoken issue '["issuetoken ", "1000000000.0000 NSH", "contacttoken issue to issuetoken "]' -p eosio
    

    9.转账

    cleos push action contacttoken transfer '["issuetoken ","user","10000.0000 NSH","issuetoken to user 1000NSH"]' -p issuetoken 
    

    10.查询余额

     cleos get currency balance contacttoken user NSH

    相关文章

      网友评论

          本文标题:Eos创建钱包,账户,部署合约,发行代币,转账

          本文链接:https://www.haomeiwen.com/subject/kahkzftx.html