Skip to content

Commit

Permalink
dependecy checks
Browse files Browse the repository at this point in the history
  • Loading branch information
igorls committed May 21, 2018
1 parent 5f0b928 commit a124715
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 9 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,15 @@ Input your information for the highlighted fields shown below:
### 4. Run the script

```console
# Run testnet installation script
./installGhostbusters.sh

# update peers on the base config.ini
./updatePeers.sh
./updatePeers.sh - restart # will reload nodeos after update
./updatePeers.sh lxd restart # will reload nodeos on lxd after update

## If you want to cleanup dead peers, run:
## If you want to cleanup dead peers (wg only), run:
./peerCleanup.sh remove strict # removes all even if just wg is down
./peerCleanup.sh remove # removes just completely offline host
./peerCleanup.sh # debug mode, don't remove
Expand Down
21 changes: 17 additions & 4 deletions autolaunch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
## DEFINE TARGET BTC BLOCK
TARGET_BLOCK=523069;

if ! which keybase > /dev/null; then
echo -e "Keybase not installed. Exiting..."
exit 1;
fi

if ! which jq > /dev/null; then
echo -e "jq not found! Install? (y/n) \c"
read
if "$REPLY" = "y"; then
sudo apt install jq
fi
fi

get_seeded_random()
{
seed="$1"
Expand Down Expand Up @@ -80,7 +93,7 @@ remove_cronjob()

## Check KBFS mount point
echo -e "--------------- VERIFYING KEYBASE FILE SYSTEM ---------------\n";
KBFS_MOUNT=$(keybase status | grep mount | cut -f 2 -d:);
KBFS_MOUNT=$(keybase status | grep mount | cut -f 2 -d: | sed -e 's/^\s*//' -e '/^$/d');

## Restart Keybase if needed
if [ -d "$KBFS_MOUNT" ]; then
Expand Down Expand Up @@ -215,7 +228,7 @@ if [[ "$SELECTED_USER" == "$keybase_username" ]]; then
wall "EOS Launch Time: You have been chosen as bios! - press enter to continue...";
build_genesis;
cp ./genesis.json ./BiosNode/genesis.json
cp ./genesis.json /keybase/public/$keybase_username/genesis.json;
cp ./genesis.json $KBFS_MOUNT/public/$keybase_username/genesis.json;
cp ./cleos.sh ./BiosNode/cleos.sh
cp ./start.sh ./BiosNode/start.sh
cp ./stop.sh ./BiosNode/stop.sh
Expand All @@ -225,11 +238,11 @@ else
wall "EOS Launch Time! $SELECTED_USER was chosen as bios node! - press enter to continue...";
echo "Waiting for genesis... 30s";
sleep 30;
while [[ ! -f /keybase/public/$SELECTED_USER/genesis.json ]]; do
while [[ ! -f $KBFS_MOUNT/public/$SELECTED_USER/genesis.json ]]; do
echo -e "Genesis is not ready yet - please verify this url on your browser\n https://$SELECTED_USER.keybase.pub/genesis.json";
read -n 1 -s -r -p "Press any key when ready!";
done
cp /keybase/public/$SELECTED_USER/genesis.json genesis.json;
cp $KBFS_MOUNT/public/$SELECTED_USER/genesis.json genesis.json;
echo "Genesis ready! Node will start now...";
remove_cronjob;
bash start.sh
Expand Down
9 changes: 8 additions & 1 deletion peerCleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

sudo wg show ghostbusters | grep -A 2 "peer: " > peers.temp

cmd="$1"
if ! which fping > /dev/null; then
echo -e "fping not found! Install? (y/n) \c"
read
if "$REPLY" = "y"; then
sudo apt install fping
fi
fi

cmd="$1"
strict="$2"

if [[ $cmd == "remove" ]]; then
Expand Down
6 changes: 6 additions & 0 deletions publishPeerInfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ if [[ $1 == "" ]]; then
echo
exit 1;
fi

if ! which keybase > /dev/null; then
echo -e "Keybase not installed. Exiting..."
exit 1;
fi

## Check KBFS mount point
echo
echo "--------------- VERIFYING KEYBASE FILE SYSTEM ---------------";
Expand Down
6 changes: 3 additions & 3 deletions updatePeers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ fi

echo -e "\n Update finished!\nWG Peers: $wgPeerCount \nEOS Peers: $eosPeerCount";

if [[ $1 == "restart" ]]; then
if [[ $2 == "restart" ]]; then
if [[ $LXD_MODE == true ]]; then
# Restart LXD Node
echo -e "\nRestarting nodeos on lxd... \n";
else
# Restart Standard Node
echo -e "\nRestarting nodeos... \n";
./$TESTNET_DIR/start.sh
tail -f ./$TESTNET_DIR/stderr.txt
fi
fi

0 comments on commit a124715

Please sign in to comment.