Skip to content

Commit ea21f69

Browse files
authored
Merge pull request #3 from bugout-dev/polygon-connections
Added polygon node IP extraction from internal Route53
2 parents fe1b6ba + f0c8d47 commit ea21f69

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

scripts/nodes-connections.bash

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,23 @@ fi
6363
verbose "${PREFIX_INFO} Source environment variables"
6464
. ${file_flag}
6565

66-
verbose "${PREFIX_INFO} Retrieving Ethereum node address and port"
66+
verbose "${PREFIX_INFO} Retrieving Ethereum node address"
6767
RETRIEVED_NODE_ETHEREUM_IPC_ADDR=$(aws route53 list-resource-record-sets --hosted-zone-id "${MOONSTREAM_INTERNAL_HOSTED_ZONE_ID}" --query "ResourceRecordSets[?Name == '${MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI}.'].ResourceRecords[].Value" | jq -r .[0])
68-
6968
if [ "$RETRIEVED_NODE_ETHEREUM_IPC_ADDR" == "null" ]; then
70-
verbose "${PREFIX_CRIT} Ethereum node address is null"
69+
verbose "${PREFIX_CRIT} Ethereum node internal DNS record address is null"
70+
exit 1
71+
fi
72+
73+
verbose "${PREFIX_INFO} Retrieving Polygon node address"
74+
RETRIEVED_NODE_POLYGON_IPC_ADDR=$(aws route53 list-resource-record-sets --hosted-zone-id "${MOONSTREAM_INTERNAL_HOSTED_ZONE_ID}" --query "ResourceRecordSets[?Name == '${MOONSTREAM_POLYGON_WEB3_PROVIDER_URI}.'].ResourceRecords[].Value" | jq -r .[0])
75+
if [ "$RETRIEVED_NODE_POLYGON_IPC_ADDR" == "null" ]; then
76+
verbose "${PREFIX_CRIT} Polygon node internal DNS record address is null"
7177
exit 1
7278
fi
7379

74-
verbose "${PREFIX_INFO} Updating MOONSTREAM_NODE_ETHEREUM_IPC_ADDR"
7580
# TODO(kompotkot): Modify regexp to work with export prefix
81+
verbose "${PREFIX_INFO} Updating MOONSTREAM_NODE_ETHEREUM_IPC_ADDR with ${RETRIEVED_NODE_ETHEREUM_IPC_ADDR}"
7682
sed -i "s|^MOONSTREAM_NODE_ETHEREUM_IPC_ADDR=.*|MOONSTREAM_NODE_ETHEREUM_IPC_ADDR=\"$RETRIEVED_NODE_ETHEREUM_IPC_ADDR\"|" ${file_flag}
7783

84+
verbose "${PREFIX_INFO} Updating MOONSTREAM_NODE_POLYGON_IPC_ADDR with ${RETRIEVED_NODE_POLYGON_IPC_ADDR}"
85+
sed -i "s|^MOONSTREAM_NODE_POLYGON_IPC_ADDR=.*|MOONSTREAM_NODE_POLYGON_IPC_ADDR=\"$RETRIEVED_NODE_POLYGON_IPC_ADDR\"|" ${file_flag}

0 commit comments

Comments
 (0)