Skip to content

feat(truapi-provider): native and wasm ChainProvider with WebSocket and embedded smoldot backends#276

Draft
BigTava wants to merge 29 commits into
mainfrom
tiago-truapi-provider
Draft

feat(truapi-provider): native and wasm ChainProvider with WebSocket and embedded smoldot backends#276
BigTava wants to merge 29 commits into
mainfrom
tiago-truapi-provider

Conversation

@BigTava

@BigTava BigTava commented Jul 13, 2026

Copy link
Copy Markdown

Summary

  • Adds the truapi-provider crate: a native and wasm32 implementation of truapi_platform::ChainProvider whose per-chain backend is a remote WebSocket JSON-RPC node or an embedded smoldot light client.
  • Serves one embedded smoldot light client per provider so host-internal flows and product connections share sync, peers, and warm state, while each connection keeps an isolated JSON-RPC pipe.

@BigTava BigTava requested a review from a team July 13, 2026 20:40
@BigTava BigTava marked this pull request as draft July 13, 2026 20:45
@socket-security

socket-security Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​uniffi@​0.28.31001009310070
Addedcargo/​tokio-tungstenite@​0.24.09910093100100

View full report

BigTava added 13 commits July 13, 2026 22:03
…d-client locks, panic-free light-client builder, and Apache-2.0 attribution for the vendored platform
… GenericError, and require at least one backend feature
…ed platform client identity, a WS disconnect test, and doc/dep-pin notes
@pgherveou

Copy link
Copy Markdown
Collaborator

For reference, the design so far has been

  • the core builds, signs, and submits the Transaction, routing chain traffic through
  • the host's own the JSON-RPC connection

Owning the connection end to end make sense as well, but might require some research as well to understand the trade-off, especially on native platform like iOS where a networking stack built on top of the Native SDK might benefit
be more efficient.

Anyway that should not prevent you from testing this PR out.
I would make also the required changes to the dotli submodule, (maybe merge main first and branch of the submodule in hosts/dotli from the current sha).

The core should probably now own the networking settings preference that currently live in dotli

Comment thread rust/crates/truapi-provider/src/config.rs Outdated
/// Warm-start database blob previously returned by the
/// `chainHead_unstable_finalizedDatabase` JSON-RPC function. Invalid
/// blobs are silently ignored by smoldot.
database_content: Option<String>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is that a String?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Isn't this returned as a String in smoldot? Happy to change it.

Comment thread rust/crates/truapi-provider/src/config.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants