Skip to content

Commit

Permalink
Pass bootnodes into the container (fuseio#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-Pohl authored and Parker M. Lambert committed Apr 24, 2022
1 parent 35d6c1b commit caa3287
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions scripts/quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ DEFAULT_GAS_ORACLE="https:\/\/ethgasstation.info\/json\/ethgasAPI.json"

PARITY_SNAPSHOT="https://node-snapshot.s3.eu-central-1.amazonaws.com/db.tar.gz"
OE_SNAPSHOT="https://node-snapshot-oe.s3.eu-central-1.amazonaws.com/db.tar.gz"
BOOTNODE_FILE_FUSE="https://raw.githubusercontent.com/fuseio/fuse-network/master/config/bootnodes.txt"
BOOTNODE_FILE_SPARK="https://raw.githubusercontent.com/fuseio/fuse-network/master/config/spark/bootnodes.txt"

SNAPSHOT_NODE="$OE_SNAPSHOT"

Expand Down Expand Up @@ -291,12 +293,6 @@ function parseArguments {
displayErrorAndExit "NODE_KEY is still set to default update it in the env file"
fi
fi

if [[ $ROLE == bootnode ]] ; then
if ! [[ "$BOOTNODES" ]] ; then
echo "Warning! trying to run a bootnode without BOOTNODES argument!"
fi
fi

if ! [ -z "$TESTNET" ] ; then
if [[ $TESTNET == true ]] ; then
Expand Down Expand Up @@ -581,6 +577,25 @@ function run {

# Create and start a new container.
echo -e "\nStarting as ${ROLE}..."

# Pull bootnodes
if [[ $TESTNET != true ]] ; then
wget -O bootnodeFile $BOOTNODE_FILE_FUSE
else
wget -O bootnodeFile $BOOTNODE_FILE_SPARK
fi

BOOTNODES=""

while IFS= read -r line
do
BOOTNODES+="${line},"
done < "bootnodeFile"

#remove the trailing comma
BOOTNODES=${BOOTNODES::-1}

echo "Bootnodes = $BOOTNODES"

case $ROLE in
"bootnode")
Expand Down Expand Up @@ -645,7 +660,7 @@ function run {
--restart=always \
$DOCKER_IMAGE_PARITY \
--role node \
--parity-args --no-warp --node-key $NODE_KEY --jsonrpc-threads $NUM_RPC_THREADS --jsonrpc-server-threads $NUM_HTTP_THREADS
--parity-args --no-warp --node-key $NODE_KEY --jsonrpc-threads $NUM_RPC_THREADS --jsonrpc-server-threads $NUM_HTTP_THREADS --bootnodes=$BOOTNODES
;;

"validator")
Expand Down Expand Up @@ -715,7 +730,7 @@ function run {
$DOCKER_IMAGE_PARITY \
--role validator \
--address $address \
--parity-args --no-warp
--parity-args --no-warp --bootnodes=$BOOTNODES

## Start validator-app container with all necessary arguments.
$PERMISSION_PREFIX docker run \
Expand Down Expand Up @@ -750,7 +765,7 @@ function run {
--restart=always \
$DOCKER_IMAGE_PARITY \
--role explorer \
--parity-args --node-key $NODE_KEY
--parity-args --node-key $NODE_KEY --bootnodes=$BOOTNODES
;;
esac

Expand Down

0 comments on commit caa3287

Please sign in to comment.