Skip to content

allow to set doppelganger bins to use - #151

Merged
pepoviola merged 2 commits into
mainfrom
doppelganger-setup
Sep 25, 2026
Merged

pepoviola merged 2 commits into
mainfrom
doppelganger-setup

Conversation

@pepoviola

Copy link
Copy Markdown
Collaborator

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)

  • New config::DoppelgangerSetup { relay, para }, both
    Option<String>.
    • relay_command() and para_command() fall back to
      doppelganger / doppelganger-parachain, the same defaults as before.
    • validate() checks each set value with zombienet's Command (no
      whitespace, the same rule as SpawnSetup). A value containing / must
      also be an existing, executable file. A bare name is left to PATH, like
      the default.
  • New BiteOptions::doppelganger: DoppelgangerSetup field.
  • bite uses it. It calls opts.doppelganger.validate() before
    anything 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.
  • Config file: an optional [doppelganger] table with relay and
    parachain keys (config::DoppelgangerConfig), read with
    ZombieBiteConfig::get_doppelganger_setup().
  • resolve_bite_config fills opts.doppelganger from the config file,
    then from two new BiteOverrides fields, doppelganger and
    doppelganger_parachain. Each flag wins over its own config key only, and
    the result is validated along with SpawnSetup.
  • Removed run_doppelganger_node, which was unused and ran a hardcoded
    doppelganger --chain kusama.

CLI (zombie-bite)

  • bite gains --doppelganger <path> and --doppelganger-parachain <path>.
  • Commands now carries #[allow(clippy::large_enum_variant)]. The two new
    fields pushed Bite over the lint's size threshold. The enum is parsed once
    from argv, so boxing clap fields wouldn't buy anything.

Docs

  • Root README:
    • the requirements now say the binaries can come from PATH or be
      configured;
    • a new "Use a specific doppelganger build" section covers the table, the
      flags, precedence, validation and keeping the workers next to the binaries;
    • the command/image section no longer says the bite "always" runs the
      PATH binaries.
  • zombie-bite-core README: explains that BiteOptions::doppelganger
    and SpawnSetup are how the binaries get configured.
  • New examples/doppelganger.toml.

Compatibility

  • Behaviour is unchanged by default. With no flag and no
    [doppelganger] table, bite runs exactly the commands it ran before.
    Existing config files parse unchanged, because the table is optional.

@pepoviola
pepoviola merged commit c69c089 into main Sep 25, 2026
4 checks passed
@pepoviola
pepoviola deleted the doppelganger-setup branch September 25, 2026 14:49
@pepoviola pepoviola mentioned this pull request Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant