Introduce `rpc-client`, `web-rpc-client` & `web-objects` crates
- 主要語言
- Rust
- 星號
- 78
- 分支
- 129
- 平均合併
- 4 天 14 小時
- 30 天內合併 PR
- 52
描述
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 :)
貢獻指南
評估
這個 Issue 還沒有評估資料。