Installation

Installation

The complete infrastructure for cross-chain smart contracts, applications, and modular functionality.

Chain ID: sgenet-1 | Latest Version Tag: v1.1.1 | Wasm: OFF

Chain explorer

https://ping.pub/sge

Public endpoints

Peering

seed-node

6a727128f427d166d90a1185c7965b178235aaee@rpc.sge.nodestake.top:666,e752327338c0141b946ec54f85d51f450c4ad643@46.250.237.163:26656

Installation

Chain ID: sgenet-1 | Latest Version Tag: v1.1.1 |

Install dependencies

Update system and install build tools

sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential tmux libgmp3-dev flex bison
sudo apt -qy upgrade

Install Go

rm -rf $HOME/go
sudo rm -rf /usr/local/go
cd $HOME
curl https://dl.google.com/go/go1.19.5.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
cat <<'EOF' >>$HOME/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source $HOME/.profile
go version

Download and build binaries

# Clone project repository
cd $HOME
rm -rf sge
git clone https://github.com/sge-network/sge
cd sge
git checkout v1.1.1
make install
sged version #make sure version match the latest.

Initialize Node & Genesis

sged init NodeName --chain-id=sgenet-1

Initialize

# Set node configuration
sged config chain-id sgenet-1
sged config keyring-backend file

# Add seeds
sed -i -e "s|^seeds *=.*|seeds = \"6a727128f427d166d90a1185c7965b178235aaee@rpc.sge.nodestake.top:666,e752327338c0141b946ec54f85d51f450c4ad643@46.250.237.163:26656\"|" $HOME/.sge/config/config.toml

# Set minimfum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"10000usge\"|" $HOME/.sge/config/app.toml

# Set pruning
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

Download Genesis

curl -Ls wget https://offellnode.s3.ap-southeast-1.amazonaws.com/sge/genesis.json > $HOME/.sge/config/genesis.json 

Setting up cosmovisor

// setup cosmovisor
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest
// create sge cosmovisor folder
mkdir -p ~/.sge/cosmovisor/genesis/bin
mkdir -p ~/.sge/cosmovisor/upgrades
// copy the binary to cosmovisor
cp ~/go/bin/sged ~/.sge/cosmovisor/genesis/bin/

Setting up services

Now we’ll create a systemd service sge.service to control the node via cosmovisor. As root and with a text editor, open /etc/systemd/system/sge.service (nano /etc/systemd/system/sge.service) and type the following:

[Unit] 
    Description=SGE Network node 
    After=network.target

    [Service] 
    Type=simple 
    Restart=on-failure 
    RestartSec=5 
    User=root
    ExecStart=/home/root/go/bin/cosmovisor run start
    LimitNOFILE=65535
    Environment="DAEMON_NAME=sged"
    Environment="DAEMON_HOME=/root/.sge"
    Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
    Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
    Environment="UNSAFE_SKIP_BACKUP=true"

    [Install] 
    WantedBy=multi-user.target

Start Services

// Enable
sudo systemctl enable sge
// Reload
sudo systemctl daemon-reload
// Start
sudo systemctl start sge


// Stop (if there is any problem)
sudo systemctl stop sge
// Restart
sudo systemctl restart sge

// Check Log
journalctl -fu sge

Last updated