EOSIO 指南(啓動你的節點並設置)

啓動你的節點並設置

第1步:引導節點和電子錢包

步驟1.1:啓動keosd

首先讓咱們啓動keosd:node

keosd &

你應該看到一些看起來像這樣的輸出:shell

info  2018-11-26T06:54:24.789 thread-0  wallet_plugin.cpp:42          plugin_initialize    ] initializing wallet plugin
info  2018-11-26T06:54:24.795 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/keosd/stop
info  2018-11-26T06:54:24.796 thread-0  wallet_api_plugin.cpp:73      plugin_startup       ] starting wallet_api_plugin
info  2018-11-26T06:54:24.796 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/create
info  2018-11-26T06:54:24.796 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/create_key
info  2018-11-26T06:54:24.796 thread-0  http_plugin.cpp:554           add_handler          ] add api url: /v1/wallet/get_public_keys

enter鍵退出。segmentfault

步驟1.2:啓動nodeos

nodeos -e -p eosio \
--plugin eosio::producer_plugin \
--plugin eosio::chain_api_plugin \
--plugin eosio::http_plugin \
-d CONTRACTS_DIR/eosio/data \
--config-dir CONTRACTS_DIR/eosio/config \
--access-control-allow-origin='*' \
--contracts-console \
--http-validate-host=false \
—filter-on='*' >> nodeos.log 2>&1 &

這些設置可實現如下功能:api

  1. 在開發目錄下的eosio目錄中爲區塊鏈數據和配置使用工做目錄,這裏咱們分別使用eosio/dataeosio/config
  2. 運行Nodeos,此命令加載全部基本插件、設置服務器地址、啓用CORS並添加一些合約調試和日誌記錄。
  3. 啓用CORS沒有限制(*)。
在上面的配置中,CORS僅用於開發目的 *,你永遠不該在可公開訪問的節點上啓用CORS爲 *

第2步:檢查安裝

步驟2.1:檢查Nodeos是否正在生成塊

運行如下命令:瀏覽器

tail -f nodeos.log

你應該在控制檯中看到一些以下所示的輸出:服務器

1929001ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366974ce4e2a... #13929 @ 2018-05-23T16:32:09.000 signed by eosio [trxs: 0, lib: 13928, confirmed: 0]
1929502ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366aea085023... #13930 @ 2018-05-23T16:32:09.500 signed by eosio [trxs: 0, lib: 13929, confirmed: 0]
1930002ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366b7f074fdd... #13931 @ 2018-05-23T16:32:10.000 signed by eosio [trxs: 0, lib: 13930, confirmed: 0]
1930501ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366cd8222adb... #13932 @ 2018-05-23T16:32:10.500 signed by eosio [trxs: 0, lib: 13931, confirmed: 0]
1931002ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366d5c1ec38d... #13933 @ 2018-05-23T16:32:11.000 signed by eosio [trxs: 0, lib: 13932, confirmed: 0]
1931501ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366e45c1f235... #13934 @ 2018-05-23T16:32:11.500 signed by eosio [trxs: 0, lib: 13933, confirmed: 0]
1932001ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000366f98adb324... #13935 @ 2018-05-23T16:32:12.000 signed by eosio [trxs: 0, lib: 13934, confirmed: 0]
1932501ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 00003670a0f01daa... #13936 @ 2018-05-23T16:32:12.500 signed by eosio [trxs: 0, lib: 13935, confirmed: 0]
1933001ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 00003671e8b36e1e... #13937 @ 2018-05-23T16:32:13.000 signed by eosio [trxs: 0, lib: 13936, confirmed: 0]
1933501ms thread-0   producer_plugin.cpp:585       block_production_loo ] Produced block 0000367257fe1623... #13938 @ 2018-05-23T16:32:13.500 signed by eosio [trxs: 0, lib: 13937, confirmed: 0]

ctrl+c關閉日誌。curl

步驟2.2:檢查錢包

打開shell並運行如下命令:區塊鏈

cleos wallet list

你應該看到一個響應url

Wallets:
[]

從如今開始,你將從本地系統(Linux或Mac)執行命令。插件

步驟2.3:檢查Nodeos端點

這將檢查RPC API是否正常工做,選擇一個。

  1. 在瀏覽器中檢查chain_api_plugin提供的get_info端點:http://localhost:8888/v1/chain/get_info
  2. 檢查相同的事情,但在你主機上的控制檯中。

    curl http://localhost:8888/v1/chain/get_info

上一篇:安裝EOSIO

下一篇:安裝CDT

相關文章
相關標籤/搜索