Node Installation
Minumum Requirements
- 4 or more physical CPU cores.
- At least 100 GB of SSD disk storage.
- At least 8 GB of memory (RAM).
- At least 50 mbps network bandwidth.
Custom Configuration (optional)
- Custom user
sudo adduser sge
sudo adduser sge sudo
su - sge
- Custom Port
PORT=46
echo "export PORT=${PORT}" >> $HOME/.bash_profile
source $HOME/.bash_profile
Install Update and Dependencies
sudo apt -q update
sudo apt -qy upgrade
sudo apt -qy install curl git jq wget unzip lz4 build-essential
Install GO(ver. 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 && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version
Installing Binary
cd $HOME
rm -rf sge
git clone https://github.com/sge-network/sge.git
cd sge
git checkout v1.1.1
make build
Prepare cosmovisor
mkdir -p $HOME/.sge/cosmovisor/genesis/bin
mv build/sged $HOME/.sge/cosmovisor/genesis/bin/
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
rm -rf build
Install Cosmovisor
go install cosmossdk.io/tools/cosmovisor/cmd/[email protected]
Init Generation
Replace moniker_name
with your own moniker name
sged config chain-id sgenet-1
sged config keyring-backend test
sged init moniker_name --chain-id sgenet-1
Download Genesis and Addrbook
curl -Ls https://raw.githubusercontent.com/sge-network/networks/master/testnet/sge-network-3/genesis.json > $HOME/.sge/config/genesis.json
Set Peers and Seeds
PEERS="$(curl -sS https://rpc.sge.indonode.net/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}' | sed -z 's|\n|,|g;s|.$||')"
sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"$PEERS\"|" $HOME/.sge/config/config.toml
Set Port app.toml and config.toml
This Step If you running custom port, if you running default port, skip this step
sged config node tcp://localhost:${PORT}657
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${PORT}658\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${PORT}657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${PORT}060\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${PORT}656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${PORT}660\"%" $HOME/.sge/config/config.toml
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${PORT}317\"%; s%^address = \":8080\"%address = \":${PORT}080\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${PORT}090\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${PORT}091\"%" $HOME/.sge/config/app.toml
sed -i.bak -e "s%^address = \"tcp://localhost:1317\"%address = \"tcp://localhost:${PORT}317\"%; s%^address = \":8080\"%address = \":${PORT}080\"%; s%^address = \"localhost:9090\"%address = \"localhost:${PORT}090\"%; s%^address = \"localhost:9091\"%address = \"localhost:${PORT}091\"%" $HOME/.sge/config/app.toml
Set Config Pruning
pruning="custom"
pruning_keep_every="0"
pruning_keep_recent="100"
pruning_interval="19"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.sge/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.sge/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.sge/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.sge/config/app.toml
Create 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
Register And Start Service
sudo systemctl daemon-reload
sudo systemctl enable sge
sudo systemctl restart sge && sudo journalctl -fu sge -o cat