Created
May 22, 2021 08:32
-
-
Save dashameter/2c0f714573755429f411122ecd083697 to your computer and use it in GitHub Desktop.
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
COLLATERAL_KEY=cRnaL9PdSnwmSCVdwHRXH362eSjxyHc6ePvkFsU12wRgK6jahSTk | |
COLLATERAL_ADDRESS=yMF5Mfrdsx4u7gHPmH8v5UmQBNJ6dygMcX | |
FAUCET_PRIVATE_KEY=cRhCaxzGmkJHDeQwwn71cLfmq1ssM8yNaCy3Dzx6xnu8RLrLCMvy | |
FAUCET_ADDRESS=yTFraC61Q2xrhywxp2ePZt4egtF8xSKm4M | |
MINING_INTERVAL_IN_SECONDS=1 | |
NODE_COUNT=3 | |
DAPI_REPO_PATH=/Users/anton/dash/dapi | |
DRIVE_REPO_PATH=/Users/samuelw/Documents/src/js-drive | |
TENDERDASH_IMAGE=local-tenderdash | |
BUILD_DAPI_BEFORE_SETUP=false | |
BUILD_DAPI_AFTER_SETUP=false | |
BUILD_DRIVE=true | |
BUILD_TENDERDASH=true | |
DEBUG_SETUP=false | |
CONFIG_NAME="local" | |
# Create new data and configs | |
# ./bin/mn config:group local | |
# Remove old data and configs | |
# ./bin/mn group:stop --group=local | |
# ./bin/mn stop --config=local_seed | |
# ./bin/mn group:reset -h --verbose --group=local | |
echo "Removing all docker containers and volumes..." | |
docker rm -f -v $(docker ps -a -q); docker volume prune -f; rm -rf ~/.dashmate/ | |
# ./bin/dashmate reset --config=local_seed --verbose | |
if [ $BUILD_DRIVE == true ] | |
then | |
echo "Setting drive build directory" | |
./bin/dashmate config:set --config=${CONFIG_NAME} platform.drive.abci.docker.build.path $DRIVE_REPO_PATH | |
fi | |
if [ $BUILD_DAPI_BEFORE_SETUP == true ] | |
then | |
echo "Setting dapi build directory before the setup" | |
./bin/dashmate config:set --config=${CONFIG_NAME} platform.dapi.api.docker.build.path $DAPI_REPO_PATH | |
fi | |
echo "Setting core debug true" | |
./bin/dashmate config:set --config=${CONFIG_NAME} core.debug 1 | |
echo "Setup" | |
if [ $DEBUG_SETUP == true ] | |
then | |
DEBUG=\* ./bin/dashmate setup local -v --node-count=${NODE_COUNT} | |
else | |
./bin/dashmate setup local -v --node-count=${NODE_COUNT} | |
fi | |
echo "Setting development environment" | |
./bin/dashmate config:set --config=${CONFIG_NAME} environment development | |
echo "Setting log levels to trace" | |
./bin/dashmate config:set --config=${CONFIG_NAME} platform.drive.abci.log.stdout.level trace | |
echo "Setting tenderdash image" | |
if [ $BUILD_TENDERDASH == true ] | |
then | |
echo "Setting dapi build directory before the setup" | |
./bin/dashmate config:set --config=${CONFIG_NAME} platform.drive.tenderdash.docker.image $TENDERDASH_IMAGE | |
fi | |
# Set up a miner for tests | |
echo "Enabling miner in config with an interval of ${MINING_INTERVAL_IN_SECONDS} seconds" | |
./bin/dashmate config:set --config=${CONFIG_NAME}_seed core.miner.enable true | |
./bin/dashmate config:set --config=${CONFIG_NAME}_seed core.miner.interval "${MINING_INTERVAL_IN_SECONDS}s" | |
for (( i=1; i<=NODE_COUNT; i++ )) | |
do | |
./bin/dashmate config:set --config=${CONFIG_NAME}_$i core.miner.interval "${MINING_INTERVAL_IN_SECONDS}s" | |
done | |
./bin/dashmate config:set --config=${CONFIG_NAME}_seed core.miner.address $FAUCET_ADDRESS | |
echo "Sending 1000 tDash to the ${FAUCET_ADDRESS} for tests" | |
./bin/dashmate wallet:mint 1000 --config=${CONFIG_NAME}_1 --address=${FAUCET_ADDRESS} | |
if [ $BUILD_DAPI_AFTER_SETUP == true ] | |
then | |
echo "Setting dapi build directory after the setup" | |
for (( i=1; i<=NODE_COUNT; i++ )) | |
do | |
./bin/dashmate config:set --config=${CONFIG_NAME}_$i platform.dapi.api.docker.build.path $DAPI_REPO_PATH | |
done | |
fi | |
# Uncomment the next line if you want to keep platform running after the reset | |
#./bin/dashmate group:start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment