Manual

Build the Node from scratch step by step

1. Install Dependencies

If you already Installed this dependecies before, you can skip this step

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 or higher you can skip this step

check your GO version:

rm -rf $HOME/go
sudo rm -rf /usr/local/go
cd $HOME
curl https://dl.google.com/go/go1.20.1.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

  1. Download and Install Binary

cd $HOME
rm -rf gitopia
git clone https://github.com/gitopia/gitopia.git
cd gitopia
git checkout v2.0.0

make build
gitopiad version

  1. Install Cosmovisor

If you already Installed cosmovisor before, you can skip this step.

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

  1. Create Symbolic Links for Cosmovisor

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

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

  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, except: 18, 22, 23, 53, 80 and 323)
gitopiad config chain-id gitopia
gitopiad config keyring-backend file
gitopiad config node tcp://localhost:${PORT}657
gitopiad init $NODENAME --chain-id gitopia

  1. Download Addrbook & Genesis

wget -O addrbook.json https://snapshots.polkachu.com/addrbook/gitopia/addrbook.json --inet4-only
mv addrbook.json ~/.gitopia/config

wget -O genesis.json https://snapshots.polkachu.com/genesis/gitopia/genesis.json --inet4-only
mv genesis.json ~/.gitopia/config

  1. Configure Seeds and Peers

SEEDS="ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@seeds.polkachu.com:11356"
PEERS="7de2631f6bc7cc0caf30c3745d4795c1dbc91cf3@65.109.104.72:11356"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.gitopia/config/config.toml

  1. Configure Pruninge

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

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

  1. Create Service

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

[Install]
WantedBy=multi-user.target
EOF

  1. Start Node

sudo systemctl daemon-reload
sudo systemctl enable gitopiad
sudo systemctl start gitopiad

  1. (Optional) Check Node Status

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

sudo journalctl -fu gitopiad -o cat

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

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

Last updated