Skip to content

Commit

Permalink
Merge pull request #14 from multiversx/devnet-2
Browse files Browse the repository at this point in the history
Introduce genesis mode (for denvet 2)
  • Loading branch information
andreibancioiu authored Sep 6, 2023
2 parents 6d63baa + 3730ba5 commit 828337b
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,28 @@ downloadNonPrunedEpochs() {

# For Node (observer), perform additional steps
if [[ ${PROGRAM} == "node" ]]; then
downloadDataIfNecessary || exit 1

# Check existence of /data/db
if [ ! -d "/data/db" ]; then
echo "Error: make sure the directory /data/db exists." 1>&2
exit 1
fi

DATABASE_SIZE=$(du -sb /data/db | cut -f1)

# Check size of /data/db (check against a trivial size)
if [[ $DATABASE_SIZE -lt 1048576 ]]; then
echo "Error: make sure the directory /data/db contains a (recent) blockchain archive." 1>&2
exit 1
if [[ "${IS_GENESIS}" = true ]]; then
# Check non-existence of /data/db
if [ -d "/data/db" ]; then
echo "Error: since IS_GENESIS is set, make sure the directory /data/db does not exist." 1>&2
exit 1
fi
else
downloadDataIfNecessary || exit 1

# Check existence of /data/db
if [ ! -d "/data/db" ]; then
echo "Error: make sure the directory /data/db exists." 1>&2
exit 1
fi

DATABASE_SIZE=$(du -sb /data/db | cut -f1)

# Check size of /data/db (check against a trivial size)
if [[ $DATABASE_SIZE -lt 40960 ]]; then
echo "Error: make sure the directory /data/db contains a (recent) blockchain archive." 1>&2
exit 1
fi
fi
fi

Expand Down

0 comments on commit 828337b

Please sign in to comment.