Skip to main content

Installation

Complete guide to install and configure Atomone validator node.

Installation

Install Go (if needed)

cd $HOME
VER="1.22.10"
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"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin

Set Variables

echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="MONIKER"" >> $HOME/.bash_profile
echo "export ATOMONE_CHAIN_ID="atomone-testnet-1"" >> $HOME/.bash_profile
echo "export ATOMONE_PORT="11"" >> $HOME/.bash_profile
source $HOME/.bash_profile

Download Binary

Current Version: v1.0.0

cd $HOME
rm -rf atomone
git clone https://github.com/atomone-hub/atomone
cd atomone
git checkout v1.0.0
make build
sudo mv $HOME/atomone/build/atomoned $(which atomoned)

Config and Init App

atomoned init $MONIKER --chain-id $ATOMONE_CHAIN_ID
sed -i \
-e "s/chain-id = .*/chain-id = \"atomone-testnet-1\"/" \
-e "s/keyring-backend = .*/keyring-backend = \"os\"/" \
-e "s/node = .*/node = \"tcp:\/\/localhost:${ATOMONE_PORT}657\"/" $HOME/.atomone/config/client.toml

Download Genesis and Addrbook

wget -O $HOME/.atomone/config/genesis.json https://server-1.ruangnode.com/testnet/atomone/genesis.json
wget -O $HOME/.atomone/config/addrbook.json https://server-1.ruangnode.com/testnet/atomone/addrbook.json

Set Seeds and Peers

SEEDS="92e80e4f4d1103a7bcfe7258fb3a4cdf585def2d@seed.ruangnode.com:${ATOMONE_PORT}656"
PEERS="92e80e4f4d1103a7bcfe7258fb3a4cdf585def2d@peer.ruangnode.com:${ATOMONE_PORT}656"
sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*seeds *=.*/seeds = \"$SEEDS\"/}" \
-e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" $HOME/.atomone/config/config.toml

Set Custom Ports

# Set custom ports in app.toml
sed -i.bak -e "s%:1317%:${ATOMONE_PORT}317%g;
s%:8080%:${ATOMONE_PORT}080%g;
s%:9090%:${ATOMONE_PORT}090%g;
s%:9091%:${ATOMONE_PORT}091%g;
s%:8545%:${ATOMONE_PORT}545%g;
s%:8546%:${ATOMONE_PORT}546%g;
s%:6065%:${ATOMONE_PORT}065%g" $HOME/.atomone/config/app.toml

# Set custom ports in config.toml
sed -i.bak -e "s%:26658%:${ATOMONE_PORT}658%g;
s%:26657%:${ATOMONE_PORT}657%g;
s%:6060%:${ATOMONE_PORT}060%g;
s%:26656%:${ATOMONE_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${ATOMONE_PORT}656\"%g;
s%:26660%:${ATOMONE_PORT}660%g" $HOME/.atomone/config/config.toml

Config Pruning

sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.atomone/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.atomone/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"19\"/" $HOME/.atomone/config/app.toml

Set Minimum Gas Price and Other Configs

sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.225uphoton"|g' $HOME/.atomone/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.atomone/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.atomone/config/config.toml

Create Service File

sudo tee /etc/systemd/system/atomoned.service > /dev/null <<EOF
[Unit]
Description=Atomone node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.atomone
ExecStart=$(which atomoned) start --home $HOME/.atomone
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Enable and Start Service

sudo systemctl daemon-reload
sudo systemctl enable atomoned
sudo systemctl restart atomoned && sudo journalctl -u atomoned -fo cat