allow to set doppelganger bins to use - #151
Merged
Merged
Conversation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR: we need to allow to set the bin (path) for running doppelganger/doppelganger-parachain to allow to embed this library in another tool (e.g EM).
What changes
Library (
zombie-bite-core)config::DoppelgangerSetup { relay, para }, bothOption<String>.relay_command()andpara_command()fall back todoppelganger/doppelganger-parachain, the same defaults as before.validate()checks each set value with zombienet'sCommand(nowhitespace, the same rule as
SpawnSetup). A value containing/mustalso be an existing, executable file. A bare name is left to
PATH, likethe default.
BiteOptions::doppelganger: DoppelgangerSetupfield.biteuses it. It callsopts.doppelganger.validate()beforeanything else, so a bad path fails right away rather than when the first
sync node can't be spawned. All four call sites then use the configured
commands. The start-of-bite log line names the binaries in use.
[doppelganger]table withrelayandparachainkeys (config::DoppelgangerConfig), read withZombieBiteConfig::get_doppelganger_setup().resolve_bite_configfillsopts.doppelgangerfrom the config file,then from two new
BiteOverridesfields,doppelgangeranddoppelganger_parachain. Each flag wins over its own config key only, andthe result is validated along with
SpawnSetup.run_doppelganger_node, which was unused and ran a hardcodeddoppelganger --chain kusama.CLI (
zombie-bite)bitegains--doppelganger <path>and--doppelganger-parachain <path>.Commandsnow carries#[allow(clippy::large_enum_variant)]. The two newfields pushed
Biteover the lint's size threshold. The enum is parsed oncefrom argv, so boxing clap fields wouldn't buy anything.
Docs
PATHor beconfigured;
flags, precedence, validation and keeping the workers next to the binaries;
PATHbinaries.zombie-bite-coreREADME: explains thatBiteOptions::doppelgangerand
SpawnSetupare how the binaries get configured.examples/doppelganger.toml.Compatibility
[doppelganger]table,biteruns exactly the commands it ran before.Existing config files parse unchanged, because the table is optional.