1 安裝Go
GO按照官方文檔進行安裝。記住設定
$PATH
環境變量,例如:複
mkdir -p $HOME/go/bin
echo "export PATH=$PATH:$(go env GOPATH)/bin" >> ~/.bash_profile
source ~/.bash_profile
安裝二進制檔案
接下來,讓我們安裝最新版本的Gaia。確定您
git checkout
使用正确的發行版本。
git clone -b <latest-release-tag> https://github.com/cosmos/gaia
cd gaia && make install
這将安裝
gaiad
和
gaiacli
二進制檔案。驗證一切正常:
$ gaiad version --long
$ gaiacli version --long
gaiacli
例如應該輸出類似以下内容:
name: gaia
server_name: gaiad
client_name: gaiacli
version: 2.0.3
commit: 2f6783e298f25ff4e12cb84549777053ab88749a
build_tags: netgo,ledger
go: go version go1.12.5 darwin/amd64
2 連接配接主網
設定新節點
這些說明用于從頭開始設定全新的完整節點。
首先,初始化節點并建立必要的配置檔案:
gaiad init <your_custom_moniker>
您可以
moniker
稍後在
~/.gaiad/config/config.toml
檔案中進行編輯:
# A custom human readable name for this node
moniker = "<your_custom_moniker>"
您可以編輯
~/.gaiad/config/app.toml
檔案以啟用反垃圾郵件機制并拒絕低于最低汽油價格的傳入交易:
# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml
##### main base config options #####
# The minimum gas prices a validator is willing to accept for processing a
# transaction. A transaction's fees must meet the minimum of any denomination
# specified in this config (e.g. 10uatom).
#minimum-gas-prices = "0.025uatom"
minimum-gas-prices = ""
創世紀與種子
#複制創世檔案
将mainnet的
genesis.json
檔案提取到
gaiad
的config目錄中。
mkdir -p $HOME/.gaiad/config
curl https://raw.githubusercontent.com/cosmos/launch/master/genesis.json > $HOME/.gaiad/config/genesis.json
添加種子節點
您的節點需要知道如何查找對等節點。您需要向添加健康種子節點
$HOME/.gaiad/config/config.toml
。
# Comma separated list of seed nodes to connect to
seeds = "[email protected]:26656,[email protected]hub.certus.one:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected].nodes.polychainlabs.com:26656"
設定rpc位址
# TCP or UNIX socket address for the RPC server to listen on
laddr = "tcp://0.0.0.0:26657"
啟動節點
- nohup gaiad start >> /root/atom_output.log 2>&1 & //啟動任務,開始同步資料
- nohup gaiacli rest-server --chain-id=cosmoshub-2 --laddr=tcp://0.0.0.0:1317 --home /usr >> /root/atom_gaia_rest_output.log 2>&1 & //啟用reset服務,後續會用到,要保證和gaiad 輸出不同目錄
官方文檔位址
https://hub.cosmos.network/master/gaia-tutorials/installation.html