Skip to content

Commit

Permalink
Be stricter about the bootstrap ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
winder committed Jul 5, 2023
1 parent 93aeac9 commit cbe25a5
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions docker/files/run/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,24 +148,23 @@ function start_new_public_network() {
exit 1
fi


cp /node/run/config.json.example config.json

configure_data_dir

local ID
case $NETWORK in
mainnet) ID="<network>.algorand.network" ;;
testnet) ID="<network>.algorand.network" ;;
betanet) ID="<network>.algodev.network" ;;
alphanet) ID="<network>.algodev.network" ;;
devnet) ID="<network>.algodev.network" ;;
*)
echo "Unknown network, not setting bootstrap ID"
;;
esac

if [ "$ID" != "" ]; then
# if the peer address is set, it will be used instead of the DNS bootstrap ID
if [ "$PEER_ADDRESS" != "" ]; then
local ID
case $NETWORK in
mainnet) ID="<network>.algorand.network" ;;
testnet) ID="<network>.algorand.network" ;;
betanet) ID="<network>.algodev.network" ;;
alphanet) ID="<network>.algodev.network" ;;
devnet) ID="<network>.algodev.network" ;;
*)
echo "Unknown network."
exit 1
;;
esac

set -p DNSBootstrapID -v "$ID"
fi

Expand Down Expand Up @@ -227,7 +226,7 @@ elif [ -f "$ALGORAND_DATA/genesis.json" ]; then
fi

# Initialize and start network.
if [ "$NETWORK" == "" ]; then
if [ "$NETWORK" == "" ] && [ "$PEER_ADDRESS" == "" ]; then
start_new_private_network
else
start_new_public_network
Expand Down

0 comments on commit cbe25a5

Please sign in to comment.