Skip to content

Instantly share code, notes, and snippets.

@nickhough
Last active March 18, 2021 22:10
Show Gist options
  • Save nickhough/8aeae7ddc6452d95b22f2bb0924fd3ff to your computer and use it in GitHub Desktop.
Save nickhough/8aeae7ddc6452d95b22f2bb0924fd3ff to your computer and use it in GitHub Desktop.
Helium Validator Chain Restart - For validators built from source
#!/bin/bash
# Validator Restart
echo "\nValidator Restart\n"
cd ~/miner &&
echo "Git Pull.\n" &&
git pull &&
echo "Building release.\n" &&
./rebar3 as validator release &&
echo "Deleting miner data directory.\n" &&
rm -rf ./_build/validator/rel/miner/data/
echo "Stopping miner.\n" &&
./_build/validator/rel/miner/bin/miner stop &&
echo "Starting miner.\n" &&
./_build/validator/rel/miner/bin/miner start &&
echo "Remove old genesis block.\n" &&
rm ./genesis.testnet &&
echo "Getting genesis block.\n" &&
wget https://snapshots.helium.wtf/genesis.testnet &&
echo "Loading genesis block.\n" &&
./_build/validator/rel/miner/bin/miner genesis load </absolute/path/to/genesis.testnet>
echo "Validator Status\n" &&
./_build/validator/rel/miner/bin/miner info p2p_status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment