Skip to content

Commit

Permalink
Merge pull request #1218 from pataegrillo/no_bootstrap_installation
Browse files Browse the repository at this point in the history
- NO_BOOTSTRAP option and selective bootstrap downloading
  • Loading branch information
jdogresorg authored Dec 6, 2022
2 parents 3d42b3e + 394cb9c commit 2d4466e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ WORKDIR /
EXPOSE 4000 14000

# NOTE: Defaults to running on mainnet, specify -e TESTNET=1 to start up on testnet
ENTRYPOINT ["start.sh"]
ENTRYPOINT start.sh ${BTC_NETWORK} ${NO_BOOTSTRAP}
20 changes: 11 additions & 9 deletions docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ fi

# Bootstrap if the database does not exist (do this here to handle cases
# where a volume is mounted over the share dir, like the fednode docker compose config does...)
if [ ! -f /root/.local/share/counterparty/counterparty.db ]; then
echo "Downloading mainnet bootstrap DB..."
counterparty-server bootstrap --quiet
PARAMS='--checkdb'
fi
if [ ! -f /root/.local/share/counterparty/counterparty.testnet.db ]; then
echo "Downloading testnet bootstrap DB..."
counterparty-server --testnet bootstrap --quiet
PARAMS='--checkdb'
if ([ -z "$2" ] || [ $2 != "true" ]); then
if [ ! -f /root/.local/share/counterparty/counterparty.db ] && [ $1 = "mainnet" ]; then
echo "Downloading mainnet bootstrap DB..."
counterparty-server bootstrap --quiet
PARAMS="${PARAMS} --checkdb"
fi
if [ ! -f /root/.local/share/counterparty/counterparty.testnet.db ] && [ $1 = "testnet" ]; then
echo "Downloading testnet bootstrap DB..."
counterparty-server --testnet bootstrap --quiet
PARAMS="${PARAMS} --checkdb"
fi
fi

# Kick off the server, defaulting to the "start" subcommand
Expand Down

0 comments on commit 2d4466e

Please sign in to comment.