1. 程式人生 > >EOSIO:EOSIO最新版1.4.0建立測試賬戶

EOSIO:EOSIO最新版1.4.0建立測試賬戶

EOSIO最新版1.4.0建立測試賬戶

前言

這節根據官方教程建立測試賬戶唄

什麼是賬戶?

帳戶是授權的集合,儲存在區塊鏈中,用於識別傳送方/接收方。它具有靈活的授權結構,根據許可權配置的不同,它可以由個人或一組個人擁有。帳戶需要向區塊鏈傳送或接收有效的事務。

本系列教程使用兩個“使用者”帳戶bob和alice,以及配置的預設eosio帳戶。在本系列教程中,還為各種合同做了額外的說明。

1.建立測試賬戶

在這些教程中,使用了bob和alice。使用cleos建立兩個帳戶。

建立賬戶 使用公鑰喲。

[email protected]:~$ cleos create account eosio bob EOS6zYAdHChHVsakBYhPQwsagF5GvJ6ncbdSBKNYDJ1mc4P1ShTye
Failed to connect to nodeos at http://127.0.0.1:8888/; is nodeos running?
[email protected]
:~$

當然建立賬戶前需要啟動本地結點。修改nodeos對應配置檔案

主要配置為

http-server-address = 127.0.0.1:8888
enable-stale-production = true
producer-name = eosio

plugin = eosio::producer_plugin
plugin = eosio::wallet_api_plugin //這個貌似可以不用配置了
plugin = eosio::chain_api_plugin
plugin = eosio::http_plugin

啟動結點

nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin

再次建立使用者,剛開始報3080004錯誤,然後到到處百度,沒找到原因,然後再次執行就好了!

[email protected]:~$ cleos create account eosio bob EOS6zYAdHChHVsakBYhPQwsagF5GvJ6ncbdSBKNYDJ1mc4P1ShTye
Error 3120003: Locked wallet
Ensure that your wallet is unlocked before using it!
[email protected]
:~$ cleos wallet unlock -n wallet_laymond password: Unlocked: wallet_laymond [email protected]:~$ cleos create account eosio bob EOS6zYAdHChHVsakBYhPQwsagF5GvJ6ncbdSBKNYDJ1mc4P1ShTye Error 3080004: Transaction exceeded the current CPU usage limit imposed on the transaction [email protected]:~$ [email protected]:~$ cleos create account eosio bob EOS6zYAdHChHVsakBYhPQwsagF5GvJ6ncbdSBKNYDJ1mc4P 1ShTye executed transaction: 43f5103f362fc5c86ad8b72765b5fb682f1d7f2a4f9219e4d31b8f590eb8529d 200 bytes 280 us # eosio <= eosio::newaccount {"creator":"eosio","name":"bob","owner":{"thresho ld":1,"keys":[{"key":"EOS6zYAdHChHVsakBYhPQwsagF5Gv... warning: transaction executed locally, but may not be confirmed by the network yet ] [email protected]:~$ cleos create account eosio alice EOS6zYAdHChHVsakBYhPQwsagF5GvJ6ncbdSBKNYDJ1mc4P1ShTye executed transaction: 325dbb2f4a52c0b876909c5e749c795ad4f6dd5c2049ca93927f4e22259f755e 200 bytes 383 us # eosio <= eosio::newaccount {"creator":"eosio","name":"alice","owner":{"threshold":1,"keys":[{"key":"EOS6zYAdHChHVsakBYhPQwsagF5... warning: transaction executed locally, but may not be confirmed by the network yet ] [email protected]:~$

EOSIO有一個獨特的授權結構,為您的帳戶增加了安全性。通過使用與活動許可權關聯的金鑰,您可以保持所有者金鑰為冷,從而最小化帳戶的暴露。這樣,如果你的活動金鑰被破壞了,你可以用你的所有者金鑰重新控制你的帳戶

檢查

如果在建立帳戶時出錯,請確認您的錢包已解鎖。

你的解鎖的錢包 後面有個*

[email protected]:~$ cleos wallet list
Wallets:
[
  "default",
  "wallet_laymond *"
]
[email protected]:~$