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 = "3e16af0cead27979e1fc3dac57d03df3c7a77acc@3.87.179.235:26656,ba3bacc714817218562f743178228f23678b2873@public-seed-node.cosmoshub.certus.one:26656,2626942148fd39830cb7a3acccb235fab0332d86@173.212.199.36:26656,3028c6ee9be21f0d34be3e97a59b093e15ec0658@91.205.173.168:26656,89e4b72625c0a13d6f62e3cd9d40bfc444cbfa77@34.65.6.52:26656,6be0856f6365559fdc2e9e97a07d609f754632b0@cosmos-cosmoshub-2-seed.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