Skip to content

Commit

Permalink
Merge pull request #1295 from ainblockchain/release/v1.4.0
Browse files Browse the repository at this point in the history
Release/v1.4.0
  • Loading branch information
platfowner authored Aug 9, 2024
2 parents 8723666 + fbc3226 commit 7b41b72
Show file tree
Hide file tree
Showing 38 changed files with 1,248 additions and 125 deletions.
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

0 comments on commit 7b41b72

Please sign in to comment.