Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Support ad-hoc genesis args in run.sh #9697

Merged
merged 2 commits into from
Apr 24, 2020

Conversation

ryoqun
Copy link
Contributor

@ryoqun ryoqun commented Apr 24, 2020

Some times I want to add some ad-hoc options to solana-genesis and solana-validator like --enable-warmup-epochs.

Split off from #9527.

@ryoqun ryoqun requested a review from mvines April 24, 2020 03:04
run.sh Outdated
@@ -97,7 +99,8 @@ args=(
--enable-rpc-transaction-history
--init-complete-file "$dataDir"/init-completed
)
solana-validator "${args[@]}" &
# shellcheck disable=SC2086
solana-validator "${args[@]}" $SOLANA_RUN_SH_VALIDATOR_ARGS &
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if we have a user for ${args[@]}? Just seems a little complex to have both args coming in via arguments and environment variables. I wonder if we should do something like:

$ run.sh <genesis args> -- <validator args>

with the default of

$ run.sh <validator args>

if -- is unspecified.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, my eye was blind.. I can just use ${args[@]} instead of another env....

IIRC, there should be little user for ${args[@]} if ever. Yet, some validator-launching convenient scripts in example apps might be passing some custom args?

The main motivation of this PR is SOLANA_RUN_SH_GENESIS_ARGS.

I defined SOLANA_RUN_SH_VALIDATOR_ARGS for consistency and as a bonus. I even considered SOLANA_RUN_SH_FAUCET_ARGS... ;)

I guess the -- escaping might be too tedious like run.sh <FAUCET ARGS> -- <GENESIS ARGS> -- <VALIDATOR ARGS>...?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, just adding SOLANA_RUN_SH_GENESIS_ARGS seems ok for now. But also not really a big deal, do whatever works best for you :)

@ryoqun ryoqun mentioned this pull request Apr 24, 2020
5 tasks
@ryoqun ryoqun added the automerge Merge this Pull Request automatically once CI passes label Apr 24, 2020
@ryoqun ryoqun changed the title Support ad-hoc validagor/genesis args in run.sh Support ad-hoc genesis args in run.sh Apr 24, 2020
@solana-grimes solana-grimes merged commit d44e0b7 into solana-labs:master Apr 24, 2020
@ryoqun ryoqun added the v1.0 label May 8, 2020
mergify bot pushed a commit that referenced this pull request May 8, 2020
automerge

(cherry picked from commit d44e0b7)
@ryoqun ryoqun added the v1.1 label May 8, 2020
mergify bot pushed a commit that referenced this pull request May 8, 2020
automerge

(cherry picked from commit d44e0b7)
solana-grimes pushed a commit that referenced this pull request May 8, 2020
solana-grimes pushed a commit that referenced this pull request May 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants