SGE Blockchain

Leverages applications at the intersection of blockchain, sports, gaming and entertainment that are pioneering novel ways of engaging users with a UX, value proposition and utility never before seen in the space

Valoper sgevaloper1rhmrwq4xket2ua4s7nqunnne8kzfz4w34082zv
Version

Loading...

Stage Testnet
Last Block

Loading...

Chain

Loading...

Status

Loading...

Explorer
SGE Blockchain
Snapshot
Loading...

INSTALLATION

Depedency

Login to root

#### From user with sudoers access

$ sudo su -

Update and install packages for compiling
# apt update -y && sudo apt install curl git jq lz4 lzma build-essential zsh -y

User Management

Create user salinem

Notes : make sure dont running validator used user root !!!

Notes :
We never used user salinem in our production, This user is just an example.
We assume you have already mounted big size DISK in /mainnet

# mkdir -p /mainnet && useradd -m -d /mainnet/salinem -s /bin/zsh salinem

Sudo Management

Create file in /etc/sudoers.d/salinem-sudo
salinem  ALL=(ALL)   NOPASSWD: /usr/bin/systemctl daemon-reload, \
   /usr/bin/systemctl * sge-node*, \
   /usr/bin/journalctl -fu *, \
   /usr/bin/cp -rf /mainnet/salinem/systemd/* /etc/systemd/system/*, \
   /usr/bin/cp /mainnet/salinem/systemd/* /etc/systemd/system/*

FHS / Filesystem Hierarchy

Login to User salinem

#### From user with sudoers access

$ sudo su - salinem

#### OR If you started from user root do this

# su - salinem

We create FHS in /mainnet/salinem
   /
   /bin
   /etc
   /mainnet/salinem
   |           |
   |           |---bin
   |           |    |------go
   |           |    |       |---bin
   |           |---conf
   |           |---source
   |           |---systemd
   |           |---lib
   |           |---tmp
   /dev
   /mnt
Create Directory, make sure you have already login with user salinem
#### Create FHS
mkdir -p ${HOME}/tmp
mkdir -p ${HOME}/lib
mkdir -p ${HOME}/bin
mkdir -p ${HOME}/conf
mkdir -p ${HOME}/source
mkdir -p ${HOME}/systemd

Deploy Golang

Install golang for compile binary
wget https://go.dev/dl/go1.21.8.linux-amd64.tar.gz
tar xfv go1.21.8.linux-amd64.tar.gz
mv go ${HOME}/bin

Deploy Application

The Purpose is extract from file compression and move to ${HOME}/bin
cd ${HOME}/source
git clone  https://github.com/sge-network/sge sge
cd ${HOME}/source/sge
git fetch && git checkout 
make build
cp build/sged ${HOME}/bin/

Environment and Variable

If Using ZSH
# Set Go path to $PATH variable
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> $HOME/.zshrc
echo "export GOPATH="${HOME}/lib" >> $HOME/.zshrc
echo "export GOMAXPROCS=2" >> $HOME/.zshrc
echo "export CHAIN_ID=sge-network-4" >> $HOME/.zshrc
echo "export WALLET_NAME=mywallet" >> $HOME/.zshrc
echo "export MONIKER=MYNODE"  >> $HOME/.zshrc
source ~/.zshrc
or
If Using BASH
# Set Go path to $PATH variable
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> $HOME/.bashrc
echo "export GOPATH="${HOME}/lib" >> >> $HOME/.bahsrc
echo "export GOMAXPROCS=2" >> $HOME/.bashrc
echo "export CHAIN_ID=sge-network-4" >> $HOME/.bashrc
echo "export WALLET_NAME=mywallet" >> $HOME/.bashrc
echo "export MONIKER=MYNODE"  >> $HOME/.bashrc
source ~/.bashrc

Initiation Moniker

sged init --chain-id $CHAIN_ID "$MONIKER"

Deploy Genesis

curl -Ls  https://roomit.xyz/genesis/testnet/sge/genesis.json > $HOME/.sge/config/genesis.json 

Deploy Addressbook

curl -Ls  https://roomit.xyz/addressbook/testnet/sge/addrbook.json > $HOME/.sge/config/genesis.json 

Change Custom Port (optional)

If you have conflicted port or running tendermint with 1 environment node. you need change the ports otherwise you have conflicted ports.

PROXY_APP="16505"
RPC="16705" 
PROF_RPC="1105" 
P2P="16605" 
METRICS="16805" 
API="1205" 
GRPC="1305" 
WEBGRPC="1405" 

sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${PROXY_APP}\"%" $HOME/.sge/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${RPC}\"%" $HOME/.sge/config/config.toml 
sed -i.bak -e "s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${PROF_RPC}\"%" $HOME/.sge/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${P2P}\"%" $HOME/.sge/config/config.toml 
sed -i.bak -e "s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${METRICS}\"%" $HOME/.sge/config/config.toml
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${API}\"%" $HOME/.sge/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${GRPC}\"%" $HOME/.sge/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${WEBGRPC}\"%" $HOME/.sge/config/app.toml

Change Prune Parameter (optional)

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

Create Service Systemd

Login to root

#### From user with sudoers access

$ sudo su -

The first we made in user salinem ${HOME}/systemd/
cat > ${HOME}/systemd/sge-node.service << EOF
[Unit]
Description= Tendermint Daemon
After=network-online.target

[Service]
User=salinem
Group=salinem
ExecStart=/mainnet/salinem/bin/sged start  --home=/mainnet/salinem/.sge
Restart=on-failure
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
EOF
Copy from ${HOME}/systemd/sge-node.service to /etc/systemd/system/
sudo cp -rf /mainnet/salinem/systemd/sge-node.service /etc/systemd/system/

Service Management

Reload Daemon
sudo systemctl daemon-reload
Enable Service when booting
sudo systemctl enable sge-node.service
Start Service
sudo systemctl start sge-node.service
Check Service and Log
sudo systemctl status sge-node.service
sudo journalctl -fu sge-node.service
After All running well, You can speed up blocks using 2 methods Statesync or Snapshot

STATE-SYNC

Deployment Statesync

1. Create file or we assume filename already created statesync.sh, edit this file and put code below

#!/bin/bash

SNAP_RPC="https://rpc.sge.roomit.xyz:443"

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.sge/config/config.toml

2. Stop Service

sudo systemctl stop sge-node

Notes: for systemd init blockchain, adjust with your name of service. Example : systemctl stop sged

3. Execute Script

bash statesync.sh

4. Reset Node

# On some tendermint chains
sged unsafe-reset-all

# On other tendermint chains
sged tendermint unsafe-reset-all --home $HOME/.sge --keep-addr-book

5. Start Services

sudo systemctl start sge-node

SNAPSHOT

Deployment Snapshot

1. Install Compression/Decompression Tools

sudo apt install lzma -y

2. Download Snapshot
Filename |
File Size |

SNAPSHOT=$(curl -s https://roomit.xyz/snapshot/testnet/sge/ | grep -i "<a href=" | grep lzma | grep -v md5sum | awk -F"=" '{print $2}' |  sed 's/"//g' | sed "s/>//g" | sed "s/ //g")
wget -c https://roomit.xyz/snapshot/testnet/sge/${SNAPSHOT} --inet4-only

3. Stop Your Service Blockchain

sudo systemctl stop sge-node

Notes : for systemd init blockchain, adjust with your name of service. Example : systemctl stop sged

4. Backup State Validator

cp ${HOME}/.sge/data/priv_validator_state.json ${HOME}/.sge/priv_validator_state.json

4. Reset Node Blockchain

sged tendermint unsafe-reset-all --home $HOME/.sge --keep-addr-book

5. Extract Data Snapshot

lzma -d -c ${SNAPSHOT} | tar -xv -C $HOME/.sge 

6. Restore State Validator

cp ${HOME}/.sge/priv_validator_state.json ${HOME}/.sge/data/priv_validator_state.json

7. Start Node Blockchain

sudo systemctl start sge-node

ENDPOINT PUBLIC

RPC

https://rpc.sge.roomit.dev

API

https://api.sge.roomit.dev
    

gRPC

grpc.sge.roomit.dev:8443

Example Call:

Assume, you have done install grpcurl

grpcurl grpc.sge.roomit.dev:8443 list

GENESIS

Deployment Genesis

Stop Your Service Blockchain
sudo systemctl stop sge-node

Notes : for systemd init blockchain, adjust with your name of service. Example : systemctl stop sged

Download And Deploy
curl -Ls  https://roomit.xyz/genesis/testnet/sge/genesis.json > $HOME/.sge/config/genesis.json 
Start Your Service Blockchain
sudo systemctl start sge-node

ADDRESSBOOK

Deployment Addressbook

Stop Your Service Blockchain
sudo systemctl stop sge-node

Notes : for systemd init blockchain, adjust with your name of service. Example : systemctl stop sged

Download And Deploy
curl -Ls  https://roomit.xyz/addressbook/testnet/sge/addrbook.json > $HOME/.sge/config/genesis.json 
Start Your Service Blockchain
sudo systemctl start sge-node

PEERS

SEEDS

Seed Peers

Our seeds peer for SGE Blockchain,
you can edit seeds = "" in ${HOME}/.sge/config/config.toml
08bc9afd0cac4ae6cf8f1877920b0cc7e58a6f42@seeds.tendermint.roomit.dev:40005

PERSISTENT

Persistent Peers

Our persistent peers for SGE Blockchain,
you can add our persistent persistent_peers = "" in ${HOME}/.sge/config/config.toml
b7f6da1a8aea371206b4d234398c4888c0564066@p2p.tendermint.roomit.dev:16605

All Persistent Peers

All Persistent Peers From Roomit Connected Peers
PERSISTENT_PEERS="Data Processing"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PERSISTENT_PEERS\"/" ${HOME}/.sge/config/config.toml

PRUNE

Change Prune Parameter

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

PORT

Change Custom Port

If you have conflicted port or running tendermint with 1 environment node. you need change the ports otherwise you have conflicted ports.

PROXY_APP="16505"
RPC="16705" 
PROF_RPC="1105" 
P2P="16605" 
METRICS="16805" 
API="1205" 
GRPC="1305" 
WEBGRPC="1405" 

sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${PROXY_APP}\"%" $HOME/.sge/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${RPC}\"%" $HOME/.sge/config/config.toml 
sed -i.bak -e "s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${PROF_RPC}\"%" $HOME/.sge/config/config.toml 
sed -i.bak -e "s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${P2P}\"%" $HOME/.sge/config/config.toml 
sed -i.bak -e "s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${METRICS}\"%" $HOME/.sge/config/config.toml
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${API}\"%" $HOME/.sge/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${GRPC}\"%" $HOME/.sge/config/app.toml
sed -i.bak -e "s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${WEBGRPC}\"%" $HOME/.sge/config/app.toml

CLI

Setup Environment

IMPORTANT! You must setup this environment before used CLI
If you using bash shell
echo "export RPC="http://localhost:$(head -n100 ${HOME}/.sge/config/config.toml | grep "[rpc]" | grep "^laddr" | awk -F":" '{print $3}' | tr -d "\"" |  tr "\n" " " |sed "s/ //")"" >> ${HOME}/.bashrc
echo "export UNIT="usge"" >> ${HOME}/.bashrc
echo "export MONIKER="NODE_DEPLOY_ROOMIT_SCRIPT"" >> ${HOME}/.bashrc
echo "export CHAIN_ID="sge-network-4"" >> ${HOME}/.zshrc
echo "export PROFILE="PGP_KEY_OF_KEYBASE"" >> ${HOME}/.bashrc
echo "export DETAILS="Describes Your Validator"" >> ${HOME}/.bashrc
echo "export WEBSITE="https://yourwebsite.com"" >> ${HOME}/.bashrc
source ${HOME}/.bashrc
If you using zsh shell
echo "export RPC="http://localhost:$(head -n100 ${HOME}/.sge/config/config.toml | grep "[rpc]" | grep "^laddr" | awk -F":" '{print $3}' | tr -d "\"" |  tr "\n" " " |sed "s/ //")"" >> ${HOME}/.zshrc
echo "export UNIT="usge"" >> ${HOME}/.zshrc
echo "export MONIKER="NODE_DEPLOY_ROOMIT_SCRIPT"" >> ${HOME}/.zshrc
echo "export CHAIN_ID="sge-network-4"" >> ${HOME}/.zshrc
echo "export PROFILE="PGP_KEY_OF_KEYBASE"" >> ${HOME}/.zshrc
echo "export DETAILS="Describes Your Validator"" >> ${HOME}/.zshrc
echo "export WEBSITE="https://yourwebsite.com"" >> ${HOME}/.zshrc
source ${HOME}/.zshrc

Gas Fees

Default setting for gas fee SGE Blockchain
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5

Keys Management

We assume,You have complete identities. Moniker, Website, Security and Details Your Validator Install jq package for management json format

Ubuntu
apt install jq

CentOS
yum install jq

Arch Linux
pacman -S jq

Add New Key
sged keys add mywallet --home ${HOME}/.sge 
Recover Key
Recovery key with passpharse
sged keys add mywallet --recover --home ${HOME}/.sge
Recovery key with passpharse
sged keys add mywallet --recover --keyring-backend os --home ${HOME}/.sge
List Key
sged keys list --home ${HOME}/.sge
Delete Key
sged keys delete mywallet --home ${HOME}/.sge
Export Key
sged keys export mywallet --home ${HOME}/.sge
Import Key
sged keys import mywallet mywallet.backup --home ${HOME}/.sge
Show All Balances Address
for mywallet in `sged keys list --home ${HOME}/.sge --output json| jq -r ".[] .address"`
do
    sged q bank balances ${mywallet} --home ${HOME}/.sge --chain-id ${CHAIN_ID} --node ${RPC}
done
Show All Balances Address
sged q bank balances mywallet_public_address --home ${HOME}/.sge --chain-id ${CHAIN_ID} --node ${RPC}

Validator Management

We assume,You have complete identities. Moniker, Website, Security and Details Your Validator Install jq package for management json format

Ubuntu
apt install jq

CentOS
yum install jq

Arch Linux
pacman -S jq

Create New Validator
Before create validator make sure you have balance in your wallet (mywallet).
sged tx staking create-validator \
--amount=1000000${UNIT} \
--pubkey=$(sged tendermint show-validator --home ${HOME}/.sge) \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=${CHAIN_ID} \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=mywallet \
--node ${RPC} \
--home ${HOME}/.sge \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y
Edit Validator
Before edit validator make sure you have balance in your wallet (mywallet).
sged tx staking edit-validator \
--pubkey=$(sged tendermint show-validator --home ${HOME}/.sge) \
--moniker="${MONIKER}" \
--identity="${PROFILE}" \
--details="${DETAILS}" \
--website="${WEBSITE}" \
--chain-id=${CHAIN_ID} \
--commission-rate=0.05 \
--from=mywallet \
--node ${RPC} \
--home ${HOME}/.sge \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y
Edit Validator
sged status 2>&1 | jq .ValidatorInfo
Get Status Syncing Block
sged status 2>&1 | jq .SyncInfo
Get Peer Own Id
echo $(sged tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.sge/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
Get ALl Peer Node
curl -sS ${RPC}/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'
Unjail Validator
sged tx slashing unjail \
--from mywallet \
--chain-id ${CHAIN_ID} \
--home ${HOME}/.sge \
--node  ${RPC} \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y
Jail Reason
sged query slashing signing-info $(sged tendermint show-validator) \
--node  ${RPC} \
--home ${HOME}/.sge
List All Active Validator
sged  q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
List All Inactive Validator
sged q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
Show Validator Details
sged query staking validator \
$(sged keys show \ 
$(sged keys list --home ${HOME}/.sge --output json| jq -r ".[] .address" | tail -n1) \
--bech val -a) \
--chain-id ${CHAIN_ID} \
--node $RPC

Token Management

Withdraw All Reward From Validator
sged tx distribution withdraw-all-rewards \
--from mywallet \
--chain-id ${CHAIN_ID} \
--node $RPC \
--home ${HOME}/.sge \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y
Withdraw Commision Reward From Validator
sged tx distribution withdraw-rewards $(sged keys show mywallet --bech val -a) \
--commission \
--from mywallet \
--chain-id ${CHAIN_ID} \
--node $RPC \
--home ${HOME}/.sge \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 
Delegate My Token to Own Validator
sged  tx staking delegate prefixVALOPExxxxxx 100000${UNIT} \ 
--from mywallet \
--chain-id ${CHAIN_ID} \
--node $RPC \
--home ${HOME}/.sge \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y
Redelegate Tokens to Another Validator
sged tx staking redelegate $(sged keys show wallet --bech val -a)  100000${UNIT} \
--from mywallet \
--chain-id ${CHAIN_ID} \
--node $RPC \
--home ${HOME}/.sge \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 
Unbound or Unstake Your Tokens
sged tx staking unbond $(sged keys show wallet --bech val -a) 100000${UNIT} \
--from mywallet \
--chain-id ${CHAIN_ID} \
--node $RPC \
--home ${HOME}/.sge \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 
Send tokens to the wallet
sged tx bank send wallet  100000${UNIT} \
--from mywallet \
--chain-id ${CHAIN_ID} \
--node $RPC \
--home ${HOME}/.sge \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 

Governance Management

We assume,You have complete identities. Moniker, Website, Security and Details Your Validator Install jq package for management json format

Ubuntu
apt install jq

CentOS
yum install jq

Arch Linux
pacman -S jq

List All Proposals
sged  query gov proposals
Voting
### vote yes
sged tx gov vote 1 yes \
--from mywallet \
--chain-id ${CHAIN_ID} \
--node $RPC \
--home ${HOME}/.sge \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 

### vote no
sged tx gov vote 1 no \
--from mywallet \
--chain-id ${CHAIN_ID} \
--node $RPC \
--home ${HOME}/.sge \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 

### vote abstain
sged tx gov vote 1 abstain \
--from mywallet \
--chain-id ${CHAIN_ID} \
--node $RPC \
--home ${HOME}/.sge \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y 

### vote No With Veto
sged tx gov vote 1 nowithveto \
--from mywallet \
--chain-id ${CHAIN_ID} \
--node $RPC \
--home ${HOME}/.sge \
--gas=auto --gas-prices=0.025usge --gas-adjustment=1.5 \
-y   

VALIDATORS LIST

Validator Details Commission Status Jailed Staked

GOVERNANCE

Governance This Month |
Proposal Description Status Voting Start Voting End Total Voted Participant

NETWORK SCAN

Network scan is tools for check node where the node open direct port rpc from internet without proxy.

This data collect from our RPC only https://rpc.sge.roomit.dev

P2P Network Moniker RPC Remote IP Status

MAP NODE

IP Address City Region Country Latitude Longitude