0xMiden / 0xMiden/rust-sdk

Introduce `rpc-client`, `web-rpc-client` & `web-objects` crates

Aperta
#1,423 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
78
Fork
129
Merge medio
4g 14h
PR unite (30g)
52

Descrizione

While working on a separated tool that requires RPC interactions with `miden-node`, I found that using `miden-client` as a dependency was the only way to do it, which was kinda annoying because I didn't want to install a bloat of dependencies that I wouldn't use (CLI, tx proving, stores, etc.). Eventually I found a way to flesh out most of the features and having RPC only, which did work but wasn't ideal.

Long term, I believe there must be a separation of concerns between "CLI interface" and "client libraries" in `miden-client`, as they serve different needs and from the developers perspective is much better to have targeted dependencies that serve specific proposes, than doing mini-hacks on the `miden-client`.

So my initial improvement approach was to [open a PR](https://github.com/0xMiden/miden-client/pull/1411) decoupling the RPC from the rust-client by exposing a crate `rpc-client` in rust for direct node interaction

Then, after a conversation with @Dominik1999, I realized that there must be a mirroring between rust <> web bindings in all the APIs, which makes total sense but introduces a new challenge: decoupling web APIs implies copying all the base web bindings across any new web crate.

So my proposal is to follow a similar pattern as in the rust crates, create a base `web-objects` crate that serves as the base dependency for any web crate.

Then the "decoupling" process for the RPC client would be:
1. Create a standalone rust crate: [rpc-client PR](https://github.com/0xMiden/miden-client/pull/1411)
2. Create a `web-objects` crate that contains the web bindings for all the base models (initially at least including the ones needed for rpc interactions)
3. Create a `web-rpc-client` crate that uses `web-objects` as dependency and exposes a lean RPC client for the web.

Maybe is a bit premature, but I think is the right choice medium/long term for DX (internal and external).
I'm probably missing some context about the releasing process, testing, etc.
Happy to hear opinions :)

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.