-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fixing typo and environment variables (#61)
Signed-off-by: Simon Paitrault <[email protected]>
- Loading branch information
Showing
15 changed files
with
165 additions
and
40 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
export PRIVATE_KEY=0xd7e2e00b43c12cf17239d4755ed744df6ca70a933fc7c8bbb7da1342a5ff2e38 | ||
export TOKEN_DEPLOYER_SALT=m1Ln9uF9MGZ2PcR | ||
export TOPOS_CORE_SALT=dCyN8VZz5sXgqMO | ||
export TOPOS_CORE_PROXY_SALT=aRV8Mp9o4xRpLbF | ||
export ERC20_MESSAGING_SALT=ho37cJbGkgI6vnp | ||
export SUBNET_REGISTRATOR_SALT=azsRlXyGu0ty291 | ||
export AUTH0_CLIENT_ID=xVF6EuPDaazQchfjFpGAdcJUpHk2W5I2 | ||
export AUTH0_CLIENT_SECRET=-CrwnrgSx1EaP_oaKAFXFdqrIvA4WK8Pcpd5xC4o3ZfYB4H4V4FPHfEbqpu4KZN8 | ||
PRIVATE_KEY=0xd7e2e00b43c12cf17239d4755ed744df6ca70a933fc7c8bbb7da1342a5ff2e38 | ||
TOKEN_DEPLOYER_SALT=m1Ln9uF9MGZ2PcR | ||
TOPOS_CORE_SALT=dCyN8VZz5sXgqMO | ||
TOPOS_CORE_PROXY_SALT=aRV8Mp9o4xRpLbF | ||
ERC20_MESSAGING_SALT=ho37cJbGkgI6vnp | ||
SUBNET_REGISTRATOR_SALT=azsRlXyGu0ty291 | ||
AUTH0_CLIENT_ID=xVF6EuPDaazQchfjFpGAdcJUpHk2W5I2 | ||
AUTH0_CLIENT_SECRET=-CrwnrgSx1EaP_oaKAFXFdqrIvA4WK8Pcpd5xC4o3ZfYB4H4V4FPHfEbqpu4KZN8 |
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
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,57 @@ | ||
#!/bin/bash | ||
|
||
# This script is used to initialize a sequencer node in local-ERC20 tests | ||
# It replaces the default topos command by this script manipulating resources | ||
# and updating configurations. | ||
# | ||
# What it does: | ||
# 1. Install net-tools package to use netstat command in the healthcheck | ||
# 2. Copy consensus and libp2p directories from $DATA_FOLDER to $CONFIG_FOLDER | ||
# 3. Copy genesis.json from $GENESIS_FOLDER to $SUBNET_FOLDER | ||
# 4. Start the sequencer node using topos node up command | ||
|
||
set -e | ||
|
||
if [[ -z "${SUBNET}" ]]; then | ||
echo "SUBNET is not set" | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "${CONFIG_FOLDER}" ]]; then | ||
echo "CONFIG_FOLDER is not set" | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "${DATA_FOLDER}" ]]; then | ||
echo "DATA_FOLDER is not set" | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "${GENESIS_FOLDER}" ]]; then | ||
echo "GENESIS_FOLDER is not set" | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "${SUBNET_FOLDER}" ]]; then | ||
echo "SUBNET_FOLDER is not set" | ||
exit 1 | ||
fi | ||
|
||
apt-get update | ||
apt-get install -y net-tools | ||
source /contracts/.env | ||
|
||
mkdir -p $CONFIG_FOLDER/node/sequencer-$SUBNET/consensus -p $CONFIG_FOLDER/node/sequencer-$SUBNET/libp2p -p $SUBNET_FOLDER | ||
|
||
cp -vr $DATA_FOLDER/consensus $CONFIG_FOLDER/node/sequencer-$SUBNET/ | ||
cp -vr $DATA_FOLDER/libp2p $CONFIG_FOLDER/node/sequencer-$SUBNET/ | ||
cp -vr $GENESIS_FOLDER/genesis.json $SUBNET_FOLDER/genesis.json | ||
|
||
cp -f $CONFIG_FOLDER/node/sequencer-$SUBNET/config.toml $CONFIG_FOLDER/node/sequencer-$SUBNET/config.toml.new | ||
sed -i -e '/subnet-contract-address =/ s/= .*/= "'$TOPOS_CORE_PROXY_CONTRACT_ADDRESS'"/' $CONFIG_FOLDER/node/sequencer-$SUBNET/config.toml.new | ||
cp -f $CONFIG_FOLDER/node/sequencer-$SUBNET/config.toml.new $CONFIG_FOLDER/node/sequencer-$SUBNET/config.toml | ||
|
||
echo "Topos Core contract address: $TOPOS_CORE_PROXY_CONTRACT_ADDRESS, set manually in config" | ||
|
||
topos node up --name sequencer-$SUBNET --home $CONFIG_FOLDER --no-edge-process | ||
|
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
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
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
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,27 @@ | ||
#!/bin/bash | ||
|
||
# This script is used to set up the environment variables for the local test environment | ||
# It reads the .env and .env.secrets files and sets the environment variables accordingly | ||
# If the first argument is "unset", it will unset the environment variables instead of setting them | ||
|
||
if test -f .env; then | ||
if [ "$1" = "unset" ]; then | ||
echo "Unsetting local test environment based on .env file" | ||
unset $(grep -v '^#' .env | sed -E 's/(.*)=.*/\1/' | xargs) | ||
else | ||
echo "Setting up local test environment based on .env file" | ||
export $(grep -v '^#' .env | xargs) | ||
fi | ||
else | ||
echo ".env file doesn't exists, this command do nothing" | ||
fi | ||
|
||
if test -f .env.secrets; then | ||
if [ "$1" = "unset" ]; then | ||
echo "Unsetting local test environment based on .env.secrets file" | ||
unset $(grep -v '^#' .env.secrets | sed -E 's/(.*)=.*/\1/' | xargs) | ||
else | ||
echo "Setting up local test environment based on .env.secrets file" | ||
export $(grep -v '^#' .env.secrets | xargs) | ||
fi | ||
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 |
---|---|---|
@@ -1,21 +1,27 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [[ -z "${LOCAL_ERC20_HOME}" ]]; then | ||
echo "You need to setup the environment first. For local tests: source ./tests/environment.sh" | ||
exit 1 | ||
fi | ||
|
||
source $LOCAL_ERC20_HOME/tests/utils.sh | ||
|
||
if [ $1 = 'start' ]; then | ||
if [ "$1" = 'start' ]; then | ||
start_network | ||
exit $? | ||
elif [ $1 = 'stop' ]; then | ||
elif [ "$1" = 'stop' ]; then | ||
stop_network | ||
exit $? | ||
elif [ $1 = 'check' ]; then | ||
elif [ "$1" = 'check' ]; then | ||
check_network_health | ||
exit $? | ||
elif [ $1 = 'is_running' ]; then | ||
elif [ "$1" = 'is_running' ]; then | ||
is_network_running | ||
exit $? | ||
else | ||
echo "Invalid argument" | ||
echo "Usage: network.sh [start|stop|check|is_running]" | ||
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
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
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
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
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
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