Install Axone
0.0 System Specs
For full of official document, you can check at here
Hardware | Requirement |
---|---|
CPU | 4 Cores |
RAM | 16 GB |
Disk | 300+ GB Data Disk |
1.0 Prepare
OS: Debian/Ubuntu
bash
sudo apt-get update
sudo apt-get install -y git curl build-essential libssl-dev libc6 libc6-dev cmake ca-certificates gnupg pkg-config clang git-lfs \
snapd protobuf-compiler jq zstd lz4 lzma zip unzip \
libbz2-dev libreadline-dev liblzma-dev libsqlite3-dev \
libboost-all-dev libcap-dev \
screen htop net-tools
sudo tee /usr/bin/checkport > /dev/null <<EOF
#!/bin/sh
sudo lsof -i -P -n | grep LISTEN
EOF
sudo chmod +x /usr/bin/checkport
1.1 Install Golang
bash
sudo snap install go --classic
if ! grep -q 'export PATH=$PATH:~/go/bin' ~/.bashrc; then
echo "Adding ~/go/bin to PATH in ~/.bashrc..."
echo 'export PATH=$PATH:~/go/bin' >> ~/.bashrc
fi
source $HOME/.bashrc
2. axoned
bash
cd $HOME
wget -O axoned https://github.com/axone-protocol/axoned/releases/download/v10.0.0/axoned-10.0.0-linux-amd64
sudo chmod +x axoned
sudo mv axoned /usr/bin/axoned
axoned version
# 10.0.0
3.1 cosmovisor
bash
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest
export DAEMON_NAME="axoned"
export DAEMON_HOME="$HOME/.axoned"
cosmovisor init $(which axoned)
3.2 Add upgrade (option)
https://github.com/axone-protocol/axoned/releases
bash
export VERSION="v10.0.0"
export BIN_URL="https://github.com/axone-protocol/axoned/releases/download/v10.0.0/axoned-10.0.0-linux-amd64"
mkdir -p $HOME/.axoned/cosmovisor/upgrades/$VERSION/bin
wget -O $HOME/.axoned/cosmovisor/upgrades/$VERSION/bin/axoned $BIN_URL
chmod +x $HOME/.axoned/cosmovisor/upgrades/$VERSION/bin/axoned
4. Init
Mainnet
bash
# Set node configuration
axoned config chain-id axone-dentrite-1
axoned config node tcp://localhost:26657
# Initialize the node
export MONIKER=p10node
axoned init $MONIKER --chain-id axone-dentrite-1
# Download genesis and configs
wget https://raw.githubusercontent.com/axone-protocol/networks/911b2d34631ac242e9ef3be577163653ed644726/chains/dentrite-1/genesis.json -O ~/.axoned/config/genesis.json
sed -i -e "s|^moniker *=.*|moniker = \"$MONIKER\"|" $HOME/.axoned/config/config.toml
# Add seeds
sed -i 's/seeds = ""/seeds = "ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@testnet-seeds.polkachu.com:17656"/' $HOME/.axoned/config/config.toml
sed -i "s|^persistent_peers *=.*|persistent_peers = \"73e1fc1ab7cdef8eb2e6239c522e6a1bcfe11100@p2p.testnet.axone.p10node.com:28356\"|" $HOME/.axoned/config/config.toml
#
curl -Ls https://files.p10node.com/axone-testnet/addrbook.json > $HOME/.axoned/config/addrbook.json
# Set pruning
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "5000"|' \
-e 's|^pruning-keep-every *=.*|pruning-keep-every = "500"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "10"|' \
$HOME/.axoned/config/app.toml
# disable indexing
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.axoned/config/config.toml
# Enable Prometheus Metrics
sed -i 's/prometheus = false/prometheus = true/g' ~/.axoned/config/config.toml
5. Service
bash
sudo tee /etc/systemd/system/axoned.service > /dev/null << EOF
[Unit]
Description=axoned node service
After=network-online.target
[Service]
User=$USER
Environment="DAEMON_NAME=axoned"
Environment="DAEMON_HOME=$HOME/.axoned"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="UNSAFE_SKIP_BACKUP=true"
Environment="DAEMON_DATA_BACKUP_DIR=$HOME/.axoned"
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
Service Control
bash
# when change service
sudo systemctl daemon-reload
sudo systemctl enable axoned
sudo systemctl restart axoned
# check status
sudo systemctl status axoned
# start service
sudo systemctl start axoned
# stop service
sudo systemctl stop axoned
# disable auto launch at boot
sudo systemctl disable axoned
# check logs
sudo journalctl -u axoned -f --no-hostname -o cat
Backup
bash
scp -r root@<ip>:/root/.axoned/config/node_key.json node_key.json
scp -r root@<ip>:/root/.axoned/config/priv_validator_key.json priv_validator_key.json
6. Snapshot
bash
sudo systemctl stop axoned
# Back up priv_validator_state.json if needed
cp $HOME/.axoned/data/priv_validator_state.json $HOME/.axoned/priv_validator_state.json.backup
# Clean DB
axoned tendermint unsafe-reset-all --home $HOME/.axoned --keep-addr-book
# Download Latest Snapshot
curl -L https://files.p10node.com/axone-testnet/latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.axoned
# Replace with the backed-up priv_validator_state.json
mv $HOME/.axoned/priv_validator_state.json.backup $HOME/.axoned/data/priv_validator_state.json
# Restart service
sudo systemctl restart axoned
sudo journalctl -u axoned -f --no-hostname -o cat
7. Status
bash
curl http://localhost:26657/status | jq