Safrochain Testnet Validator
Safrochain is A Blockchain Bridging Local Lives and Global Assets
Chaind ID | Last Version Tag |
---|---|
safro-testnet-1 | v0.1.0 |
Installation
- Install Dependencies
bash
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y
- Install Go
bash
cd $HOME
VER="1.22.3"
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
- Set Vars
Configuration:
Generated Code:
Loading...
- Download Binary
bash
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
- Initialized
bash
safrochaind init $MONIKER --chain-id $SAFROCHAIN_ID
sed -i \
-e 's|^chain-id *=.*|chain-id = "safro-testnet-1"|' \
-e 's|^keyring-backend *=.*|keyring-backend = "os"|' \
-e "s|^node *=.*|node = \"tcp://localhost:${SAFROCHAIN_PORT}657\"|" \
$HOME/.safrochain/config/client.toml
- Download addrbook & genesis
bash
wget -O $HOME/.safrochain/config/genesis.json https://vault2.astrostake.xyz/testnet/safrochain/genesis.json
wget -O $HOME/.safrochain/config/addrbook.json https://vault2.astrostake.xyz/testnet/safrochain/addrbook.json
- Configure Node
Configure peers
bash
PEERS="$(curl -sS https://safrochain-testnet-rpc.linknode.org/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|^persistent_peers *=.*|persistent_peers = "'"$PEERS"'"|' "$HOME/.safrochain/config/config.toml"
Update app.toml
ports
bash
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
Update config.toml
ports
bash
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
Configure pruning
bash
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.safrochain/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.safrochain/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"19\"/" $HOME/.safrochain/config/app.toml
Set Minimum Gas Fee & Other Parameters
bash
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.001usaf"|g' $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 Services
bash
sudo tee /etc/systemd/system/safrochaind.service > /dev/null <<EOF
[Unit]
Description=safrochain-testnet
After=network-online.target
[Service]
User=$USER
ExecStart=$(which safrochaind) start --home $HOME/.safrochain
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
- Start Services
bash
sudo systemctl daemon-reload
sudo systemctl enable safrochaind
sudo systemctl restart safrochaind && sudo journalctl -u safrochaind -fo cat
Useful Commands
INFO
For a complete guide to creating a validator, visit our Cheat Sheet & Key Management page. It covers all the necessary commands and crucial steps for securing your keys.
Check logs
bash
sudo journalctl -u safrochaind -fo cat
Check Sync
bash
curl -sL https://raw.githubusercontent.com/astrostake/scripts/refs/heads/main/cosmos_sync_monitor.sh | bash -s -- --directory $HOME/.safrochain --public-rpc https://safrochain-testnet-rpc.linknode.org --interval 5
🛡️ Security
To apply a quick security baseline, you can configure your firewall like this:
bash
sudo ufw allow ${SAFROCHAIN_PORT}656/tcp comment 'SAFROCHAIN Node p2p Port'
🔐 For a more secure and maintainable setup, check out our Essentials Guide, including SSH key setup, Fail2Ban protection, and a full VPS hardening checklist.