Refactor some more vars
This commit is contained in:
parent
f5ad993201
commit
8272111183
|
@ -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}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 <<EOF
|
||||
|
|
|
@ -18,16 +18,15 @@ 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/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"
|
||||
NETSTATS_SERVER="localhost"
|
||||
|
||||
INSTALL_CONFIG_REPO="https://raw.githubusercontent.com/oraclesorg/test-templates/${TEMPLATES_BRANCH}/TestTestNet/netstats-server"
|
||||
echo "===== repo base path: ${INSTALL_CONFIG_REPO}"
|
||||
|
||||
# this should be provided through env by azure template
|
||||
|
@ -58,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}
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue