diff --git a/TestTestNet/bootnode/install.sh b/TestTestNet/bootnode/install.sh index 6846893..861387e 100644 --- a/TestTestNet/bootnode/install.sh +++ b/TestTestNet/bootnode/install.sh @@ -24,13 +24,9 @@ echo "===== external ip: ${EXT_IP}" echo "===== environmental variables:" printenv -INSTALL_CONFIG_REPO="https://raw.githubusercontent.com/oraclesorg/test-templates/${TEMPLATES_BRANCH}/TestTestNet/bootnode" -GENESIS_REPO_LOC="https://raw.githubusercontent.com/oraclesorg/oracles-scripts/${SCRIPTS_BRANCH}/spec.json" -GENESIS_JSON="spec.json" -NODE_TOML="node.toml" -BOOTNODES_TXT="https://raw.githubusercontent.com/oraclesorg/test-templates/${TEMPLATES_BRANCH}/TestTestNet/bootnodes.txt" NGINX_FILE_LOC="https://raw.githubusercontent.com/oraclesorg/test-templates/${TEMPLATES_BRANCH}/TestTestNet/bootnode/nginx.default.site" +INSTALL_CONFIG_REPO="https://raw.githubusercontent.com/oraclesorg/test-templates/${TEMPLATES_BRANCH}/TestTestNet/bootnode" echo "===== repo base path: ${INSTALL_CONFIG_REPO}" # this should be provided through env by azure template @@ -63,7 +59,7 @@ pull_image_and_configs() { # curl -s -O "${INSTALL_CONFIG_REPO}/../${GENESIS_JSON}" curl -s -o "${GENESIS_JSON}" "${GENESIS_REPO_LOC}" curl -s -o "bootnodes.txt" "${BOOTNODES_TXT}" - curl -s -O "${INSTALL_CONFIG_REPO}/${NODE_TOML}" + curl -s -O "${INSTALL_CONFIG_REPO}/node.toml" sed -i "/\[network\]/a nat=\"extip:${EXT_IP}\"" ${NODE_TOML} #sed -i "/\[network\]/a bootnodes=\[$(cat bootnodes.txt | sed 's/\r$//' | awk -F'#' '{ print $1 }' | awk '/enode/{ print "\""$1"\"" }' | paste -sd "," -)\]" ${NODE_TOML} sed -i "/\[network\]/a reserved_peers=\"/home/${ADMIN_USERNAME}/bootnodes.txt\"" ${NODE_TOML} diff --git a/TestTestNet/common.funcs b/TestTestNet/common.funcs index 34f6d90..87ae9d5 100644 --- a/TestTestNet/common.funcs +++ b/TestTestNet/common.funcs @@ -153,7 +153,7 @@ After=network.target User=${ADMIN_USERNAME} Group=${ADMIN_USERNAME} WorkingDirectory=/home/${ADMIN_USERNAME} -ExecStart=/usr/bin/parity --config=node.toml +ExecStart=/usr/bin/parity --config=${NODE_TOML} Restart=always [Install] WantedBy=multi-user.target @@ -178,7 +178,7 @@ After=network.target User=${ADMIN_USERNAME} Group=${ADMIN_USERNAME} WorkingDirectory=/home/${ADMIN_USERNAME} -ExecStart=/home/${ADMIN_USERNAME}/parity --config=node.toml +ExecStart=/home/${ADMIN_USERNAME}/parity --config=${NODE_TOML} Restart=always [Install] WantedBy=multi-user.target diff --git a/TestTestNet/common.vars b/TestTestNet/common.vars index 4e766e7..a8a16cf 100644 --- a/TestTestNet/common.vars +++ b/TestTestNet/common.vars @@ -10,3 +10,11 @@ PARITY_BIN_LOC="https://transfer.sh/PhhDc/parity" PARITY_DEB_LOC="https://parity-downloads-mirror.parity.io/v1.8.1/x86_64-unknown-linux-gnu/parity_1.8.1_amd64.deb" NODE_SOURCE_DEB="https://deb.nodesource.com/setup_6.x" + +##### +GENESIS_REPO_LOC="https://raw.githubusercontent.com/oraclesorg/oracles-scripts/${SCRIPTS_BRANCH}/spec.json" +GENESIS_JSON="spec.json" +NODE_TOML="node.toml" +NODE_PWD="node.pwd" +BOOTNODES_TXT="https://raw.githubusercontent.com/oraclesorg/test-templates/${TEMPLATES_BRANCH}/TestTestNet/bootnodes.txt" +NGINX_FILE_LOC="https://raw.githubusercontent.com/oraclesorg/test-templates/${TEMPLATES_BRANCH}/TestTestNet/bootnode/nginx.default.site" diff --git a/TestTestNet/mining-node/install.sh b/TestTestNet/mining-node/install.sh index 835f312..17562cc 100644 --- a/TestTestNet/mining-node/install.sh +++ b/TestTestNet/mining-node/install.sh @@ -24,14 +24,7 @@ echo "===== external ip: ${EXT_IP}" echo "===== environmental variables:" printenv -# script parameters INSTALL_CONFIG_REPO="https://raw.githubusercontent.com/oraclesorg/test-templates/${TEMPLATES_BRANCH}/TestTestNet/mining-node" -GENESIS_REPO_LOC="https://raw.githubusercontent.com/oraclesorg/oracles-scripts/${SCRIPTS_BRANCH}/spec.json" -GENESIS_JSON="spec.json" -NODE_TOML="node.toml" -NODE_PWD="node.pwd" -BOOTNODES_TXT="https://raw.githubusercontent.com/oraclesorg/test-templates/${TEMPLATES_BRANCH}/TestTestNet/bootnodes.txt" - echo "===== repo base path: ${INSTALL_CONFIG_REPO}" # this should be provided through env by azure template @@ -81,7 +74,7 @@ pull_image_and_configs() { # curl -s -O "${INSTALL_CONFIG_REPO}/../${GENESIS_JSON}" curl -s -o "${GENESIS_JSON}" "${GENESIS_REPO_LOC}" - curl -s -O "${INSTALL_CONFIG_REPO}/${NODE_TOML}" + curl -s -O "${INSTALL_CONFIG_REPO}/node.toml" curl -s -o "bootnodes.txt" "${BOOTNODES_TXT}" sed -i "/\[network\]/a nat=\"extip:${EXT_IP}\"" ${NODE_TOML} #sed -i "/\[network\]/a bootnodes=\[$(cat bootnodes.txt | sed 's/\r$//' | awk -F'#' '{ print $1 }' | awk '/enode/{ print "\""$1"\"" }' | paste -sd "," -)\]" ${NODE_TOML} @@ -106,7 +99,7 @@ EOF install_scripts() { echo "=====> install_scripts" git clone -b ${SCRIPTS_BRANCH} --single-branch https://github.com/oraclesorg/oracles-scripts - ln -s ../node.toml oracles-scripts/node.toml + ln -s ../${NODE_TOML} oracles-scripts/node.toml cd oracles-scripts/scripts npm install sudo bash -c "cat > /etc/cron.hourly/transferRewardToPayoutKey < pull_image_and_configs" # curl -s -O "${INSTALL_CONFIG_REPO}/../${GENESIS_JSON}" curl -s -o "${GENESIS_JSON}" "${GENESIS_REPO_LOC}" - curl -s -O "${INSTALL_CONFIG_REPO}/${NODE_TOML}" + curl -s -O "${INSTALL_CONFIG_REPO}/node.toml" curl -s -o "bootnodes.txt" "${BOOTNODES_TXT}" sed -i "/\[network\]/a nat=\"extip:${EXT_IP}\"" ${NODE_TOML} #sed -i "/\[network\]/a bootnodes=\[$(cat bootnodes.txt | sed 's/\r$//' | awk -F'#' '{ print $1 }' | awk '/enode/{ print "\""$1"\"" }' | paste -sd "," -)\]" ${NODE_TOML} diff --git a/TestTestNet/owner/install.sh b/TestTestNet/owner/install.sh index 6f1e053..7d33a80 100644 --- a/TestTestNet/owner/install.sh +++ b/TestTestNet/owner/install.sh @@ -18,16 +18,13 @@ echo "===== downloading common.vars" curl -sLO "https://raw.githubusercontent.com/oraclesorg/test-templates/${TEMPLATES_BRANCH}/common.vars" source common.vars +EXT_IP="$(curl ifconfig.co)" +echo "===== external ip: ${EXT_IP}" + echo "===== environmental variables:" printenv INSTALL_CONFIG_REPO="https://raw.githubusercontent.com/oraclesorg/test-templates/${TEMPLATES_BRANCH}/TestTestNet/owner" -GENESIS_REPO_LOC="https://raw.githubusercontent.com/oraclesorg/oracles-scripts/${SCRIPTS_BRANCH}/spec.json" -GENESIS_JSON="spec.json" -NODE_TOML="node.toml" -NODE_PWD="node.pwd" -BOOTNODES_TXT="https://raw.githubusercontent.com/oraclesorg/test-templates/${TEMPLATES_BRANCH}/TestTestNet/bootnodes.txt" - echo "===== repo base path: ${INSTALL_CONFIG_REPO}" # this should be provided through env by azure template @@ -60,7 +57,7 @@ pull_image_and_configs() { echo "=====> pull_image_and_configs" # curl -s -O "${INSTALL_CONFIG_REPO}/../${GENESIS_JSON}" curl -s -o "${GENESIS_JSON}" "${GENESIS_REPO_LOC}" - curl -s -O "${INSTALL_CONFIG_REPO}/${NODE_TOML}" + curl -s -O "${INSTALL_CONFIG_REPO}/node.toml" curl -s -o "bootnodes.txt" "${BOOTNODES_TXT}" sed -i "/\[network\]/a nat=\"extip:${EXT_IP}\"" ${NODE_TOML} #sed -i "/\[network\]/a bootnodes=\[$(cat bootnodes.txt | sed 's/\r$//' | awk -F'#' '{ print $1 }' | awk '/enode/{ print "\""$1"\"" }' | paste -sd "," -)\]" ${NODE_TOML}