区块链

创建EOS钱包和账户

2018-06-01  本文已影响6959人  ytxing

环境

aws 机器dec-1

创建钱包

参考 https://github.com/EOSIO/eos/tree/dawn-v3.0.0#autobuild

$ cleos wallet create
"/usr/local/bin/keosd" launched
Creating wallet: default
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"${password}"

解锁

nodeos未启动情况下默认是已经解锁的状态

$ cleos wallet unlock --password ${password}
Error 3120007: Already unlocked
Error Details:
Wallet is already unlocked: default

使用完后需要锁上

加锁

加锁不需要密码

$ cleos wallet lock
Locked: default

创建秘钥对

owner key

$ cleos create key
Private key: ${owner-private-key}
Public key: ${owner-public-key}

active key

$ cleos create key
Private key: ${active-private-key}
Public key: ${active-public-key}

导入到钱包

$ cleos wallet import ${owner-private-key}
imported private key for: ${owner-public-key}
$ cleos wallet keys
[
  "${default-public-key}",
  "${owner-public-key}"
]
$ cleos wallet import ${active-private-key}
imported private key for: ${active-public-key}
$ cleos wallet keys
[
  "${active-public-key}",
  "${default-public-key}",
  "${owner-public-key}"
]

注意,钱包里本来有一个key,来自于配置文件。
owner key和active key导入后,一共3个key了。

创建账户(account)

用刚才的owner key和active key创建账户

$ cleos create account eosio debug ${owner-public-key} ${active-public-key}
executed transaction: c95182013fd38fca1fad78b11091deccb1f5e93647a93313a48a62a4f6ed4fc6  200 bytes  217 us
#         eosio <= eosio::newaccount            {"creator":"eosio","name":"debug","owner":{"threshold":1,"keys":[{"key":"EOS8UCi6r82EvzxKd5KFv3um3fn...
warning: transaction executed locally, but may not be confirmed by the network yet

检查一下

$ cleos get account debug
privileged: false
permissions:
     owner     1:    1 ${owner-public-key}
        active     1:    1 ${active-public-key}
memory:
     quota:        -1 bytes  used:      2.66 Kb

net bandwidth: (averaged over 3 days)
     used:                -1 bytes
     available:           -1 bytes
     limit:               -1 bytes

cpu bandwidth: (averaged over 3 days)
     used:                -1 us
     available:           -1 us
     limit:               -1 us


上一篇下一篇

猜你喜欢

热点阅读