Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v1.4.0 #1295

Merged
merged 56 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
0967f1f
Merge pull request #1280 from ainblockchain/release/v1.3.1
platfowner Jul 2, 2024
2a4daf1
Upgrade ain-util package version to v1.2.0
platfowner Jul 5, 2024
92f3b4e
Add some nonce examples in comments
platfowner Jul 5, 2024
4d9e070
Upgrade ain-util package to v1.2.1
platfowner Jul 5, 2024
092ea07
Add a note for nonce value to sendTranferTx.js
platfowner Jul 5, 2024
d94624e
Merge pull request #1283 from ainblockchain/feature/platfowner/feature
platfowner Jul 5, 2024
a6b2fd9
Add deploy_blockchain_genesis_onprem.sh
platfowner Jul 23, 2024
299acb5
Rename: GCP_USER -> ONPREM_USER
platfowner Jul 25, 2024
df3e766
Tweak some variable names
platfowner Jul 26, 2024
3bbd6ca
Add file deploy part for onpremise
platfowner Jul 26, 2024
50a1add
Tweak filename: setup_blockchain_ubuntu_gcp.sh
platfowner Jul 26, 2024
01f5e81
Add setup_blockchain_ubuntu_onprem.sh
platfowner Jul 26, 2024
a69deef
Add ubuntu setup part for onpremise
platfowner Jul 26, 2024
f85aca9
Fix on-premise ubuntu setup
platfowner Jul 26, 2024
3f53f78
Add yarn install part for onpremise
platfowner Jul 26, 2024
bc3959d
Add process kill part for onpremise
platfowner Jul 26, 2024
240aa80
Add start job part for onpremise
platfowner Jul 26, 2024
a154436
Fix sudo blocking issue in ubuntu setup
platfowner Jul 26, 2024
9ac388f
Add start_node_genesis_onprem.sh
platfowner Jul 26, 2024
0d2c2cb
Use start_node_genesis_onprem.sh
platfowner Jul 26, 2024
61ae9f3
Fix start node part for onpremise
platfowner Jul 26, 2024
e69bab5
Check --setup option along with --no-keep-code option
platfowner Jul 26, 2024
f14baeb
Add -v option to ssh
platfowner Jul 29, 2024
a1a385e
Use ONPREM_USER
platfowner Jul 29, 2024
e3d8a8c
Merge pull request #1286 from ainblockchain/feature/platfowner/feature
platfowner Jul 29, 2024
3f9bfc6
Set HOSTING_ENV=comcom for on-premise node jobs
platfowner Jul 29, 2024
09ad606
Merge pull request #1287 from ainblockchain/bugfix/platfowner/bugfix
platfowner Jul 31, 2024
1c9876e
Fix sudo password issue of kill jobs command
platfowner Aug 1, 2024
56a12ce
Fix sudo password issue of removing old data command
platfowner Aug 1, 2024
a1b32b9
Tweak printing order
platfowner Aug 1, 2024
916bd41
Fix PEER_CANDIDATE_JSON_RPC_URL for genesis onprem deploy
platfowner Aug 1, 2024
a838291
Merge pull request #1288 from ainblockchain/bugfix/platfowner/bugfix
platfowner Aug 2, 2024
93ee5ad
Add p2p ip address whitelisting
platfowner Aug 5, 2024
62ac864
Merge pull request #1289 from ainblockchain/bugfix/platfowner/bugfix
platfowner Aug 5, 2024
61a8aa9
Add getEventHandlerStatus()
platfowner Aug 8, 2024
f3b4882
Update tests
platfowner Aug 8, 2024
81fef4f
Merge pull request #1291 from ainblockchain/bugfix/platfowner/bugfix
platfowner Aug 8, 2024
c5f7178
Reuse existing ip addresses in event handler
platfowner Aug 8, 2024
109292a
Include more in the event handler status
platfowner Aug 8, 2024
2b7b861
Fix broken tests
platfowner Aug 8, 2024
92615b5
Add EVENT_HANDLER_CHANNEL_IDLE_TIME_LIMIT_SECS node config parameter
platfowner Aug 8, 2024
e0e280a
Terminate websocket when there are errors in making connection
platfowner Aug 8, 2024
21f8d58
Add EVENT_HANDLER_CHANNEL_IDLE_CHECK_INTERVAL_MS node config param
platfowner Aug 8, 2024
0586942
Add event handler channel idle checking logic
platfowner Aug 8, 2024
3e28237
Add remoteUrl and idleTimeMs to channel info
platfowner Aug 8, 2024
30cd90b
Fix buildRemoteUrlFromSocket()
platfowner Aug 8, 2024
ade1d72
Use external ip address in the network info
platfowner Aug 8, 2024
36603c4
Merge pull request #1292 from ainblockchain/bugfix/platfowner/bugfix
platfowner Aug 9, 2024
942b884
Add channelLifeTimeMs and channelIdleTimeMs to channel status
platfowner Aug 9, 2024
b3fcce6
Apply life time check to event handler channels
platfowner Aug 9, 2024
3d8d103
Remove some dup code
platfowner Aug 9, 2024
edf0bdc
Merge pull request #1293 from ainblockchain/feature/platfowner/feature
platfowner Aug 9, 2024
3851e4e
Increase MAX_NUM_EVENT_CHANNELS and MAX_NUM_EVENT_FILTERS
platfowner Aug 9, 2024
2f3f954
Update tests
platfowner Aug 9, 2024
9a1fcfd
Merge pull request #1294 from ainblockchain/bugfix/platfowner/bugfix
platfowner Aug 9, 2024
fbc3226
Upgrade package version to v1.4.0
platfowner Aug 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ bash deploy_blockchain_incremental_gcp.sh [dev|staging|sandbox|exp|spring|summer
```
- Set up Ubuntu machine (if it's on a new VM)
```
bash setup_blockchain_ubuntu.sh
bash setup_blockchain_ubuntu_gcp.sh
```
- Start tracker server job
```
Expand Down Expand Up @@ -136,7 +136,7 @@ bash deploy_blockchain_incremental_gcp.sh [dev|staging|sandbox|exp|spring|summer
```
- Set up Ubuntu machine (if it's on a new VM)
```
bash setup_blockchain_ubuntu.sh
bash setup_blockchain_ubuntu_gcp.sh
```
- Start Node server job (set shard index to 0 if you're running a root chain node)
```
Expand Down
7 changes: 5 additions & 2 deletions blockchain-configs/afan-shard/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"ENABLE_REST_FUNCTION_CALL": false,
"ENABLE_STATUS_REPORT_TO_TRACKER": true,
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
"EVENT_HANDLER_CHANNEL_IDLE_CHECK_INTERVAL_MS": 10000,
"EVENT_HANDLER_CHANNEL_IDLE_TIME_LIMIT_SECS": 600,
"EVENT_HANDLER_CHANNEL_LIFE_TIME_LIMIT_SECS": 3600,
"EVENT_HANDLER_FILTER_DELETION_TIMEOUT_MS": 15000,
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
"EVENT_HANDLER_PORT": 5100,
Expand All @@ -43,8 +46,8 @@
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
"MAX_NUM_EVENT_CHANNELS": 10,
"MAX_NUM_EVENT_FILTERS": 20,
"MAX_NUM_EVENT_CHANNELS": 20,
"MAX_NUM_EVENT_FILTERS": 40,
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
"MAX_NUM_INBOUND_CONNECTION": 3,
"MAX_NUM_SNAPSHOTS": 10,
Expand Down
7 changes: 5 additions & 2 deletions blockchain-configs/base/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"ENABLE_REST_FUNCTION_CALL": false,
"ENABLE_STATUS_REPORT_TO_TRACKER": true,
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
"EVENT_HANDLER_CHANNEL_IDLE_CHECK_INTERVAL_MS": 10000,
"EVENT_HANDLER_CHANNEL_IDLE_TIME_LIMIT_SECS": 600,
"EVENT_HANDLER_CHANNEL_LIFE_TIME_LIMIT_SECS": 3600,
"EVENT_HANDLER_FILTER_DELETION_TIMEOUT_MS": 100000,
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
"EVENT_HANDLER_PORT": 5100,
Expand All @@ -43,8 +46,8 @@
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
"MAX_NUM_EVENT_CHANNELS": 10,
"MAX_NUM_EVENT_FILTERS": 20,
"MAX_NUM_EVENT_CHANNELS": 20,
"MAX_NUM_EVENT_FILTERS": 40,
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
Expand Down
7 changes: 5 additions & 2 deletions blockchain-configs/he-shard/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"ENABLE_REST_FUNCTION_CALL": false,
"ENABLE_STATUS_REPORT_TO_TRACKER": true,
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
"EVENT_HANDLER_CHANNEL_IDLE_CHECK_INTERVAL_MS": 10000,
"EVENT_HANDLER_CHANNEL_IDLE_TIME_LIMIT_SECS": 600,
"EVENT_HANDLER_CHANNEL_LIFE_TIME_LIMIT_SECS": 3600,
"EVENT_HANDLER_FILTER_DELETION_TIMEOUT_MS": 15000,
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
"EVENT_HANDLER_PORT": 5100,
Expand All @@ -43,8 +46,8 @@
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
"MAX_NUM_EVENT_CHANNELS": 10,
"MAX_NUM_EVENT_FILTERS": 20,
"MAX_NUM_EVENT_CHANNELS": 20,
"MAX_NUM_EVENT_FILTERS": 40,
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
Expand Down
7 changes: 5 additions & 2 deletions blockchain-configs/mainnet-prod/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"ENABLE_REST_FUNCTION_CALL": false,
"ENABLE_STATUS_REPORT_TO_TRACKER": true,
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
"EVENT_HANDLER_CHANNEL_IDLE_CHECK_INTERVAL_MS": 10000,
"EVENT_HANDLER_CHANNEL_IDLE_TIME_LIMIT_SECS": 600,
"EVENT_HANDLER_CHANNEL_LIFE_TIME_LIMIT_SECS": 3600,
"EVENT_HANDLER_FILTER_DELETION_TIMEOUT_MS": 100000,
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
"EVENT_HANDLER_PORT": 5100,
Expand All @@ -42,8 +45,8 @@
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
"MAX_NUM_EVENT_CHANNELS": 10,
"MAX_NUM_EVENT_FILTERS": 20,
"MAX_NUM_EVENT_CHANNELS": 20,
"MAX_NUM_EVENT_FILTERS": 40,
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
Expand Down
7 changes: 5 additions & 2 deletions blockchain-configs/sim-shard/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"ENABLE_REST_FUNCTION_CALL": false,
"ENABLE_STATUS_REPORT_TO_TRACKER": true,
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
"EVENT_HANDLER_CHANNEL_IDLE_CHECK_INTERVAL_MS": 10000,
"EVENT_HANDLER_CHANNEL_IDLE_TIME_LIMIT_SECS": 600,
"EVENT_HANDLER_CHANNEL_LIFE_TIME_LIMIT_SECS": 3600,
"EVENT_HANDLER_FILTER_DELETION_TIMEOUT_MS": 100000,
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
"EVENT_HANDLER_PORT": 5100,
Expand All @@ -43,8 +46,8 @@
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
"MAX_NUM_EVENT_CHANNELS": 10,
"MAX_NUM_EVENT_FILTERS": 20,
"MAX_NUM_EVENT_CHANNELS": 20,
"MAX_NUM_EVENT_FILTERS": 40,
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
Expand Down
7 changes: 5 additions & 2 deletions blockchain-configs/testnet-dev/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"ENABLE_REST_FUNCTION_CALL": false,
"ENABLE_STATUS_REPORT_TO_TRACKER": true,
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
"EVENT_HANDLER_CHANNEL_IDLE_CHECK_INTERVAL_MS": 10000,
"EVENT_HANDLER_CHANNEL_IDLE_TIME_LIMIT_SECS": 600,
"EVENT_HANDLER_CHANNEL_LIFE_TIME_LIMIT_SECS": 3600,
"EVENT_HANDLER_FILTER_DELETION_TIMEOUT_MS": 100000,
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
"EVENT_HANDLER_PORT": 5100,
Expand All @@ -43,8 +46,8 @@
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
"MAX_NUM_EVENT_CHANNELS": 10,
"MAX_NUM_EVENT_FILTERS": 20,
"MAX_NUM_EVENT_CHANNELS": 20,
"MAX_NUM_EVENT_FILTERS": 40,
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
Expand Down
7 changes: 5 additions & 2 deletions blockchain-configs/testnet-exp/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"ENABLE_REST_FUNCTION_CALL": false,
"ENABLE_STATUS_REPORT_TO_TRACKER": true,
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
"EVENT_HANDLER_CHANNEL_IDLE_CHECK_INTERVAL_MS": 10000,
"EVENT_HANDLER_CHANNEL_IDLE_TIME_LIMIT_SECS": 600,
"EVENT_HANDLER_CHANNEL_LIFE_TIME_LIMIT_SECS": 3600,
"EVENT_HANDLER_FILTER_DELETION_TIMEOUT_MS": 100000,
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
"EVENT_HANDLER_PORT": 5100,
Expand All @@ -43,8 +46,8 @@
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
"MAX_NUM_EVENT_CHANNELS": 10,
"MAX_NUM_EVENT_FILTERS": 20,
"MAX_NUM_EVENT_CHANNELS": 20,
"MAX_NUM_EVENT_FILTERS": 40,
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
Expand Down
7 changes: 5 additions & 2 deletions blockchain-configs/testnet-prod/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"ENABLE_REST_FUNCTION_CALL": false,
"ENABLE_STATUS_REPORT_TO_TRACKER": true,
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
"EVENT_HANDLER_CHANNEL_IDLE_CHECK_INTERVAL_MS": 10000,
"EVENT_HANDLER_CHANNEL_IDLE_TIME_LIMIT_SECS": 600,
"EVENT_HANDLER_CHANNEL_LIFE_TIME_LIMIT_SECS": 3600,
"EVENT_HANDLER_FILTER_DELETION_TIMEOUT_MS": 100000,
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
"EVENT_HANDLER_PORT": 5100,
Expand All @@ -43,8 +46,8 @@
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
"MAX_NUM_EVENT_CHANNELS": 10,
"MAX_NUM_EVENT_FILTERS": 20,
"MAX_NUM_EVENT_CHANNELS": 20,
"MAX_NUM_EVENT_FILTERS": 40,
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
Expand Down
7 changes: 5 additions & 2 deletions blockchain-configs/testnet-sandbox/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"ENABLE_REST_FUNCTION_CALL": false,
"ENABLE_STATUS_REPORT_TO_TRACKER": true,
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
"EVENT_HANDLER_CHANNEL_IDLE_CHECK_INTERVAL_MS": 10000,
"EVENT_HANDLER_CHANNEL_IDLE_TIME_LIMIT_SECS": 600,
"EVENT_HANDLER_CHANNEL_LIFE_TIME_LIMIT_SECS": 3600,
"EVENT_HANDLER_FILTER_DELETION_TIMEOUT_MS": 100000,
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
"EVENT_HANDLER_PORT": 5100,
Expand All @@ -43,8 +46,8 @@
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
"MAX_NUM_EVENT_CHANNELS": 10,
"MAX_NUM_EVENT_FILTERS": 20,
"MAX_NUM_EVENT_CHANNELS": 20,
"MAX_NUM_EVENT_FILTERS": 40,
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
Expand Down
7 changes: 5 additions & 2 deletions blockchain-configs/testnet-staging/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"ENABLE_REST_FUNCTION_CALL": false,
"ENABLE_STATUS_REPORT_TO_TRACKER": true,
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
"EVENT_HANDLER_CHANNEL_IDLE_CHECK_INTERVAL_MS": 10000,
"EVENT_HANDLER_CHANNEL_IDLE_TIME_LIMIT_SECS": 600,
"EVENT_HANDLER_CHANNEL_LIFE_TIME_LIMIT_SECS": 3600,
"EVENT_HANDLER_FILTER_DELETION_TIMEOUT_MS": 100000,
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
"EVENT_HANDLER_PORT": 5100,
Expand All @@ -43,8 +46,8 @@
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
"MAX_NUM_EVENT_CHANNELS": 10,
"MAX_NUM_EVENT_FILTERS": 20,
"MAX_NUM_EVENT_CHANNELS": 20,
"MAX_NUM_EVENT_FILTERS": 40,
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
Expand Down
3 changes: 3 additions & 0 deletions client/protocol_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,8 @@
},
"1.3.1": {
"min": "1.0.0"
},
"1.4.0": {
"min": "1.0.0"
}
}
10 changes: 9 additions & 1 deletion common/network-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,18 @@ function getIpAddress(internal = false) {
});
}

// NOTE(minsulee2): This builds the URL using a client socket in the server side.
function buildRemoteUrlFromSocket(socket) {
const remoteAddress = _.get(socket, '_socket.remoteAddress', '');
const remotePort = _.get(socket, '_socket.remotePort', '');
return `${remoteAddress}:${remotePort}`;
}

module.exports = {
sendTxAndWaitForFinalization,
sendSignedTx,
signAndSendTx,
sendGetRequest,
getIpAddress
getIpAddress,
buildRemoteUrlFromSocket,
};
16 changes: 8 additions & 8 deletions config_client_api_ip_whitelist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ else
fi
fi

# Read node ip addresses
IFS=$'\n' read -d '' -r -a IP_ADDR_LIST < ./ip_addresses/$SEASON.txt
# Read node urls
IFS=$'\n' read -d '' -r -a NODE_URL_LIST < ./ip_addresses/$SEASON.txt

# Get keystore password
printf "Enter password: "
read -s PASSWORD
printf "Enter keystore password: "
read -s KEYSTORE_PW
printf "\n\n"
if [[ $SEASON = "mainnet" ]]; then
CHAIN_ID="1"
Expand All @@ -96,19 +96,19 @@ printf "COMMAND_NODE_JS_FILE=$COMMAND_NODE_JS_FILE\n"

function config_node() {
local node_index="$1"
local node_ip_addr=${IP_ADDR_LIST[${node_index}]}
local node_url=${NODE_URL_LIST[${node_index}]}

printf "\n\n<<< Configuring ip whitelist of node $node_index ($node_ip_addr) >>>\n\n"
printf "\n\n<<< Configuring ip whitelist of node $node_index ($node_url) >>>\n\n"

KEYSTORE_FILE_PATH="$KEYSTORE_DIR/keystore_node_$node_index.json"
CONFIG_NODE_CMD="node tools/api-access/$COMMAND_NODE_JS_FILE $node_ip_addr $CHAIN_ID keystore $KEYSTORE_FILE_PATH"
CONFIG_NODE_CMD="node tools/api-access/$COMMAND_NODE_JS_FILE $node_url $CHAIN_ID keystore $KEYSTORE_FILE_PATH"
if [[ ! $COMMAND = "get" ]]; then
CONFIG_NODE_CMD="$CONFIG_NODE_CMD '$IP_ADDR'"
fi

printf "\n"
printf "CONFIG_NODE_CMD=$CONFIG_NODE_CMD\n\n"
eval "echo $PASSWORD | $CONFIG_NODE_CMD"
eval "echo $KEYSTORE_PW | $CONFIG_NODE_CMD"
}

for j in `seq $(( 0 )) $(( 9 ))`; do
Expand Down
16 changes: 8 additions & 8 deletions config_node_param.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ else
fi
fi

# Read node ip addresses
IFS=$'\n' read -d '' -r -a IP_ADDR_LIST < ./ip_addresses/$SEASON.txt
# Read node urls
IFS=$'\n' read -d '' -r -a NODE_URL_LIST < ./ip_addresses/$SEASON.txt

# Get keystore password
printf "Enter password: "
read -s PASSWORD
printf "Enter keystore password: "
read -s KEYSTORE_PW
printf "\n\n"
if [[ $SEASON = "mainnet" ]]; then
CHAIN_ID="1"
Expand Down Expand Up @@ -107,19 +107,19 @@ printf "COMMAND_NODE_JS_FILE=$COMMAND_NODE_JS_FILE\n"

function config_node() {
local node_index="$1"
local node_ip_addr=${IP_ADDR_LIST[${node_index}]}
local node_url=${NODE_URL_LIST[${node_index}]}

printf "\n\n<<< Configuring ip whitelist of node $node_index ($node_ip_addr) >>>\n\n"
printf "\n\n<<< Configuring ip whitelist of node $node_index ($node_url) >>>\n\n"

KEYSTORE_FILE_PATH="$KEYSTORE_DIR/keystore_node_$node_index.json"
CONFIG_NODE_CMD="node tools/api-access/$COMMAND_NODE_JS_FILE $node_ip_addr $CHAIN_ID keystore $KEYSTORE_FILE_PATH $PARAM"
CONFIG_NODE_CMD="node tools/api-access/$COMMAND_NODE_JS_FILE $node_url $CHAIN_ID keystore $KEYSTORE_FILE_PATH $PARAM"
if [[ ! $COMMAND = "get" ]]; then
CONFIG_NODE_CMD="$CONFIG_NODE_CMD '$VALUE'"
fi

printf "\n"
printf "CONFIG_NODE_CMD=$CONFIG_NODE_CMD\n\n"
eval "echo $PASSWORD | $CONFIG_NODE_CMD"
eval "echo $KEYSTORE_PW | $CONFIG_NODE_CMD"
}

for j in `seq $(( 0 )) $(( 9 ))`; do
Expand Down
Loading
Loading