diff --git a/scripts.darwin/create_configs.sh b/scripts.darwin/create_configs.sh index dc5abc427053552c355cbb8851670ee2fbc41d59..b2be7b275b9aa6ef2d8ac2780658364c287ad1fc 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 76ccb571e8aa3b5923d303f27b1c597466345937..22504e57ade2de4e3e1fb67fa4356889d7c76f5a 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