Skip to content
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

Simplify Zombienet SDK DX #251

Open
ozgunozerk opened this issue Aug 28, 2024 · 5 comments · May be fixed by #261
Open

Simplify Zombienet SDK DX #251

ozgunozerk opened this issue Aug 28, 2024 · 5 comments · May be fixed by #261
Assignees
Labels
enhancement New feature or request

Comments

@ozgunozerk
Copy link
Contributor

ozgunozerk commented Aug 28, 2024

Is your feature request related to a problem? Please describe.

Current state of zombienet-sdk is feature-rich, but lacks ease of use for many setting that can be hidden for most of the users by utilizing defaults.

Simplifying the devx may increase and improve adoption, popularity, and open-source contribution.

Describe the solution you'd like

What I have in mind is roughly:

let alice = ZombieNode::new("alice");
let bob = ZombieNode::new("bob");

let collator1 = ZombieCollator::new("collator1");
let collator2 = ZombieCollator::new("collator2");

let parachain = ZombieParachain::new().set_id(100).set_collators(collator1, collator2);

let zombienet = Zombienet::new() // also possible to supply a `config` file here by calling `from()` method
		.set_nodes(alice, bob)
		.set_parachains(parachain)
		.spawn();
	
let alice_client: subxt_client = zombienet.get_client("alice");

/*
	Here, we can use `alice_client` to submit any transaction or query the blockchain,
	any subxt (polkadotjs) functionality is exposed via `alice_client` here
*/

Describe alternatives you've considered

No response

Additional context

We met with @pepoviola and we are on the same page.

We want to preserve the builder and type-state-pattern, to enforce compile time checks and errors for the users.

This feature will not rewrite everything from scratch, but will act as a wrapper on top of the current code. Thus, preserve the safety measures that are already there

@ozgunozerk
Copy link
Contributor Author

Feel free to assign this issue to me.

I'll submit a draft PR to have the discussion there and keep this issue compact for newcomers.

@jmg-duarte
Copy link

On this, I'd re-export all zombienet_* crates with the SDK, instead of depending on them but requiring them to be explicitly added to the project instead.

I keep needing to add more stuff to the Cargo.toml that should just be in the SDK

@pepoviola
Copy link
Collaborator

I think we coukd re-export the crates or in this case just create the wrappers as part of the sdk crate itself. Thoughts @ozgunozerk ?

@ozgunozerk
Copy link
Contributor Author

I don't have any strong preferences, as you guys see fit! @pepoviola I want to start on the implementation, did you have a chance to check out the draft PR for the more elaborate and concrete API design?

@ozgunozerk
Copy link
Contributor Author

Update: I have something ready, will polish it and submit it soon!

@ozgunozerk ozgunozerk linked a pull request Sep 21, 2024 that will close this issue
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 a pull request may close this issue.

3 participants