Install XION
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. xiond
bash
wget https://github.com/burnt-labs/xion/releases/download/v15.0.0/xiond_15.0.0_linux_amd64.zip
unzip xiond_15.0.0_linux_amd64.zip
sudo mv xiond /usr/bin/xiond
chmod +x /usr/bin/xiond
rm -rf README.md LICENSE
xiond version
3.1 cosmovisor
bash
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest
echo "export DAEMON_NAME="xiond"" >> $HOME/.bashrc
echo "export DAEMON_HOME="$HOME/.xiond"" >> $HOME/.bashrc
source $HOME/.bashrc
cosmovisor init $(which xiond)
3.2 Add upgrade (option)
https://github.com/burnt-labs/xion/releases
bash
export VERSION="v15.0.0"
export BIN_PATH="/usr/bin/xiond"
mkdir -p $HOME/.xiond/cosmovisor/upgrades/$VERSION/bin
cp $BIN_PATH $HOME/.xiond/cosmovisor/upgrades/$VERSION/bin/xiond
chmod +x $HOME/.xiond/cosmovisor/upgrades/$VERSION/bin/xiond
4. Init
Mainnet
bash
# Initialize the node
export MONIKER=p10node
xiond init $MONIKER --chain-id xion-mainnet-1
# Add seeds
seeds="4f0fd0c68f4141886f2a306e6c64cb191d71ef78@xion-mainnet-1.burnt.com:12656"
persistent_peers="22371d31b93490e1d79899446e73839e9fd4c004@xion-mainnet-1.burnt.com:42656,083eb4d9191e727e0fcce7a73e93863cc0f79fa5@xion-mainnet-1.burnt.com:43656,eb183c6f9c1c44d3c9198415b84e43d74fe84c58@xion-mainnet-1.burnt.com:44656"
sed -i -e "s|^seeds *=.*|seeds = \"$seeds\"|" $HOME/.xiond/config/config.toml
sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"$persistent_peers\"|" $HOME/.xiond/config/config.toml
# Set minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.025uxion\"|" $HOME/.xiond/config/app.toml
# 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/.xiond/config/app.toml
# Disable indexing
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.xiond/config/config.toml
# Set recv_rate
sed -i -e "s/^recv_rate *=.*/recv_rate = 125600000/" $HOME/.xiond/config/config.toml
# Enable Prometheus Metrics
sed -i 's/prometheus = false/prometheus = true/g' ~/.xiond/config/config.toml
# Download current addrbook
wget -O addrbook.json https://files.p10node.com/xion/addrbook.json --inet4-only
mv addrbook.json ~/.xiond/config
Change File Limits
bash
sudo tee -a /etc/security/limits.conf > /dev/null <<EOF
* soft nproc 262144
* hard nproc 262144
* soft nofile 262144
* hard nofile 262144
EOF
sudo tee -a /etc/sysctl.conf > /dev/null <<EOF
fs.file-max=262144
EOF
5. Service
bash
sudo tee /etc/systemd/system/xiond.service > /dev/null << EOF
[Unit]
Description=xiond node service
After=network-online.target
[Service]
User=$USER
Environment="DAEMON_NAME=xiond"
Environment="DAEMON_HOME=$HOME/.xiond"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="UNSAFE_SKIP_BACKUP=true"
Environment="DAEMON_DATA_BACKUP_DIR=$HOME/.xiond"
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 xiond
sudo systemctl restart xiond
# check status
sudo systemctl status xiond
# start service
sudo systemctl start xiond
# stop service
sudo systemctl stop xiond
# disable auto launch at boot
sudo systemctl disable xiond
# check logs
sudo journalctl -u xiond -f --no-hostname -o cat
Backup
bash
scp -r $USER@$IP:/root/.xiond/config/node_key.json node_key.json
scp -r $USER@$IP:/root/.xiond/config/priv_validator_key.json priv_validator_key.json
6. Snapshot
bash
# Back up priv_validator_state.json if needed
sudo systemctl stop xiond
cp $HOME/.xiond/data/priv_validator_state.json $HOME/.xiond/priv_validator_state.json.backup
# Clean up data
xiond tendermint unsafe-reset-all --home $HOME/.xiond --keep-addr-book
# Download Latest Snapshot
curl -o - -L https://files.p10node.com/xion/latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.xiond
# Replace with the backed-up priv_validator_state.json
mv $HOME/.xiond/priv_validator_state.json.backup $HOME/.xiond/data/priv_validator_state.json
# Restart service
sudo systemctl restart xiond
sudo journalctl -u xiond -f --no-hostname -o cat
7. Status
bash
curl http://localhost:26657/status | jq