EOS開發教程(1.3)

in eos •  3 months ago 

開啟節點以及配置
Step 1: 啟動節點與錢包
Step 1.1: 開啟keosd
首先讓我們開啟keosd:
keosd &
妳會看到類似下面的壹些輸出:
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
按回車鍵繼續
Step 1.2: 開啟 nodeos
現在開啟nodeos:
nodeos -e -p eosio \ --plugin eosio::producer_plugin \ --plugin eosio::chain_api_plugin \ --plugin eosio::http_plugin \ --access-control-allow-origin='*' \ --contracts-console \ --http-validate-host=false \ --verbose-http-errors >> nodeos.log 2>&1 &
這些設置會完成以下事情:

  1. 運行Nodeos.這條指令加載了所有基礎的插件,設置服務器地址,開啟CORS,以及添加壹些合約的debugging功能和日誌功能。
  2. 無限制開啟CORS
    在上面的配置中,只有在開發用途時,才能使用來開啟CORS,千萬不要在壹個可以公開訪問的節點上使用來開啟CORS!
    Step 2: 檢查安裝狀態
    Step 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 關掉日誌。
    Step 2.2: 檢查錢包狀態
    打開shell,運行cleos指令,列出所有可用的錢包。我們會在後面詳細說說錢包。現在,我們只需要驗證安裝狀態,看看命令行客戶端cleos是不是按我們預想的那樣運行。
    cleos wallet list
    妳會看到壹個包含空錢包列表的輸出:
    Wallets: []
    Step 2.3: 檢查Nodeos endpoints
    下面的指令將會檢查RPC API 是否正確的運行,選壹種命令就行。
  3. 在妳的瀏覽器中訪問 http://localhost:8888/v1/chain/get_info,通過chain_api_plugin來檢查get_info endpoint。
    在妳主機的控制臺上執行下面的shell命令
    curl http://localhost:8888/v1/chain/get_info
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://www.coursehero.com/file/p57j8ub/500-signed-by-eosio-trxs-0-lib-13931-confirmed-0-1931002ms-thread-0/