-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add startup scripts for different environments
- Loading branch information
Showing
7 changed files
with
174 additions
and
259 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [ "$DEBUG" = "1" ]; then | ||
set -x | ||
fi | ||
|
||
if [ "$ALGORAND_DATA" != "/algod/data" ]; then | ||
echo "Do not override 'ALGORAND_DATA' environment variable." | ||
exit 1 | ||
fi | ||
# To allow mounting the data directory we need to change permissions | ||
# to our algorand user. The script is initially run as the root user | ||
# in order to change permissions, afterwards the script is re-launched | ||
# as the algorand user. | ||
if [ "$(id -u)" = '0' ]; then | ||
chown -R algorand:algorand $ALGORAND_DATA | ||
exec su -p -c "$(readlink -f $0) $@" algorand | ||
fi | ||
|
||
/node/run/start_empty.sh & | ||
/node/run/start_fast_catchup.sh & | ||
/node/run/start_dev.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [ "$DEBUG" = "1" ]; then | ||
set -x | ||
fi | ||
|
||
if [ "$ALGORAND_DATA" != "/algod/data" ]; then | ||
echo "Do not override 'ALGORAND_DATA' environment variable." | ||
exit 1 | ||
fi | ||
|
||
# To allow mounting the data directory we need to change permissions | ||
# to our algorand user. The script is initially run as the root user | ||
# in order to change permissions, afterwards the script is re-launched | ||
# as the algorand user. | ||
if [ "$(id -u)" = '0' ]; then | ||
chown -R algorand:algorand "$ALGORAND_DATA" | ||
exec su -p -c "$(readlink -f $0) $@" algorand | ||
fi | ||
|
||
|
||
# Configure the participation node | ||
if [ -d "$ALGORAND_DATA" ]; then | ||
if [ "$TOKEN" != "" ]; then | ||
echo "$TOKEN" > "$ALGORAND_DATA/algod.token" | ||
fi | ||
if [ "$ADMIN_TOKEN" != "" ]; then | ||
echo "$ADMIN_TOKEN" > "$ALGORAND_DATA/algod.admin.token" | ||
fi | ||
cd "$ALGORAND_DATA" | ||
cp "/node/run/genesis/testnet/genesis.json" genesis.json | ||
algocfg profile set --yes -d "$ALGORAND_DATA" "participation" | ||
algod -o -d $ALGORAND_DATA -l "0.0.0.0:8080" | ||
else | ||
echo "$ALGORAND_DATA" does not exist | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [ "$DEBUG" = "1" ]; then | ||
set -x | ||
fi | ||
|
||
if [ "$ALGORAND_DATA" != "/algod/data" ]; then | ||
echo "Do not override 'ALGORAND_DATA' environment variable." | ||
exit 1 | ||
fi | ||
|
||
EMPTY_DATA=/algod/empty | ||
|
||
# To allow mounting the data directory we need to change permissions | ||
# to our algorand user. The script is initially run as the root user | ||
# in order to change permissions, afterwards the script is re-launched | ||
# as the algorand user. | ||
if [ "$(id -u)" = '0' ]; then | ||
chown -R algorand:algorand $EMPTY_DATA | ||
exec su -p -c "$(readlink -f $0) $@" algorand | ||
fi | ||
|
||
|
||
# Configure the participation node | ||
if [ -d "$EMPTY_DATA" ]; then | ||
if [ "$TOKEN" != "" ]; then | ||
echo "$TOKEN" > "$EMPTY_DATA/algod.token" | ||
fi | ||
if [ "$ADMIN_TOKEN" != "" ]; then | ||
echo "$ADMIN_TOKEN" > "$EMPTY_DATA/algod.admin.token" | ||
fi | ||
cd $EMPTY_DATA | ||
cp "/node/run/genesis/testnet/genesis.json" genesis.json | ||
algocfg profile set --yes -d "$EMPTY_DATA" "participation" | ||
algod -o -d $EMPTY_DATA -l "0.0.0.0:8082" | ||
else | ||
echo $EMPTY_DATA does not exist | ||
exit 1 | ||
fi |
Oops, something went wrong.