@@ -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+
309330function 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 ;;
364385stop)
@@ -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+ ;;
384412remote_upgrade)
385413 remote_upgrade
386414 ;;
0 commit comments