1. 程式人生 > >常用命令(獲取餘額、建立賬戶、傳送EOS Token)

常用命令(獲取餘額、建立賬戶、傳送EOS Token)

前言

執行環境為Jungle Testnet網內。

命令格式:

./cleos.sh get currency balance eosio.token <account name>

實際執行:

cleos --url http://193.93.219.219:8888 get currency balance eosio.token biezhihua

執行結果:

29799.8032 EOS
30000.0000 JUNGLE

命令格式:

./cleos.sh system newaccount --stake-net "100.0000 EOS" --stake-cpu
"100.0000 EOS" --buy-ram-kbytes 4 <your accountr> <new account> <owner_pup_key> <active_pub_key>

實際執行:
建立huyuqiong521的賬戶

cleos --url http://193.93.219.219:8888 system newaccount --stake-net "100.0000 EOS" --stake-cpu "100.0000 EOS" --buy-ram-kbytes 4 biezhihua huyuqiong521  EOS6ivwcgQop3qsyYrWv79ACnjWmSxBnMsYUNvZnLrQitKjuZgrBr
EOS6ivwcgQop3qsyYrWv79ACnjWmSxBnMsYUNvZnLrQitKjuZgrBr

注意:100.0000 EOS之間必須有空格,否則會報如下錯誤 Invalid asset
Asset's amount and symbol should be separated with space

2018-08-18T02:44:02.968 thread-0   asset.cpp:79                  from_string          ] 3010011 asset_type_exception: Invalid asset
Asset's amount and
symbol should be separated with space {} thread-0 asset.cpp:42 from_string 2018-08-18T02:44:02.968 thread-0 asset.cpp:79 from_string ] from: 100.0000EOS Error 3010011: Invalid asset Error Details: Asset's amount and symbol should be separated with space rethrow

執行結果:

executed transaction: 552ee5cbb6426b3d39ec17d1334746905346058e2168fa8f2ad9b2b6e05760f5  336 bytes  11476 us
#         eosio <= eosio::newaccount            {"creator":"biezhihua","name":"huyuqiong521","owner":{"threshold":1,"keys":[{"key":"EOS6ivwcgQop3qsy...
#         eosio <= eosio::buyrambytes           {"payer":"biezhihua","receiver":"huyuqiong521","bytes":4096}
#   eosio.token <= eosio.token::transfer        {"from":"biezhihua","to":"eosio.ram","quantity":"0.1958 EOS","memo":"buy ram"}
#     biezhihua <= eosio.token::transfer        {"from":"biezhihua","to":"eosio.ram","quantity":"0.1958 EOS","memo":"buy ram"}
#     eosio.ram <= eosio.token::transfer        {"from":"biezhihua","to":"eosio.ram","quantity":"0.1958 EOS","memo":"buy ram"}
#   eosio.token <= eosio.token::transfer        {"from":"biezhihua","to":"eosio.ramfee","quantity":"0.0010 EOS","memo":"ram fee"}
#     biezhihua <= eosio.token::transfer        {"from":"biezhihua","to":"eosio.ramfee","quantity":"0.0010 EOS","memo":"ram fee"}
#  eosio.ramfee <= eosio.token::transfer        {"from":"biezhihua","to":"eosio.ramfee","quantity":"0.0010 EOS","memo":"ram fee"}
#         eosio <= eosio::delegatebw            {"from":"biezhihua","receiver":"huyuqiong521","stake_net_quantity":"100.0000 EOS","stake_cpu_quantit...
#   eosio.token <= eosio.token::transfer        {"from":"biezhihua","to":"eosio.stake","quantity":"200.0000 EOS","memo":"stake bandwidth"}
#     biezhihua <= eosio.token::transfer        {"from":"biezhihua","to":"eosio.stake","quantity":"200.0000 EOS","memo":"stake bandwidth"}
#   eosio.stake <= eosio.token::transfer        {"from":"biezhihua","to":"eosio.stake","quantity":"200.0000 EOS","memo":"stake bandwidth"}
warning: transaction executed locally, but may not be confirmed by the network yet    ] 

命令格式:

./cleos.sh transfer <your account>  <receiver account> "1.0000 EOS" "test memo text"

實際執行:

cleos -u http://193.93.219.219:8888 transfer biezhihua huyuqiong521 "1 EOS" "胡玉瓊是逗逼"

執行結果:

executed transaction: 10bb27c41eeac1c91ed7c247886a845a3849458ee07d751b99d4f7602b6c16fc  144 bytes  1103 us
#   eosio.token <= eosio.token::transfer        {"from":"biezhihua","to":"huyuqiong521","quantity":"1.0000 EOS","memo":"胡玉瓊是逗逼"}
#     biezhihua <= eosio.token::transfer        {"from":"biezhihua","to":"huyuqiong521","quantity":"1.0000 EOS","memo":"胡玉瓊是逗逼"}
#  huyuqiong521 <= eosio.token::transfer        {"from":"biezhihua","to":"huyuqiong521","quantity":"1.0000 EOS","memo":"胡玉瓊是逗逼"}
warning: transaction executed locally, but may not be confirmed by the network yet    ]