Skip to content

Commit 3fd2306

Browse files
galaiobuddh0
authored andcommitted
script: support remote update config;
script: update config changes;
1 parent 0daae64 commit 3fd2306

File tree

4 files changed

+34
-7
lines changed

4 files changed

+34
-7
lines changed

bsc_cluster.sh

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,27 @@ function register_stakehub(){
306306
done
307307
}
308308

309+
function remote_reset_config() {
310+
rm -rf /mnt/efs/${copyDir}/clusterNetwork
311+
cp -r ${workspace}/.local /mnt/efs/${copyDir}/clusterNetwork
312+
ips=(${validator_ips_comma//,/ })
313+
for ((i=0;i<${#ips[@]};i++));do
314+
dst_id=${ips2ids[${ips[i]}]}
315+
if [ ${EnableSentryNode} = true ]; then
316+
aws ssm send-command --instance-ids "${dst_id}" --document-name "AWS-RunShellScript" --parameters commands="sudo \cp -f /mnt/efs/${copyDir}/clusterNetwork/sentry${i}/config.toml /server/sentry/"
317+
aws ssm send-command --instance-ids "${dst_id}" --document-name "AWS-RunShellScript" --parameters commands="sudo \cp -f /mnt/efs/${copyDir}/clusterNetwork/sentry${i}/chaind.sh /server/sentry/"
318+
fi
319+
aws ssm send-command --instance-ids "${dst_id}" --document-name "AWS-RunShellScript" --parameters commands="sudo \cp -f /mnt/efs/${copyDir}/clusterNetwork/node${i}/config.toml /server/validator/"
320+
aws ssm send-command --instance-ids "${dst_id}" --document-name "AWS-RunShellScript" --parameters commands="sudo \cp -f /mnt/efs/${copyDir}/clusterNetwork/node${i}/chaind.sh /server/validator/"
321+
done
322+
if [ ${EnableFullNode} = true ]; then
323+
fullnode_ips=(${fullnode_ips_comma//,/ })
324+
dst_id=${ips2ids[${fullnode_ips[0]}]}
325+
aws ssm send-command --instance-ids "${dst_id}" --document-name "AWS-RunShellScript" --parameters commands="sudo \cp -f /mnt/efs/${copyDir}/clusterNetwork/fullnode0/config.toml /server/validator/"
326+
aws ssm send-command --instance-ids "${dst_id}" --document-name "AWS-RunShellScript" --parameters commands="sudo \cp -f /mnt/efs/${copyDir}/clusterNetwork/fullnode0/chaind.sh /server/validator/"
327+
fi
328+
}
329+
309330
function remote_start() {
310331
rm -rf /mnt/efs/${copyDir}/clusterNetwork
311332
cp -r ${workspace}/.local /mnt/efs/${copyDir}/clusterNetwork
@@ -358,7 +379,7 @@ reset)
358379
reset_genesis
359380
prepare_config
360381
initNetwork
361-
native_start
382+
native_start
362383
register_stakehub
363384
;;
364385
stop)
@@ -381,6 +402,13 @@ remote_reset)
381402
remote_upgrade
382403
register_stakehub
383404
;;
405+
remote_reset_config)
406+
create_validator
407+
reset_genesis
408+
prepare_config
409+
initNetwork
410+
remote_reset_config
411+
;;
384412
remote_upgrade)
385413
remote_upgrade
386414
;;

qa-env-resource/bsc.service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ExecStop=/server/validator/chaind.sh -stop
1212
PrivateTmp=true
1313
LimitNOFILE=10000
1414
StartLimitInterval=0
15+
TimeoutStopSec=120
1516

1617
[Install]
1718
WantedBy=multi-user.target

qa-env-resource/chaind.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,14 @@ function startChaind() {
4646
function stopChaind() {
4747
pid=`ps -ef | grep /server/${workdir}/${bin} | grep -v grep | awk '{print $2}'`
4848
if [ -n "$pid" ]; then
49-
for((i=1;i<=4;i++));
49+
kill -TERM $pid
50+
for((i=1;i<=40;i++));
5051
do
51-
kill $pid
52-
sleep 5
5352
pid=`ps -ef | grep /server/${workdir}/${bin} | grep -v grep | awk '{print $2}'`
5453
if [ -z "$pid" ]; then
5554
break
56-
elif [ $i -eq 4 ]; then
57-
kill -9 $pid
5855
fi
56+
sleep 10
5957
done
6058
fi
6159
}

qa-env-resource/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ NoDiscovery = false
6666
ListenAddr = ":30311"
6767
EnableMsgEvents = false
6868
EVNNodeIdsWhitelist = []
69-
ProxyedValidatorNodeIDs = []
69+
ProxyedValidatorAddresses = []
7070

7171
[Node.HTTPTimeouts]
7272
ReadTimeout = 30000000000

0 commit comments

Comments
 (0)