Last updated 3 months ago
URL="https://titan-testnet-rpc.mictonode.com/net_info"
response=$(curl -s $URL)
PEERS=$(echo $response | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):" + (.node_info.listen_addr | capture("(?<ip>.+):(?<port>[0-9]+)$").port)' | paste -sd "," -)
echo "PEERS=\"$PEERS\""
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.titan/config/config.toml
sudo systemctl daemon-reload sudo systemctl restart titan sudo journalctl -u titan -f -o cat
curl -Ss localhost:(whatever you typed in custom_port)657/net_info | jq .result.n_peers
curl -sS http://localhost:(whatever you typed in custom_port)657/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'