Testnet
Manual Installation

Manual Instalation

Install dependencies

1sudo apt update && sudo apt upgrade -y
2sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y

Setup GO

1cd $HOME
2VER="1.22.0"
3wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
4sudo rm -rf /usr/local/go
5sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
6rm "go$VER.linux-amd64.tar.gz"
7[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
8echo "export PATH=\"\$PATH:/usr/local/go/bin:~/go/bin\"" >> ~/.bash_profile
9source $HOME/.bash_profile
10[ ! -d ~/go/bin ] && mkdir -p ~/go/bin

Setup variables

1MONIKER=mynode
2CHAIN_ID=fairyring-testnet-3
3BASE_PORT=16

Download latest binary

1# build binary
2git clone https://github.com/Fairblock/fairyring fairblock
3cd fairblock
4git checkout v0.9.1
5make install

Init Chain

1fairyringd init $MONIKER --chain-id $CHAIN_ID
2FAIRBLOCK_HOME=$HOME/.fairyring
3cd $FAIRBLOCK_HOME/config
4rm addrbook.json genesis.json
5
6# download addrbook & genesis
7wget https://blockhunters.dev/snapshots/testnet/fairblock/addrbook.json
8wget https://blockhunters.dev/snapshots/testnet/fairblock/genesis.json

Config Chain

Set min gas price

1MIN_PRICE="0ufairy"
2sed -i -e "s#^minimum-gas-prices = .*#minimum-gas-prices = \"$MIN_PRICE\"#" $FAIRBLOCK_HOME/config/app.toml

Set seed

1SEEDS="[email protected]:15156"
2sed -i -e "s#seeds = .*#seeds = \"$SEEDS\"#" $FAIRBLOCK_HOME/config/config.toml

Set custom ports in app.toml

1sed -i.bak -e "s%:1317%:${BASE_PORT}317%g;
2s%:8080%:${BASE_PORT}080%g;
3s%:9090%:${BASE_PORT}090%g;
4s%:9091%:${BASE_PORT}091%g;
5s%:8545%:${BASE_PORT}545%g;
6s%:8546%:${BASE_PORT}546%g;
7s%:6065%:${BASE_PORT}065%g" $FAIRBLOCK_HOME/config/app.toml

Set custom ports in config.toml file

1sed -i.bak -e "s%:26658%:${BASE_PORT}658%g;
2s%:26657%:${BASE_PORT}657%g;
3s%:6060%:${BASE_PORT}060%g;
4s%:26656%:${BASE_PORT}656%g;
5s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${BASE_PORT}656\"%;
6s%:26660%:${BASE_PORT}660%g" $FAIRBLOCK_HOME/config/config.toml

Set custom client port in client.toml file

1sed -i.bak -e "s%:26657%:${BASE_PORT}657%g" $FAIRBLOCK_HOME/config/client.toml

Config pruning

1sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $FAIRBLOCK_HOME/config/app.toml
2sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $FAIRBLOCK_HOME/config/app.toml
3sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"11\"/" $FAIRBLOCK_HOME/config/app.toml

Disable indexing

1sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $FAIRBLOCK_HOME/config/config.toml

Install & configure cosmovisor

1go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/[email protected]
2
3# Create Cosmovisor Folders
4mkdir -p $FAIRBLOCK_HOME/cosmovisor/genesis/bin
5mkdir -p $FAIRBLOCK_HOME/cosmovisor/upgrades
6
7# Load Node Binary into Cosmovisor Folder
8cp ~/go/bin/fairyringd $FAIRBLOCK_HOME/cosmovisor/genesis/bin

Create service file

1sudo tee /etc/systemd/system/fairyringd.service > /dev/null <<EOF
2[Unit]
3Description=Fairblock Node
4After=network-online.target
5[Service]
6User=$USER
7WorkingDirectory=$FAIRBLOCK_HOME
8ExecStart=$(which cosmovisor) start --home $FAIRBLOCK_HOME
9Restart=on-failure
10RestartSec=5
11LimitNOFILE=65535
12Environment="DAEMON_NAME=fairyringd"
13Environment="DAEMON_HOME=$FAIRBLOCK_HOME"
14Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
15Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
16Environment="UNSAFE_SKIP_BACKUP=true"
17[Install]
18WantedBy=multi-user.target
19EOF

Enable and start service

1sudo systemctl daemon-reload
2sudo systemctl enable fairyringd --now
3sudo journalctl -u fairyringd -f