EOS是什么
EOSIO是一個它開源的區塊鏈項目,旨在實現分散式應用程序的垂直和水平擴展(“EOSIO軟件”),并可用于啟動私有和公共區塊鏈網絡。這是通過類似操作系統的構造實現的,可以在其上構建應用程序。該軟件提供帳戶,身份驗證,數據庫,異步通信以及跨多個CPU核心和/或群集的應用程序調度。由此產生的技術是一種區塊鏈架構,有可能每秒擴展到數百萬個事務,注意,只是有可能擴展到數百萬個事物。消除了用戶費用,并允許快速輕松地部署分散式應用程序。
在安裝錢包節點之前,咱們應該先了解一下EOS的架構,下面是EOS的一個模塊架構。
nodeos(node + eos = nodeos)-可以使用插件配置以運行節點的核心EOSIO節點守護程序。示例用法是塊生產,專用API端點和本地開發。
cleos(cli + eos = cleos)-與區塊鏈交互并管理錢包的命令行界面
keosd(key + eos = keosd)-將EOSIO密鑰安全存儲在錢包中的組件。
eosio-cpp - eosio.cdt的一部分,它將C++代碼編譯為WASM并可以生成ABI
安裝EOS錢包節點
下面咱們使用二進制文件來構建項目,從源碼來構建項目的話,這種操作方式比較復雜,而且很浪費時間,這里不推薦這種方式。
1.各種平臺上安裝EOS
1.1.在mac平臺下安裝EOS
brew tap eosio/eosio brew install eosio
1.2.Ubuntu18.04
wget https://github.com/eosio/eos/releases/download/v1.5.0/eosio_1.5.0-1-ubuntu-18.04_amd64.deb sudo apt install ./eosio_1.5.0-1-ubuntu-18.04_amd64.deb
1.3.centos
wget https://github.com/eosio/eos/releases/download/v1.5.0/eosio-1.5.0-1.el7.x86_64.rpm sudo yum install ./eosio-1.5.0-1.el7.x86_64.rpm
1.5.Fedora
wget https://github.com/eosio/eos/releases/download/v1.5.0/eosio-1.5.0-1.fc27.x86_64.rpm sudo yum install ./eosio-1.5.0-1.fc27.x86_64.rpm
2.啟動節點并對節點進行配置
2.1.啟動Keosd
keosd &
執行上面這個命令之后,你應該可以看到類似下面這樣的輸出,按Enter鍵可以退出來。
warn 2019-08-03T07:15:16.926 thread-0 se_wallet.cpp:283 check_signed ] Application does not have a valid signature; Secure Enclave support disabled info 2019-08-03T07:15:16.927 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/keosd/stop info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/node/get_supported_apis info 2019-08-03T07:15:16.929 thread-0 wallet_api_plugin.cpp:73 plugin_startup ] starting wallet_api_plugin info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/create info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/create_key info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/get_public_keys info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/import_key info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/list_keys info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/list_wallets info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/lock info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/lock_all info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/open info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/remove_key info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/set_timeout info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/sign_digest info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/sign_transaction info 2019-08-03T07:15:16.929 thread-0 http_plugin.cpp:625 add_handler ] add api url: /v1/wallet/unlock
2.2.啟動nodeos
nodeos -e -p eosio --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin --plugin eosio::history_plugin --plugin eosio::history_api_plugin --access-control-allow-origin='*' --contracts-console --http-validate-host=false --verbose-http-errors --filter-on='*' >> nodeos.log 2>&1 &
這些設置可實現以下功能:
在開發目錄下的eosio目錄中使用工作目錄進行區塊鏈數據和配置。這里我們分別使用eosio/data和eosio/config
運行Nodeos。此命令加載所有基本插件,設置服務器地址,啟用CORS并添加一些合同調試和日志記錄。
無限制地啟用CORS(*)
在上面的配置中,CORS僅用于開發目的*,您永遠不應在可公開訪問的節點上啟用CORS for *!
3.檢查節點的和錢包的情況
3.1.檢查節點的情況
運行下面的命令
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]
按CNTL + C鍵退出日志。
3.2.檢查錢包的情況
打開shell并運行cleos命令列出可用的錢包
cleos wallet list
你應該看到下面這樣的輸出
Wallets: []
3.3.檢查Nodeos末端節點
這將檢查RPC API是否正常工作,選擇一個。
檢查瀏覽器中chain_api_plugin提供的get_info端點:
http:// localhost:8888 / v1 / chain / get_info
檢查相同的事情,但在主機的控制臺中
curl http://localhost:8888/v1/chain/get_info
讀到這里,小伙伴們學會怎么安裝了嗎?