Add restart-explorer script, to easily restart the network explorer on a testnet (#5886)
This commit is contained in:
parent
9c30e98df6
commit
8b64de0a3c
|
@ -271,9 +271,11 @@ EOF
|
||||||
ls -l .cert.pem .key.pem
|
ls -l .cert.pem .key.pem
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cat > ~/solana/restart-explorer <<EOF
|
||||||
|
#!/bin/bash -ex
|
||||||
|
cd ~/solana
|
||||||
npm install @solana/blockexplorer@1
|
npm install @solana/blockexplorer@1
|
||||||
|
killall node || true
|
||||||
cat >> ~/solana/on-reboot <<EOF
|
|
||||||
export BLOCKEXPLORER_GEOIP_WHITELIST=$PWD/net/config/geoip.yml
|
export BLOCKEXPLORER_GEOIP_WHITELIST=$PWD/net/config/geoip.yml
|
||||||
npx solana-blockexplorer > blockexplorer.log 2>&1 &
|
npx solana-blockexplorer > blockexplorer.log 2>&1 &
|
||||||
|
|
||||||
|
@ -281,6 +283,17 @@ cat >> ~/solana/on-reboot <<EOF
|
||||||
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
|
||||||
sudo iptables -A INPUT -p tcp --dport 5000 -j ACCEPT
|
sudo iptables -A INPUT -p tcp --dport 5000 -j ACCEPT
|
||||||
sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 5000
|
sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 5000
|
||||||
|
|
||||||
|
# Confirm the explorer is accessible
|
||||||
|
curl --head --retry 3 --retry-connrefused http://localhost:5000/
|
||||||
|
|
||||||
|
# Confirm the explorer is now globally accessible
|
||||||
|
curl --head "\$(curl ifconfig.io)"
|
||||||
|
EOF
|
||||||
|
chmod +x ~/solana/restart-explorer
|
||||||
|
|
||||||
|
cat >> ~/solana/on-reboot <<EOF
|
||||||
|
~/solana/restart-explorer
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -296,14 +309,6 @@ EOF
|
||||||
~/solana/on-reboot
|
~/solana/on-reboot
|
||||||
waitForNodeToInit
|
waitForNodeToInit
|
||||||
|
|
||||||
if [[ $nodeType = blockstreamer ]]; then
|
|
||||||
# Confirm the blockexplorer is accessible
|
|
||||||
curl --head --retry 3 --retry-connrefused http://localhost:5000/
|
|
||||||
|
|
||||||
# Confirm the blockexplorer is now globally accessible
|
|
||||||
curl --head "$(curl ifconfig.io)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $skipSetup != true && $nodeType != blockstreamer ]]; then
|
if [[ $skipSetup != true && $nodeType != blockstreamer ]]; then
|
||||||
args=(
|
args=(
|
||||||
--url http://"$entrypointIp":8899
|
--url http://"$entrypointIp":8899
|
||||||
|
|
Loading…
Reference in New Issue