Manual Installation
Let's explore the manual installation process as we set up a node with Cosmovisor!
Install Dependencies
Update system package and install build tools
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential fail2ban ufw
sudo apt -qy upgrade
Secure Setup
π’
This step is optional, and you can choose to skip ahead to configure moniker.
Setup ssh for sge user replace YOUR_PUBLIC_SSH_KEY with your own!
sudo adduser sge --disabled-password -q
sudo usermod -aG sudo sge
sudo -u sge bash -c 'mkdir -p ~/.ssh && echo "YOUR_PUBLIC_SSH_KEY" >> ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys'
Configure Moniker
Replace <your-moniker-name> with your own validator name
MONIKER="<your-moniker-name>"
Install Go
install go version 1.19.7
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.19.7.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh)
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)
Build Binaries
Cloning project repository & Compile binaries
cd $HOME
rm -rf sge
git clone https://github.com/sge-network/sge
cd sge
git checkout v1.7.1
make build
Latest commit : c293d88cc1c599faf6cbaf0b1084955b8dda53bc
Prepare binaries for cosmovisor
mkdir -p $HOME/.sge/cosmovisor/genesis/bin
mv build/sged $HOME/.sge/cosmovisor/genesis/bin/
rm -rf build
Create symlinks
sudo ln -s $HOME/.sge/cosmovisor/genesis $HOME/.sge/cosmovisor/current -f
sudo ln -s $HOME/.sge/cosmovisor/current/bin/sged /usr/local/bin/sged -f
Cosmovisor Setup
Install cosmovisor
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0
Create Service
Create a systemd service
sudo tee /etc/systemd/system/sge.service > /dev/null << EOF
[Unit]
Description=sge 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/.sge"
Environment="DAEMON_NAME=sged"
Environment="UNSAFE_SKIP_BACKUP=true"
[Install]
WantedBy=multi-user.target
EOF
Enable Service
Enable sge systemd service
sudo systemctl daemon-reload
sudo systemctl enable sge
Initialize Node
Setting node configuration
sged config chain-id sge-network-4
sged config keyring-backend test
sged config node tcp://localhost:23057
Initialize node
sged init $MONIKER --chain-id sge-network-4
Download Genesis & Addrbook
Download genesis & addrbook file
curl -Ls https://snap.nodex.one/sge-testnet/genesis.json > $HOME/.sge/config/genesis.json
curl -Ls https://snap.nodex.one/sge-testnet/addrbook.json > $HOME/.sge/config/addrbook.json
sha256sum genesis.json
: 08f37f99e33fe2521ff1d1128b437f6351018bad871aedb942c9167d2d83964b
Configure Seeds
Setting up a seed peers
sed -i -e "s|^seeds *=.*|seeds = \"d1d43cc7c7aef715957289fd96a114ecaa7ba756@testnet-seeds.nodex.one:23010\"|" $HOME/.sge/config/config.toml
Configure Gas Prices
Setting up a gas prices
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0usge\"|" $HOME/.sge/config/app.toml
Pruning Setting
Configure pruning setting
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "19"|' \
$HOME/.sge/config/app.toml
Custom Port
Please note that updating the port is optional!
Configure a custom port
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:23058\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:23057\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:23060\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:23056\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":23066\"%" $HOME/.sge/config/config.toml
sed -i -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:23017\"%; s%^address = \":8080\"%address = \":23080\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:23090\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:23091\"%; s%:8545%:23045%; s%:8546%:23046%; s%:6065%:23065%" $HOME/.sge/config/app.toml
Download Snapshots
Download latest chain snapshot
curl -L https://snap.nodex.one/sge-testnet/sge-latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.sge
[[ -f $HOME/.sge/data/upgrade-info.json ]] && cp $HOME/.sge/data/upgrade-info.json $HOME/.sge/cosmovisor/genesis/upgrade-info.json
Start Service
Letss f*cking goooo!
sudo systemctl start sge