Manual

Build the Node from scratch step by step

1. Install Dependencies

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

  1. Install GO

If you already Installed GO version 1.19.5 you can skip this step

check your GO version:

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

  1. Download and Install Binary

cd $HOME
rm -rf osmosis/
git clone https://github.com/osmosis-labs/osmosis.git
cd osmosis/
git fetch
git checkout v1.0.5
make build

  1. Install Cosmovisor

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

  1. Create Symbolic Links for Cosmovisor

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

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

  1. Set Config App

First, create variable for:

NODENAME=<fill with your node name>
PORT=<fill with your available port>

(you can use port 4-65353, : 18, 22, 23, 53, 80 and 323)
osmosisd config chain-id osmosis-1
osmosisd config keyring-backend file
osmosisd config node tcp://localhost:${PORT}657
osmosisd init $NODENAME --chain-id $CHAIN

  1. Download Addrbook & Genesis

wget -O ${HOME}/.osmosisd/config/addrbook.json https://ss.osmosis.nodestake.top/addrbook.json
wget -O ${HOME}/.osmosisd/config/genesis.json https://ss.osmosis.nodestake.top/genesis.json

  1. Configure Seeds and Peers

SEEDS="c32efea4647f8db185facf809dfb6ff84fd1b6b1@rpc.osmosis.nodestake.top:666"
PEERS=$(curl -s https://ss.osmosis.nodestake.top/peers.txt)
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.planqd/config/config.toml

  1. Configure Pruninge

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

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

  1. Create Service

sudo tee /etc/systemd/system/osmosisd.service > /dev/null << EOF
[Unit]
Description=osmosis 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/.osmosisd"
Environment="DAEMON_NAME=osmosisd"
Environment="UNSAFE_SKIP_BACKUP=true"

[Install]
WantedBy=multi-user.target
EOF

  1. Start Node

sudo systemctl daemon-reload
sudo systemctl enable osmosisd
sudo systemctl start osmosisd

  1. (Optional) Check Node Status

if you want check your Node logs, run the command below:

sudo journalctl -fu osmosisd-o cat

if you want check your Node synchronize status, run the command below:

curl -s localhost:${PORT}657/status

Last updated