Add restart-explorer script, to easily restart the network explorer on a testnet (#5886)

This commit is contained in:
Michael Vines 2019-09-12 15:12:10 -07:00 committed by GitHub
parent 9c30e98df6
commit 8b64de0a3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 10 deletions

View File

@ -271,9 +271,11 @@ EOF
ls -l .cert.pem .key.pem
fi
cat > ~/solana/restart-explorer <<EOF
#!/bin/bash -ex
cd ~/solana
npm install @solana/blockexplorer@1
cat >> ~/solana/on-reboot <<EOF
killall node || true
export BLOCKEXPLORER_GEOIP_WHITELIST=$PWD/net/config/geoip.yml
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 5000 -j ACCEPT
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
fi
@ -296,14 +309,6 @@ EOF
~/solana/on-reboot
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
args=(
--url http://"$entrypointIp":8899