0xMiden / 0xMiden/rust-sdk

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

Abierto
#1,423 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
78
Forks
129
Merge medio
4 d 14 h
PR fusionados (30 d)
52

Descripción

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 :)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.