运维开发网

【系列】 EOS开发6 创建EOS账户

运维开发网 https://www.qedev.com 2020-06-15 15:50 出处:网络 作者:运维开发网整理
安装docker 使用命令行创建EOS账户需要有一套EOS开发环境,这里我们使用一个已经安装了EOS套件的docker环境,本文使用Mac系统,关于docker软件的安装可查看 Mac docker install 创建EOS账户 启动docker docker run --rm -it eosio/eos:latest /bin/bash 确认eos主网信息 [email protected]:
安装docker

使用命令行创建EOS账户需要有一套EOS开发环境,这里我们使用一个已经安装了EOS套件的docker环境,本文使用Mac系统,关于docker软件的安装可查看

Mac docker install

创建EOS账户

  1. 启动docker

    docker run --rm -it eosio/eos:latest /bin/bash

  2. 确认eos主网信息

    [email protected]:/opt/eosio# ./bin/cleos -u

    http://mainnet.eoswz.com get info
    {
    "server_version": "db570801",
    "chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906",
    "head_block_num": 198160,
    "last_irreversible_block_num": 198159,
    "last_irreversible_block_id": "0003060fc4f73548996ba657e008c3dcf299b9e3c51085fb3d8288345f6c0563",
    "head_block_id": "000306103792c66883cf2a6e8be8745dfb10ab503b25b81eed76e4daa906edc7",
    "head_block_time": "2018-06-11T14:29:29",
    "head_block_producer": "genesisblock",
    "Virtual_block_cpu_limit": 200000000,
    "Virtual_block_net_limit": 1048576000,
    "block_cpu_limit": 199900,
    "block_net_limit": 1048576
    }

    注意EOS主链ID为aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906,只有看到这个ID才是真正的EOS

  3. 创建钱包,保存密码

    [email protected]:/opt/eosio# ./bin/cleos wallet create

    "/opt/eosio/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.

    “PW5Ju1KZ5LApHVzAtwXGm83LDNWoAyybkpisxxxxxxx”

  4. 解锁钱包(如果需要)

    cleos wallet unlock

    根据输入以上密码

  5. 导入私钥到钱包

    [email protected]:/opt/eosio# ./bin/cleos wallet import xxxxxxxxXdWN4f5rsDmZ53sd6er1JEmf8kxxxxxxxxx

    imported private key for: EOS8TQRjDk9cSKw5WoUWmgmNC8DAzCxxCwxxxxxxxxx

  6. 查看账户

    [email protected]:/opt/eosio# ./bin/cleos -u http://mainnet.eoswz.com get accounts EOS8TQRjDk9cSKw5WoUWmgmNC8DAzCxxCwxxxxxxxx

    {

    "account_names": [

    "gy4domrvguge"

    ]

    }

  7. 查看账户余额

    [email protected]:/opt/eosio# ./bin/cleos -u http://mainnet.eoswz.com get currency balance eosio.token gy4domrvguge EOS

    10.0000 EOS

  8. 创建一个新私钥对

    [email protected]:/opt/eosio# ./bin/cleos create key

    Private key: 5JAvLYWHK3AmpvrGoPT6185rHUhD3FkY2CxSy4axxxxx

    Public key: EOS8gsDpXU69w3eaeuWnvnYcTCxxxxxx

  9. 导入到钱包

    [email protected]:/opt/eosio# ./bin/cleos wallet import 5JAvLYWHK3AmpvrGoPT6185rHUhD3FkY2CxSy4axxxxx

    imported private key for: EOS8gsDpXU69w3eaeuWnvnYcTCxxxxxxxxx

  10. 查询账户名是否被注册

    http://www.dappworld.com/api/v1/eos/account

  11. 创建新账户

    [email protected]:/opt/eosio# ./bin/cleos -u http://mainnet.eoswz.com system newaccount --stake-net ‘0.0 EOS‘ --stake-cpu ‘0.0 EOS‘ --buy-ram-kbytes 3 gy4domrvguge eosfanwallet EOS8gsDpXU69w3eaeuWnvnYcTCxxxxxxxx

好了,这样我们就创建了一个名为“eosfanwallet”的EOS账户,花费了少量的EOS,大概是人民币3元

「力场 lichang.io」公链挖矿第一社区!

0

精彩评论

暂无评论...
验证码 换一张
取 消