Cover photo

Andromeda 测试网空投节点教程

     Andromeda 是一个应用平台层,连接 Cosmos 生态系统中的所有公共区块链。使用 IBC,Andromeda 将轻量级配置数据从一条链传输到另一条链,使 Cosmos 中的任何链都可以与任何其他项目连接。

     该项目由Maven Capital投资,融资金额不明确,但项目方对外投资了Mech.com 600万美金和Hamony Launcher 170万美金,说明项目方奖金充足。

节点奖励

Subscribe

一、部署测试网节点

硬件要求

建议运行 Andromeda 满足以下要求:

  • 4 核或以上 CPU 内核

  • 至少 200GB 的 SSD 磁盘存储

  • 至少 8GB 内存 (RAM)

  • 至少 100mbps 网络带宽

1、安装依赖

sudo apt update && sudo apt upgrade -y && sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq chrony liblz4-tool -y

2、安装GO

我们将使用 GO 版本 1.19.5 ,如果你已经安装了 GO, 你可以跳过这个。

ver="1.19.5"
cd $HOME
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm "go$ver.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> ~/.bash_profile
source ~/.bash_profile
go version

3、安装二进制文件

cd $HOME
rm -rf andromedad
git clone https://github.com/andromedaprotocol/andromedad.git
cd andromedad
git checkout galileo-3-v1.1.0-beta1
make build

4、准备Cosmovisor

mkdir -p $HOME/.andromedad/cosmovisor/genesis/bin
mv build/andromedad $HOME/.andromedad/cosmovisor/genesis/bin/
rm -rf build


sudo ln -s $HOME/.andromedad/cosmovisor/genesis $HOME/.andromedad/cosmovisor/current
sudo ln -s $HOME/.andromedad/cosmovisor/current/bin/andromedad /usr/local/bin/andromedad

5、验证您是否已成功安装 andromedad

6、安装Cosmovisor

go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.4.0

7、配置应用

andromedad config chain-id galileo-3
andromedad config keyring-backend test

8、初始化节点

请更改 <YOUR_MONIKER>为您自己的名字。

andromedad init <YOUR_MONIKER> --chain-id galileo-3

9、下载Genesis文件和地址簿

  • Genesis文件

curl -Ls https://snapshots.indonode.net/andromeda-t/genesis.json > $HOME/.andromedad/config/genesis.json
  • 地址簿

curl -Ls https://snapshots.indonode.net/andromeda-t/addrbook.json > $HOME/.andromedad/config/addrbook.json

10、配置Seeds和Peers

sed -i -e "s|^seeds *=.*|seeds = \"3f472746f46493309650e5a033076689996c8881@andromeda-testnet.rpc.kjnodes.com:47659\"|" $HOME/.andromedad/config/config.toml

11、配置pruning

PRUNING="custom"
PRUNING_KEEP_RECENT="100"
PRUNING_INTERVAL="19"

sed -i -e "s/^pruning *=.*/pruning = \"$PRUNING\"/" $HOME/.andromedad/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \
\"$PRUNING_KEEP_RECENT\"/" $HOME/.andromedad/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \
\"$PRUNING_INTERVAL\"/" $HOME/.andromedad/config/app.toml

12、创建服务文件并启动节点

创建服务文件 使用以下代码在文件夹 andromedad.service中创建一个文件。 /etc/systemd/system您可以 USER使用您的 Linux 用户名进行更改。 您需要 sudo 权限才能执行此步骤。

sudo tee /etc/systemd/system/andromedad.service > /dev/null << EOF
[Unit]
Description=andromeda-testnet node service
After=network-online.target

[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.andromedad"
Environment="DAEMON_NAME=andromedad"
Environment="UNSAFE_SKIP_BACKUP=true"

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable andromedad

13、启动节点

sudo systemctl restart andromedad
sudo journalctl -fu andromedad -o cat

其他

1、Peers

PEERS="$(curl -sS https://andromeda-testnet.rpc.kjnodes.com/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}' | sed -z 's|\n|,|g;s|.$||')"
sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"$PEERS\"|" $HOME/.andromedad/config/config.toml

2、同步状态

这是我们使用的设置,你无需更改任何内容

  • snapshot-interval= 1000

  • snapshot-keep-recent = 5

指令

systemctl stop andromedad 
andromedad tendermint unsafe-reset-all --home $HOME/.andromedad --keep-addr-book

STATE_SYNC_RPC="https://rpc.andromeda-testnet.indonode.net:443"

LATEST_HEIGHT=$(curl -s $STATE_SYNC_RPC/block | jq -r .result.block.header.height)
SYNC_BLOCK_HEIGHT=$(($LATEST_HEIGHT - 1000))
SYNC_BLOCK_HASH=$(curl -s "$STATE_SYNC_RPC/block?height=$SYNC_BLOCK_HEIGHT" | jq -r .result.block_id.hash)

PEERS=642a71c36bc4983b6ab90fce65d3ee7584b7a86c@rpc.andromeda-testnet.indonode.net:47656 
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.andromedad/config/config.toml

sed -i.bak -e "s|^enable *=.*|enable = true|" $HOME/.andromedad/config/config.toml
sed -i.bak -e "s|^rpc_servers *=.*|rpc_servers = \"$STATE_SYNC_RPC,$STATE_SYNC_RPC\"|" \
  $HOME/.andromedad/config/config.toml
sed -i.bak -e "s|^trust_height *=.*|trust_height = $SYNC_BLOCK_HEIGHT|" \
  $HOME/.andromedad/config/config.toml
sed -i.bak -e "s|^trust_hash *=.*|trust_hash = \"$SYNC_BLOCK_HASH\"|" \
  $HOME/.andromedad/config/config.toml

systemctl restart andromedad && journalctl -fu andromedad -o cat

关闭状态同步

sed -i.bak -e "s|^enable *=.*|enable = false|" $HOME/.andromedad/config/config.toml
systemctl restart andromedad && journalctl -fu andromedad -o cat

3、快照

安装lz4

sudo apt install lz4 -y

停止Planqd和备份priv_validator_state.json

sudo systemctl stop andromedad
cp $HOME/.andromedad/data/priv_validator_state.json $HOME/.andromedad/priv_validator_state.json.backup
rm -rf $HOME/.andromedad/data

下载快照

curl -L https://andromeda-t.service.indonode.net/blockx-snapshot.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.andromedad
mv $HOME/.andromedad/priv_validator_state.json.backup $HOME/..andromedad/data/priv_validator_state.json

重启节点并检查日志

sudo systemctl restart andromedad && sudo journalctl -u andromedad -f --no-hostname -o cat

4、节点CLI备忘单

  • 始终小心大写的单词

  • 指定 --chain-id

添加钱包

指定值 <wallet> 使用您自己的钱包名称

andromedad keys add <wallet>

恢复钱包

andromedad keys add <wallet> --recover

列出钱包

andromedad keys list

删除钱包

andromedad keys delete <wallet>

检查钱包余额

andromedad q bank balances $(andromedad keys show wallet -a)

验证器管理

请调整 <wallet>MONIKERYOUR_KEYBASE_IDYOUR_DETAILSYOUUR_WEBSITE_URL

创建验证器(质押)

andromedad tx staking create-validator \
--amount=1000000uandr \
--pubkey=$(andromedad tendermint show-validator) \
--moniker="YOUR_MONIKER_NAME" \
--identity="YOUR_KEYBASE_ID" \
--details="YOUR_DETAILS" \
--website="YOUR_WEBSITE_URL" \
--chain-id=galileo-3 \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=wallet \
--gas-adjustment=1.4 \
--gas=auto \
--gas-prices=0.0001uandr \
-y

编辑验证器

andromedad tx staking edit-validator \
--moniker="<MONIKER>" \
--identity="YOUR_KEYBASE_ID" \
--details="YOUR_DETAILS" \
--website="YOUR_WEBSITE_URL"
--chain-id galileo-3 \
--commission-rate=0.05 \
--from=<wallet> \
--gas-adjustment="1.15" \
--gas=auto\
--gas-prices=0.0001uandr \
-y

解狱验证器

andromedad tx slashing unjail --from <wallet> --chain-id --chain-id galileo-3 --gas-adjustment=1.4 --gas=auto--gas-prices=0.0001uandr -y

检查入狱原因

andromedad query slashing signing-info $(andromedad tendermint show-validator)

令牌管理

提取奖励

andromedad tx distribution withdraw-all-rewards --from wallet --chain-id galileo-3 --gas-adjustment=1.4 --gas=auto--gas-prices=0.0001uandr -y

提取佣金奖励

andromedad tx distribution withdraw-rewards $(andromedad keys show wallet --bech val -a) --commission --from wallet --chain-id galileo-3 --gas-adjustment=1.4 --gas=auto--gas-prices=0.0001uandr -y

将代币委托给您自己的验证器

andromedad tx staking delegate $(andromedad keys show wallet --bech val -a) 1000000uandr --from wallet --chain-id galileo-3 --gas-adjustment=1.4 --gas=auto--gas-prices=0.0001uandr -y

将令牌委托给其他验证器

andromedad tx staking redelegate $(andromedad keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000uandr --from wallet --chain-id galileo-3 --gas-adjustment=1.4 --gas=auto--gas-prices=0.0001uandr -y

从您的验证器中解绑令牌

andromedad tx staking unbond $(andromedad keys show wallet --bech val -a) 1000000uandr --from wallet --chain-id galileo-3 --gas-adjustment=1.4 --gas=auto--gas-prices=0.0001uandr -y

将代币发送到另一个钱包

andromedad tx bank send wallet <TO_WALLET_ADDRESS> 1000000uandr --from wallet --chain-id galileo-3

投票 您可以更改 的值 yes no abstain nowithveto

andromedad tx gov vote 1 yes --from wallet --chain-id galileo-3 --gas-adjustment=1.4 --gas=auto--gas-prices=0.0001uandr -y

设置您自己的自定义端口 您可以更改值 CUSTOM_PORT=47 到任何其他端口

CUSTOM_PORT=47
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${CUSTOM_PORT}658\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${CUSTOM_PORT}657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${CUSTOM_PORT}060\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${CUSTOM_PORT}656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${CUSTOM_PORT}660\"%" $HOME/.andromedad/config/config.toml
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${CUSTOM_PORT}317\"%; s%^address = \":8080\"%address = \":${CUSTOM_PORT}080\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${CUSTOM_PORT}090\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${CUSTOM_PORT}091\"%; s%^address = \"0.0.0.0:8545\"%address = \"0.0.0.0:${CUSTOM_PORT}545\"%; s%^ws-address = \"0.0.0.0:8546\"%ws-address = \"0.0.0.0:${CUSTOM_PORT}546\"%" $HOME/.andromedad/config/app.toml

启用通常默认启用的索引

sed -i -e 's|^indexer *=.*|indexer = "kv"|' $HOME/.andromedad/config/config.toml

禁用索引

sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.andromedad/config/config.toml

重置链数据

andromedad tendermint unsafe-reset-all --home $HOME/.andromedad--keep-addr-book

删除节点

警告!明智地使用此命令 首先备份您的密钥,它将从您的系统中删除Andromeda

sudo systemctl stop andromedad && \
sudo systemctl disable andromedad && \
rm /etc/systemd/system/andromedad.service && \
sudo systemctl daemon-reload && \
cd $HOME && \
rm -rf .andromedad&& \
rm -rf $(which andromedad)

关注我们社区,获取更多有奖励的节点项目,不定时更新,欢迎交流!

discord:discord.gg/PPhsfActZg

Twitter:@NodeVoyagers

Subscribe