Installation
Manual installation
Install depedencies
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
Install GO
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.21.13.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh)
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)
Sett Vars
to make installstion easy i suggest u use this
echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="Moiker"" >> $HOME/.bash_profile
echo "export SAFROCHAIN_ID="safro-testnet-1"" >> $HOME/.bash_profile
echo "export SAFROCHAIN_PORT="13"" >> $HOME/.bash_profile
source $HOME/.bash_profile
Download Binaries
cd $HOME
rm -rf safrochain-node
git clone https://github.com/Safrochain-Org/safrochain-node.git
cd safrochain-node
git checkout v0.1.0
make install
Configure and inittial app
safrochaind init $MONIKER --chain-id safro-testnet-1
sed -i -e "s|^node *=.*|node = \"tcp://localhost:13157\"|" $HOME/.safrochain/config/client.toml
sed -i -e "s|^keyring-backend *=.*|keyring-backend = \"os\"|" $HOME/.safrochain/config/client.toml
sed -i -e "s|^chain-id *=.*|chain-id = \"safro-testnet-1\"|" $HOME/.safrochain/config/client.toml
Download Genesis and Addrbook
curl -L https://snapshot.nodevism.com/testnet/safrochain/genesis.json > $HOME/.safrochain/config/genesis.json
curl -L https://snapshot.nodevism.com/testnet/safrochain/addrbook.json > $HOME/.safrochain/config/addrbook.json
Sett Seed and Peer
SEEDS="43765518cb55514152d9eeb4072e1d6859cfe428@safrochain-t.nodevism.com:13656"
PEERS="$(curl -sS https://rpc.safrochain-t.nodevism.com/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|^seeds *=.*|seeds = '"$SEEDS"'|; s|^persistent_peers *=.*|persistent_peers = '"$PEERS"'|" $HOME/.safrochain/config/config.toml
Sett Custom Port at config.toml
sed -i.bak -e "s%:26658%:${SAFROCHAIN_PORT}658%g;
s%:26657%:${SAFROCHAIN_PORT}657%g;
s%:6060%:${SAFROCHAIN_PORT}060%g;
s%:26656%:${SAFROCHAIN_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${SAFROCHAIN_PORT}656\"%;
s%:26660%:${SAFROCHAIN_PORT}660%g" $HOME/.safrochain/config/config.toml
Sett Custom Port at App.toml
sed -i.bak -e "s%:1317%:${SAFROCHAIN_PORT}317%g;
s%:8080%:${SAFROCHAIN_PORT}080%g;
s%:9090%:${SAFROCHAIN_PORT}090%g;
s%:9091%:${SAFROCHAIN_PORT}091%g;
s%:8545%:${SAFROCHAIN_PORT}545%g;
s%:8546%:${SAFROCHAIN_PORT}546%g;
s%:6065%:${SAFROCHAIN_PORT}065%g" $HOME/.safrochain/config/app.toml
Config Prunning
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "17"|' \
$HOME/.safrochain/config/app.toml
Sett Minimum Gas Prices
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.001usaf\"|" $HOME/.safrochain/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.safrochain/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.safrochain/config/config.toml
Create Service
sudo tee /etc/systemd/system/safrochaind.service > /dev/null <<EOF
[Unit]
Description=safrochaind node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which safrochaind) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
Download Current Snapshot
curl "https://snapshot.nodevism.com/testnet/safrochain/safrochain-snapshot.tar.lz4" | lz4 -dc - | tar -xf - -C "$HOME/.safrochain"
Enable And Start Service
sudo systemctl daemon-reload
sudo systemctl enable safrochaind.service
sudo systemctl restart safrochaind.service && sudo journalctl -u safrochaind.service -f --no-hostname -o cat
Last updated