Skip to content

Add support for custom parachains#110

Open
lexnv wants to merge 4 commits into
mainfrom
lexnv/support-custom-chains
Open

Add support for custom parachains#110
lexnv wants to merge 4 commits into
mainfrom
lexnv/support-custom-chains

Conversation

@lexnv

@lexnv lexnv commented Mar 3, 2026

Copy link
Copy Markdown

Add support for custom parachains. Users can:

  • provide the details via CLI
  • provide a custom TOML file with all the required fields
[relaychain]
network = "kusama"

[[parachains]]
type = "custom"
para_id = 3392
name = "yap-3392"
rpc_endpoint = "wss://kusama-yap-3392.parity-chains.parity.io"
chain_spec = "/path/to/yap-3392-raw-chain-spec.json"

Testing Done

  • fetching locally
PATH="/home/ubuntu/workspace/doppelganger-wrapper/target/release:$PATH" ./target/release/zombie-bite bite -c kusama-yap3392.toml -d ./kusama-yap-3392-db
 
2026-03-03T10:51:22.424602Z  INFO zombie_bite::doppelganger: 🪞 Starting DoppelGanger process for kusama and [Custom { para_id: 3392, name: "yap-3392", chain_spec: "/home/ubuntu/workspace/zombie-bite/kusama-yap-3392-spec.json", maybe_override: None, maybe_bite_at: None, maybe_rpc_endpoint: Some("wss://kusama-yap-3392.parity-chains.parity.io") }]
2026-03-03T10:51:22.425072Z  WARN zombienet_provider::native::namespace: ⚠️ Using and existing directory /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite as base dir
2026-03-03T10:51:22.449053Z  INFO zombie_bite::sync: 🔄 Starting sync for parachain: yap-3392-kusama with unique node name: sync-node-para-yap_3392_kusama
2026-03-03T10:51:22.449080Z  INFO zombie_bite::sync: 🔎 sync para opts: SpawnNodeOptions { name: "sync-node-para-yap_3392_kusama", image: None, resources: None, program: "doppelganger-parachain", args: ["--chain", "/home/ubuntu/workspace/zombie-bite/kusama-yap-3392-spec.json", "--sync", "warp", "-d", "/home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/paras/yap-3392-kusama/sync-db", "--rpc-port", "45673", "--prometheus-port", "33005", "--relay-chain-rpc-url", "wss://kusama-rpc.polkadot.io", "--no-hardware-benchmarks", "--state-pruning", "28801", "--database", "rocksdb", "--", "--chain", "kusama"], env: [("ZOMBIE_PARA_OVERRIDES_PATH", "/home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/3392_overrides.json"), ("ZOMBIE_PARA_HEAD_PATH", "/home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/paras/yap-3392-kusama/head.txt"), ("RUST_LOG", "doppelganger=debug"), ("ZOMBIE_INFO_PATH", "/home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/para-3392.txt"), ("ZOMBIE_PARA_ID", "3392")], injected_files: [], created_paths: [], db_snapshot: None, port_mapping: None, node_log_path: None }
2026-03-03T10:51:22.451686Z  INFO zombie_bite::sync: 📓 sync para logs: tail -f /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/sync-node-para-yap_3392_kusama/sync-node-para-yap_3392_kusama.log
Syncing......................................
2026-03-03T10:58:46.598936Z  INFO zombie_bite::sync: ✅ Synced (chain: yap-3392-kusama), stopping node.
2026-03-03T10:58:46.677327Z  INFO zombie_bite::doppelganger:
📝 Generating snapshot file /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/yap-3392-kusama-snap.tgz with data_path /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/paras/yap-3392-kusama/sync-db...
2026-03-03T10:58:46.882665Z  INFO zombie_bite::doppelganger: ✅ generated with path /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/yap-3392-kusama-snap.tgz
2026-03-03T10:58:46.883230Z  INFO zombie_bite::sync: 🔎 sync node opts: SpawnNodeOptions { name: "sync-node", image: None, resources: None, program: "doppelganger", args: ["--chain", "kusama", "--sync", "warp", "-d", "/home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/sync-db", "--prometheus-port", "46539", "--no-hardware-benchmarks", "--state-pruning", "28801", "--database", "rocksdb"], env: [("ZOMBIE_cd710b30bd2eab0352ddcc26417aa1941b3c252fcb29d88eff4f3de5de4476c3ceb90b4d6d43a480400d0000", "b903b8e1def0c3b7c3099241dd8f858928a8d7c911a00643de32b2deed6ea67202cd1e343f01acdb8bb5ae0fe45d79124d6cea9d735cd1d48fd910ab51d08a71d2a1a9cfc13feed0eb670f5db72ed41e221ea9acd2a80b625dcee4dbc9b127a5c1699f216cf21006434d4c5310010001140661757261202dca9b1100000000045250535290d1d57e9d0d5db73e3d7ee30c13f3bdbe5c76ebd6c6b599754b4c79d5a73cbb9b32dcbf0705617572610101169e3d2549642cb4bafc93bab301681689de887285d2f20aad3c7d7ede4d472cea81d62a05107c34e1cb8ca99a9572ebd5d870c7edb13b6a869b7682c2af2586"), ("ZOMBIE_RC_OVERRIDES_PATH", "/home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/rc_overrides.json"), ("RUST_LOG", "doppelganger=debug"), ("ZOMBIE_INFO_PATH", "/home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/rc_info.txt"), ("ZOMBIE_RC_EPOCH_DURATION", "600")], injected_files: [], created_paths: [], db_snapshot: None, port_mapping: None, node_log_path: None }
2026-03-03T10:58:46.887918Z  INFO zombie_bite::sync: 📓 sync node logs: tail -f /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/sync-node/sync-node.log
Syncing..
2026-03-03T11:08:03.561395Z  INFO zombie_bite::sync: ✅ Synced (chain: kusama)
2026-03-03T11:08:03.561528Z  INFO zombie_bite::doppelganger:
📝 Generating chain-spec file /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/kusama-spec.json using cmd doppelganger with chain kusama without bootnodes...
2026-03-03T11:08:03.637619Z  INFO zombie_bite::doppelganger: ✅ generated with path /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/kusama-spec.json
2026-03-03T11:08:03.638637Z  INFO zombie_bite::doppelganger:
📝 Generating snapshot file /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/kusama-snap.tgz with data_path /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/sync-db...
2026-03-03T11:08:05.269821Z  INFO zombie_bite::doppelganger: ✅ generated with path /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/kusama-snap.tgz
2026-03-03T11:08:05.273846Z  INFO zombie_bite::doppelganger: renamed dir from /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite to /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite-debug
2026-03-03T11:08:05.274045Z  INFO zombie_bite::doppelganger: created dir /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite
2026-03-03T11:08:05.274059Z  INFO zombie_bite::doppelganger: mv /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite-debug/config.toml /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/config.toml
2026-03-03T11:08:05.274135Z  INFO zombie_bite::doppelganger: mv /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite-debug/kusama-spec.json /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/kusama-spec.json
2026-03-03T11:08:05.274190Z  INFO zombie_bite::doppelganger: mv /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite-debug/yap-3392-kusama-spec.json /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/yap-3392-kusama-spec.json
2026-03-03T11:08:05.274283Z  INFO zombie_bite::doppelganger: mv /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite-debug/yap-3392-kusama-snap.tgz /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/yap-3392-kusama-snap.tgz
2026-03-03T11:08:05.274379Z  INFO zombie_bite::doppelganger: mv /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite-debug/kusama-snap.tgz /home/ubuntu/workspace/zombie-bite/kusama-yap-3392-db/bite/kusama-snap.tgz
  • spawning the chain
PATH="/home/ubuntu/workspace/doppelganger-wrapper/target/release:$PATH" \
                                                                                ./target/release/zombie-bite spawn -d ./kusama-yap-3392-db -c kusama-yap3392.toml


2026-03-03T11:17:35.293370Z  INFO zombie_bite: Block #32503721
2026-03-03T11:17:39.259255Z  INFO zombie_bite: Block #32503722
2026-03-03T11:17:39.259282Z  INFO zombie_bite: 🚀🚀🚀 network is up and running..

cc @pepoviola @sandreim

lexnv added 4 commits March 3, 2026 09:41
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv self-assigned this Mar 3, 2026
@lexnv lexnv added the enhancement New feature or request label Mar 3, 2026
Comment thread src/config.rs
Comment on lines +522 to +527
if let Ok(port) = env::var("ZOMBIE_BITE_AH_PORT") {
let rpc_port = port.parse().expect("env var ZOMBIE_BITE_AH_PORT must be a valid u16");
col_builder.with_rpc_port(rpc_port)
} else {
col_builder
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This was added for the AHM project, but is not needed anymore and is the env var is set will cause issues since we will use the same port for all collators. Can you remove it directly?

Comment thread src/doppelganger.rs
// For custom paras, copy the user's chain spec and clear bootNodes
// instead of running `doppelganger-parachain build-spec` which may not
// understand arbitrary runtimes.
let spec_content = std::fs::read_to_string(&sync_chain)

@pepoviola pepoviola Mar 4, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
let spec_content = std::fs::read_to_string(&sync_chain)
let spec_content = tokio::fs::read_to_string(&sync_chain).await.unwrap();

Let use tokio::fs here as we use in the rest of the fn.

@pepoviola pepoviola left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good!! a couple of comments inline :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants