Skip to content

Commit 288c7a3

Browse files
authored
Merge pull request #1323 from ainblockchain/release/v1.5.0
Release/v1.5.0
2 parents 143fa4d + da7b9b7 commit 288c7a3

30 files changed

+1171
-374
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ You can override default port numbering system by setting `PORT` and `P2P_PORT`
4747
```
4848
gcloud init
4949
# For genesis deploy
50-
bash deploy_blockchain_genesis_gcp.sh [dev|staging|sandbox|exp|spring|summer|mainnet] <# of Shards> <Parent Node Index Begin> <Parent Node Index End> [--setup] [--keystore|--mnemonic|--private-key] [--keep-code|--no-keep-code] [--keep-data|--no-keep-data] [--full-sync|--fast-sync] [--chown-data|--no-chown-data] [--kill-only|--skip-kill]
50+
bash deploy_blockchain_genesis_gcp.sh [dev|staging|sandbox|exp|spring|summer|mainnet] <# of Shards> <Parent Node Index Begin> <Parent Node Index End> [--setup] [--keystore|--mnemonic|--private-key] [--keep-code|--no-keep-code] [--keep-data|--no-keep-data] [--full-sync|--fast-sync] [--chown-data|--no-chown-data] [--kill-job|--kill-only]
5151
# For incremental deploy
5252
bash deploy_blockchain_incremental_gcp.sh [dev|staging|sandbox|exp|spring|summer|mainnet] <# of Shards> <Parent Node Index Begin> <Parent Node Index End> [--setup] [--keystore|--mnemonic|--private-key] [--keep-code|--no-keep-code] [--keep-data|--no-keep-data] [--full-sync|--fast-sync] [--chown-data|--no-chown-data]
5353
```
@@ -130,7 +130,7 @@ BLOCKCHAIN_CONFIGS_DIR=blockchain-configs/afan-shard MIN_NUM_VALIDATORS=1 DEBUG=
130130
```
131131
gcloud init
132132
# For genesis deploy
133-
bash deploy_blockchain_genesis_gcp.sh [dev|staging|sandbox|exp|spring|summer|mainnet] <# of Shards> <Parent Node Index Begin> <Parent Node Index End> [--setup] [--keystore|--mnemonic|--private-key] [--keep-code|--no-keep-code] [--keep-data|--no-keep-data] [--full-sync|--fast-sync] [--chown-data|--no-chown-data] [--kill-only|--skip-kill]
133+
bash deploy_blockchain_genesis_gcp.sh [dev|staging|sandbox|exp|spring|summer|mainnet] <# of Shards> <Parent Node Index Begin> <Parent Node Index End> [--setup] [--keystore|--mnemonic|--private-key] [--keep-code|--no-keep-code] [--keep-data|--no-keep-data] [--full-sync|--fast-sync] [--chown-data|--no-chown-data] [--kill-job|--kill-only]
134134
# For incremental deploy
135135
bash deploy_blockchain_incremental_gcp.sh [dev|staging|sandbox|exp|spring|summer|mainnet] <# of Shards> <Parent Node Index Begin> <Parent Node Index End> [--setup] [--keystore|--mnemonic|--private-key] [--keep-code|--no-keep-code] [--keep-data|--no-keep-data] [--full-sync|--fast-sync] [--chown-data|--no-chown-data]
136136
```

blockchain-configs/afan-shard/node_params.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
4848
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
4949
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
50-
"MAX_NUM_EVENT_CHANNELS": 20,
50+
"MAX_NUM_EVENT_CHANNELS": 30,
5151
"MAX_NUM_EVENT_FILTERS": 40,
5252
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
5353
"MAX_NUM_INBOUND_CONNECTION": 3,

blockchain-configs/base/node_params.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
4848
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
4949
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
50-
"MAX_NUM_EVENT_CHANNELS": 20,
50+
"MAX_NUM_EVENT_CHANNELS": 30,
5151
"MAX_NUM_EVENT_FILTERS": 40,
5252
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
5353
"MAX_NUM_INBOUND_CONNECTION": 6,

blockchain-configs/he-shard/node_params.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
4848
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
4949
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
50-
"MAX_NUM_EVENT_CHANNELS": 20,
50+
"MAX_NUM_EVENT_CHANNELS": 30,
5151
"MAX_NUM_EVENT_FILTERS": 40,
5252
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
5353
"MAX_NUM_INBOUND_CONNECTION": 6,

blockchain-configs/mainnet-prod/node_params.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
4747
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
4848
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
49-
"MAX_NUM_EVENT_CHANNELS": 20,
49+
"MAX_NUM_EVENT_CHANNELS": 30,
5050
"MAX_NUM_EVENT_FILTERS": 40,
5151
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
5252
"MAX_NUM_INBOUND_CONNECTION": 6,
@@ -56,7 +56,7 @@
5656
"ON_MEMORY_CHAIN_LENGTH": 10,
5757
"P2P_HEARTBEAT_INTERVAL_MS": 15000,
5858
"P2P_MESSAGE_TIMEOUT_MS": 600000,
59-
"P2P_PORT": 5000,
59+
"P2P_PORT": 4997,
6060
"P2P_WAIT_FOR_ADDRESS_TIMEOUT_MS": 10000,
6161
"PEER_CANDIDATE_JSON_RPC_URL": "https://mainnet-api.ainetwork.ai/json-rpc",
6262
"PEER_CANDIDATES_CONNECTION_INTERVAL_MS": 20000,

blockchain-configs/sim-shard/node_params.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
4848
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
4949
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
50-
"MAX_NUM_EVENT_CHANNELS": 20,
50+
"MAX_NUM_EVENT_CHANNELS": 30,
5151
"MAX_NUM_EVENT_FILTERS": 40,
5252
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
5353
"MAX_NUM_INBOUND_CONNECTION": 6,

blockchain-configs/testnet-dev/node_params.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
4848
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
4949
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
50-
"MAX_NUM_EVENT_CHANNELS": 20,
50+
"MAX_NUM_EVENT_CHANNELS": 30,
5151
"MAX_NUM_EVENT_FILTERS": 40,
5252
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
5353
"MAX_NUM_INBOUND_CONNECTION": 6,

blockchain-configs/testnet-exp/node_params.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
4848
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
4949
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
50-
"MAX_NUM_EVENT_CHANNELS": 20,
50+
"MAX_NUM_EVENT_CHANNELS": 30,
5151
"MAX_NUM_EVENT_FILTERS": 40,
5252
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
5353
"MAX_NUM_INBOUND_CONNECTION": 6,

blockchain-configs/testnet-prod/node_params.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
4848
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
4949
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
50-
"MAX_NUM_EVENT_CHANNELS": 20,
50+
"MAX_NUM_EVENT_CHANNELS": 30,
5151
"MAX_NUM_EVENT_FILTERS": 40,
5252
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
5353
"MAX_NUM_INBOUND_CONNECTION": 6,
@@ -57,7 +57,7 @@
5757
"ON_MEMORY_CHAIN_LENGTH": 10,
5858
"P2P_HEARTBEAT_INTERVAL_MS": 15000,
5959
"P2P_MESSAGE_TIMEOUT_MS": 600000,
60-
"P2P_PORT": 5000,
60+
"P2P_PORT": 4998,
6161
"P2P_WAIT_FOR_ADDRESS_TIMEOUT_MS": 10000,
6262
"PEER_CANDIDATE_JSON_RPC_URL": "https://testnet-api.ainetwork.ai/json-rpc",
6363
"PEER_CANDIDATES_CONNECTION_INTERVAL_MS": 20000,

blockchain-configs/testnet-sandbox/node_params.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
4848
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
4949
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
50-
"MAX_NUM_EVENT_CHANNELS": 20,
50+
"MAX_NUM_EVENT_CHANNELS": 30,
5151
"MAX_NUM_EVENT_FILTERS": 40,
5252
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
5353
"MAX_NUM_INBOUND_CONNECTION": 6,

blockchain-configs/testnet-staging/node_params.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
4848
"MAX_JSON_RPC_API_READ_RATE_LIMIT": 10,
4949
"MAX_JSON_RPC_API_WRITE_RATE_LIMIT": 1,
50-
"MAX_NUM_EVENT_CHANNELS": 20,
50+
"MAX_NUM_EVENT_CHANNELS": 30,
5151
"MAX_NUM_EVENT_FILTERS": 40,
5252
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
5353
"MAX_NUM_INBOUND_CONNECTION": 6,
@@ -57,7 +57,7 @@
5757
"ON_MEMORY_CHAIN_LENGTH": 10,
5858
"P2P_HEARTBEAT_INTERVAL_MS": 15000,
5959
"P2P_MESSAGE_TIMEOUT_MS": 600000,
60-
"P2P_PORT": 5000,
60+
"P2P_PORT": 4999,
6161
"P2P_WAIT_FOR_ADDRESS_TIMEOUT_MS": 10000,
6262
"PEER_CANDIDATE_JSON_RPC_URL": "https://staging-api.ainetwork.ai/json-rpc",
6363
"PEER_CANDIDATES_CONNECTION_INTERVAL_MS": 20000,

client/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ app.get('/metrics', async (req, res, next) => {
9797
.end();
9898
});
9999

100-
// Used in wait_until_node_sync_gcp.sh
100+
// Used in wait_until_node_sync.sh
101101
app.get('/last_block_number', (req, res, next) => {
102102
const beginTime = Date.now();
103103
const result = node.bc.lastBlockNumber();

client/protocol_versions.json

+3
Original file line numberDiff line numberDiff line change
@@ -155,5 +155,8 @@
155155
},
156156
"1.4.2": {
157157
"min": "1.0.0"
158+
},
159+
"1.5.0": {
160+
"min": "1.0.0"
158161
}
159162
}

common/file-util.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class FileUtil {
257257
});
258258
});
259259
} catch (err) {
260-
logger.error(`[${LOG_HEADER}] Error while reading ${filePath}: ${err}`);
260+
logger.error(`[${LOG_HEADER}] Error while reading ${filePath}: ${err.stack}`);
261261
return false;
262262
}
263263
}
@@ -288,7 +288,7 @@ class FileUtil {
288288
});
289289
});
290290
} catch (err) {
291-
logger.error(`[${LOG_HEADER}] Error while reading ${filePath}: ${err}`);
291+
logger.error(`[${LOG_HEADER}] Error while reading ${filePath}: ${err.stack}`);
292292
return null;
293293
}
294294
}
@@ -299,7 +299,7 @@ class FileUtil {
299299
const zippedFs = fs.readFileSync(filePath);
300300
return FileUtil.buildObjectFromChunks(JSON.parse(zlib.gunzipSync(zippedFs).toString()).docs);
301301
} catch (err) {
302-
logger.error(`[${LOG_HEADER}] Error while reading ${filePath}: ${err}`);
302+
logger.error(`[${LOG_HEADER}] Error while reading ${filePath}: ${err.stack}`);
303303
return null;
304304
}
305305
}
@@ -314,7 +314,7 @@ class FileUtil {
314314
const zippedFs = fs.readFileSync(filePath);
315315
return JSON.parse(zlib.gunzipSync(zippedFs).toString());
316316
} catch (err) {
317-
logger.error(`[${LOG_HEADER}] Error while reading ${filePath}: ${err}`);
317+
logger.error(`[${LOG_HEADER}] Error while reading ${filePath}: ${err.stack}`);
318318
return null;
319319
}
320320
}
@@ -325,7 +325,7 @@ class FileUtil {
325325
const fileStr = fs.readFileSync(filePath);
326326
return JSON.parse(fileStr);
327327
} catch (err) {
328-
logger.error(`[${LOG_HEADER}] Error while reading ${filePath}: ${err}`);
328+
logger.error(`[${LOG_HEADER}] Error while reading ${filePath}: ${err.stack}`);
329329
return null;
330330
}
331331
}
@@ -399,7 +399,7 @@ class FileUtil {
399399
try {
400400
return Number(fs.readFileSync(h2nPath).toString());
401401
} catch (err) {
402-
logger.error(`[${LOG_HEADER}] Error while reading ${h2nPath}: ${err}`);
402+
logger.error(`[${LOG_HEADER}] Error while reading ${h2nPath}: ${err.stack}`);
403403
return -1;
404404
}
405405
}

copy_blockchain_data_gcp.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
function usage() {
44
printf "Usage: bash copy_blockchain_data_gcp.sh [dev|staging|sandbox|exp|spring|summer|mainnet] <Node Index> [download|upload]\n"
5-
printf "Example: bash copy_blockchain_data_gcp.sh spring 5 download\n"
5+
printf "Example: bash copy_blockchain_data_gcp.sh spring 0 download\n"
6+
printf "Example: bash copy_blockchain_data_gcp.sh spring 1 upload\n"
67
printf "\n"
78
exit
89
}
@@ -146,7 +147,7 @@ function upload_data() {
146147

147148
# 2. Extract tgz file for node
148149
printf "\n\n<<< Extracting tgz file for node $node_index >>>\n\n"
149-
TGZ_CMD="gcloud compute ssh $node_target_addr --command 'cd /home; sudo mkdir -p ain_blockchain_data; sudo chown runner:runner ain_blockchain_data; sudo chmod 777 ain_blockchain_data; cd ain_blockchain_data; gzip -dc ~/ain_blockchain_data.tar.gz | tar xvf -' --project $PROJECT_ID --zone $node_zone"
150+
TGZ_CMD="gcloud compute ssh $node_target_addr --command 'cd /home; sudo mkdir -p ain_blockchain_data; sudo chown $GCP_USER:$GCP_USER ain_blockchain_data; sudo chmod 777 ain_blockchain_data; cd ain_blockchain_data; sudo rm -rf chains snapshots; gzip -dc ~/ain_blockchain_data.tar.gz | tar xvf -' --project $PROJECT_ID --zone $node_zone"
150151
printf "TGZ_CMD=$TGZ_CMD\n\n"
151152
eval $TGZ_CMD
152153

copy_blockchain_data_onprem.sh

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
#!/bin/bash
2+
3+
function usage() {
4+
printf "Usage: bash copy_blockchain_data_onprem.sh [staging|spring|mainnet] <Node Index> [download|upload]\n"
5+
printf "Example: bash copy_blockchain_data_onprem.sh staging 0 download\n"
6+
printf "Example: bash copy_blockchain_data_onprem.sh staging 1 upload\n"
7+
printf "\n"
8+
exit
9+
}
10+
11+
if [[ $# -lt 3 ]] || [[ $# -gt 3 ]]; then
12+
usage
13+
fi
14+
15+
if [[ "$1" = 'staging' ]] || [[ "$1" = 'spring' ]] || [[ "$1" = 'mainnet' ]]; then
16+
SEASON="$1"
17+
else
18+
printf "Invalid <Project/Season> argument: $1\n"
19+
exit
20+
fi
21+
printf "\n"
22+
printf "SEASON=$SEASON\n"
23+
24+
ONPREM_USER="nvidia"
25+
printf "ONPREM_USER=$ONPREM_USER\n"
26+
27+
number_re='^[0-9]+$'
28+
if ! [[ $2 =~ $number_re ]] ; then
29+
printf "\n"
30+
printf "Invalid <Node Index> argument: $2\n"
31+
exit
32+
fi
33+
NODE_INDEX=$2
34+
if [[ $NODE_INDEX -lt 0 ]] || [[ $NODE_INDEX -gt 9 ]]; then
35+
printf "\n"
36+
printf "Out-of-range <Node Index> argument: $NODE_INDEX\n"
37+
exit
38+
fi
39+
printf "NODE_INDEX=$NODE_INDEX\n"
40+
41+
if [[ "$3" = 'download' ]] || [[ "$3" = 'upload' ]]; then
42+
COMMAND="$3"
43+
else
44+
printf "\n"
45+
printf "Invalid <Command> argument: $3\n"
46+
printf "\n"
47+
usage
48+
fi
49+
printf "COMMAND=$COMMAND\n"
50+
51+
# Get confirmation.
52+
if [[ "$SEASON" = "mainnet" ]]; then
53+
printf "\n"
54+
printf "Do you want to proceed for $SEASON? Enter [mainnet]: "
55+
read CONFIRM
56+
printf "\n\n"
57+
if [[ ! $CONFIRM = "mainnet" ]]
58+
then
59+
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell
60+
fi
61+
else
62+
printf "\n"
63+
read -p "Do you want to proceed for $SEASON? [y/N]: " -n 1 -r
64+
printf "\n\n"
65+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
66+
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell
67+
fi
68+
fi
69+
70+
# Read node ip addresses and passwords
71+
IFS=$'\n' read -d '' -r -a NODE_IP_LIST < ./ip_addresses/${SEASON}_onprem_ip.txt
72+
IFS=$'\n' read -d '' -r -a NODE_PW_LIST < ./ip_addresses/${SEASON}_onprem_pw.txt
73+
74+
function download_data() {
75+
local node_index="$1"
76+
local node_target_addr="${ONPREM_USER}@${NODE_IP_LIST[${node_index}]}"
77+
local node_login_pw="${NODE_PW_LIST[${node_index}]}"
78+
79+
printf "\n* >> Downloading data from node $node_index ($node_target_addr) *********************************************************\n\n"
80+
81+
printf "node_target_addr='$node_target_addr'\n"
82+
83+
# 1. Create tgz file for node
84+
printf "\n\n<<< Creating tgz file for node $node_index >>>\n\n"
85+
TGZ_CMD="ssh $node_target_addr 'sudo -S ls -la; cd /home/${SEASON}/ain_blockchain_data; tar cvf - chains snapshots | gzip -c > ~/ain_blockchain_data.tar.gz'"
86+
printf "TGZ_CMD=$TGZ_CMD\n\n"
87+
eval "echo ${node_login_pw} | sshpass -f <(printf '%s\n' ${node_login_pw}) ${TGZ_CMD}"
88+
89+
# 2. Copy tgz file from node
90+
printf "\n\n<<< Copying tgz file from node $node_index >>>\n\n"
91+
SCP_CMD="scp -r $node_target_addr:~/ain_blockchain_data.tar.gz ."
92+
printf "SCP_CMD=$SCP_CMD\n\n"
93+
eval "sshpass -f <(printf '%s\n' ${node_login_pw}) ${SCP_CMD}"
94+
95+
# 3. Clean up tgz file for node
96+
printf "\n\n<<< Cleaning up tgz file for node $node_index >>>\n\n"
97+
CLEANUP_CMD="ssh $node_target_addr 'rm ~/ain_blockchain_data.tar.gz'"
98+
printf "CLEANUP_CMD=$CLEANUP_CMD\n\n"
99+
eval "sshpass -f <(printf '%s\n' ${node_login_pw}) ${CLEANUP_CMD}"
100+
}
101+
102+
function upload_data() {
103+
local node_index="$1"
104+
local node_target_addr="${ONPREM_USER}@${NODE_IP_LIST[${node_index}]}"
105+
local node_login_pw="${NODE_PW_LIST[${node_index}]}"
106+
107+
printf "\n* >> Uploading data from node $node_index ($node_target_addr) *********************************************************\n\n"
108+
109+
printf "node_target_addr='$node_target_addr'\n"
110+
111+
# 1. Copy tgz file to node
112+
printf "\n\n<<< Copying tgz file to node $node_index >>>\n\n"
113+
SCP_CMD="scp -r ./ain_blockchain_data.tar.gz $node_target_addr:~"
114+
printf "SCP_CMD=$SCP_CMD\n\n"
115+
eval "sshpass -f <(printf '%s\n' ${node_login_pw}) ${SCP_CMD}"
116+
117+
# 2. Extract tgz file for node
118+
printf "\n\n<<< Extracting tgz file for node $node_index >>>\n\n"
119+
TGZ_CMD="ssh $node_target_addr 'sudo -S ls -la; cd /home; sudo mkdir -p ${SEASON}/ain_blockchain_data; sudo chown $ONPREM_USER:$ONPREM_USER ${SEASON} ${SEASON}/ain_blockchain_data; sudo chmod 777 ${SEASON} ${SEASON}/ain_blockchain_data; cd ${SEASON}/ain_blockchain_data; sudo rm -rf chains snapshots; gzip -dc ~/ain_blockchain_data.tar.gz | tar xvf -'"
120+
printf "TGZ_CMD=$TGZ_CMD\n\n"
121+
eval "echo ${node_login_pw} | sshpass -f <(printf '%s\n' ${node_login_pw}) ${TGZ_CMD}"
122+
123+
# 3. Clean up tgz file for node
124+
printf "\n\n<<< Cleaning up tgz file for node $node_index >>>\n\n"
125+
CLEANUP_CMD="ssh $node_target_addr 'rm ~/ain_blockchain_data.tar.gz'"
126+
printf "CLEANUP_CMD=$CLEANUP_CMD\n\n"
127+
eval "sshpass -f <(printf '%s\n' ${node_login_pw}) ${CLEANUP_CMD}"
128+
}
129+
130+
if [[ "$COMMAND" = 'upload' ]]; then
131+
upload_data "$NODE_INDEX"
132+
else
133+
download_data "$NODE_INDEX"
134+
fi

0 commit comments

Comments
 (0)