-
Notifications
You must be signed in to change notification settings - Fork 28
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
Update scripts to enable rest function call only for node #5 and #6 #676
Update scripts to enable rest function call only for node #5 and #6 #676
Conversation
deploy_blockchain_genesis_gcp.sh
Outdated
@@ -225,10 +225,10 @@ printf "\n\n##########################\n# Starting parent node 4 #\n############ | |||
gcloud compute ssh $NODE_4_TARGET_ADDR --command "$START_NODE_COMMAND_BASE 0 4 $ACCOUNT_INJECTION_OPTION" --project $PROJECT_ID --zone $NODE_4_ZONE | |||
inject_account "4" | |||
printf "\n\n##########################\n# Starting parent node 5 #\n##########################\n\n" | |||
gcloud compute ssh $NODE_5_TARGET_ADDR --command "$START_NODE_COMMAND_BASE 0 5 $ACCOUNT_INJECTION_OPTION" --project $PROJECT_ID --zone $NODE_5_ZONE | |||
gcloud compute ssh $NODE_5_TARGET_ADDR --command "$START_NODE_COMMAND_BASE 0 5 $ACCOUNT_INJECTION_OPTION --restfunc" --project $PROJECT_ID --zone $NODE_5_ZONE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about ---rest-func like --keep-code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks good! i edited. PTAL
deploy_blockchain_incremental_gcp.sh
Outdated
@@ -178,6 +178,9 @@ function deploy_node() { | |||
# 2. Start node | |||
printf "\n\n[[[[ Starting node $node_index ]]]]\n\n" | |||
START_CMD="gcloud compute ssh $node_target_addr --command '. start_node_incremental_gcp.sh $SEASON 0 $node_index $SYNC_MODE $ACCOUNT_INJECTION_OPTION' --project $PROJECT_ID --zone $node_zone" | |||
if [[ $node_index -gt 4 ]]; then | |||
START_CMD="gcloud compute ssh $node_target_addr --command '. start_node_incremental_gcp.sh $SEASON 0 $node_index $SYNC_MODE $ACCOUNT_INJECTION_OPTION --restfunc' --project $PROJECT_ID --zone $node_zone" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what bout using a variable e.g. REST_FUNC_OPTION?
if [[ $node_index -gt 4 ]]; then
REST_FUNC_OPTION="--rest-func"
else
REST_FUNC_OPTION=""
fi
START_CMD="gcloud compute ssh $node_target_addr --command '. start_node_incremental_gcp.sh $SEASON 0 $node_index $SYNC_MODE $ACCOUNT_INJECTION_OPTION $REST_FUNC_OPTION --project $PROJECT_ID --zone $node_zone"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks more readable! thanks
start_node_genesis_gcp.sh
Outdated
parse_options "$5" | ||
fi | ||
fi | ||
ENABLE_REST_FUNCTION_CALL="false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about using a variable e.g. REST_FUNC_OPTION (see KEEP_CODE_OPTION)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I edited it, but I don't know if I understood your intention clearly.
start_node_incremental_gcp.sh
Outdated
if [[ "$#" -lt 4 ]] || [[ "$#" -gt 5 ]]; then | ||
printf "Usage: bash start_node_incremental_gcp.sh [dev|staging|spring|summer] <Shard Index> <Node Index> [fast|full] [--keystore|--mnemonic]\n" | ||
if [[ "$#" -lt 4 ]] || [[ "$#" -gt 6 ]]; then | ||
printf "Usage: bash start_node_incremental_gcp.sh [dev|staging|spring|summer] <Shard Index> <Node Index> [fast|full] [--keystore|--mnemonic] [--restfunc]\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto (--rest-func)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
start_node_incremental_gcp.sh
Outdated
function parse_options() { | ||
local option="$1" | ||
if [[ "$option" = '--restfunc' ]]; then | ||
ENABLE_REST_FUNCTION_CALL="true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! PTAL
Could you update the PR title with a more relevant one? |
inject_account "6" | ||
NUM_NODES=7 | ||
index=0 | ||
while [ $index -lt $NUM_NODES ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice refactoring, thanks!
start_node_incremental_gcp.sh
Outdated
ACCOUNT_INJECTION_OPTION="" | ||
REST_FUNC_OPTION="" | ||
|
||
if [[ "$#" -gt 4 ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: what about using the while loop used in in start_node_genesis_gcp.sh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I edited, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with some minor comments.
Thanks for the nice implementation!
Changes:
Related issues: