From 4015292bb72ae12be12752b3af2d9657959ffe20 Mon Sep 17 00:00:00 2001 From: "aleksandr.vodianov@demlabs.net" <aleksandr.vodianov@demlabs.net> Date: Tue, 30 Nov 2021 13:28:38 +0300 Subject: [PATCH] add kelvin testnet in create configs --- scripts.darwin/create_configs.sh | 4 ++++ scripts/create_configs_from_tpl.sh | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/scripts.darwin/create_configs.sh b/scripts.darwin/create_configs.sh index dc5abc427..b2be7b275 100755 --- a/scripts.darwin/create_configs.sh +++ b/scripts.darwin/create_configs.sh @@ -17,5 +17,9 @@ export DAP_SERVER_PORT=8089 export DAP_CORE_T_ENABLED=true export DAP_CORE_T_ROLE=full +# Kelvin testnet +export DAP_KELVIN_TESTNET_ENABLED=true +export DAP_KELVIN_TESTNET_ROLE=full + echo "Init configs with prefix " $DAP_PREFIX ../scripts/create_configs_from_tpl.sh diff --git a/scripts/create_configs_from_tpl.sh b/scripts/create_configs_from_tpl.sh index 76ccb571e..22504e57a 100755 --- a/scripts/create_configs_from_tpl.sh +++ b/scripts/create_configs_from_tpl.sh @@ -21,7 +21,9 @@ fi [ "$DAP_SERVER_PORT" ] || DAP_SERVER_PORT="8079" [ "$DAP_SERVER_ADDR" ] || DAP_SERVER_ADDR="0.0.0.0" [ "$DAP_CORE_T_ENABLED" ] || DAP_CORE_T_ENABLED="true" +[ "$DAP_KELVIN_TESTNET_ENABLED" ] || DAP_KELVIN_TESTNET_ENABLED="true" [ "$DAP_CORE_T_ROLE" ] || DAP_CORE_T_ROLE="full" +[ "$DAP_KELVIN_TESTNET_ROLE" ] || DAP_KELVIN_TESTNET_ROLE="full" DAP_CFG_TPL="$DAP_PREFIX/share/configs/$DAP_APP_NAME.cfg.tpl" @@ -66,3 +68,18 @@ if [ "$DAP_CORE_T_ENABLED"="true" ]; then rm $DAP_NET_CFG.old fi +NET_NAME="kelvin-testnet" +if [ "$DAP_KELVIN_TESTNET_ENABLED"="true" ]; then + DAP_CFG_NET="$DAP_PREFIX/etc/network/$NET_NAME.cfg" + DAP_CFG_NET_TPL="$DAP_PREFIX/share/configs/network/$NET_NAME.cfg.tpl" + DAP_NET_CFG="" + if [ -e "$DAP_CFG_NET" ]; then + DAP_NET_CFG="$DAP_PREFIX/etc/network/$NET_NAME.cfg.dpkg-new" + else + DAP_NET_CFG="$DAP_PREFIX/etc/network/$NET_NAME.cfg" + fi + + cat $DAP_CFG_NET_TPL > $DAP_NET_CFG || true + sed -i .old "s/{NODE_TYPE}/$DAP_KELVIN_TESTNET_ROLE/g" $DAP_NET_CFG || true + rm $DAP_NET_CFG.old +fi -- GitLab