subxt: Expose light client under experimental feature-flag

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2023-05-18 20:05:42 +03:00
parent e9a6491243
commit 2efdef1995
3 changed files with 27 additions and 0 deletions
+5
View File
@@ -73,6 +73,11 @@ wabt = "0.10.0"
wasm-bindgen-test = "0.3.24"
which = "4.4.0"
# Light client support:
smoldot-light = { git = "https://github.com/smol-dot/smoldot.git", default-features = false }
tokio-stream = "0.1.14"
futures-util = "0.3.28"
# Substrate crates:
sp-core = { version = "20.0.0", default-features = false }
sp-core-hashing = "8.0.0"
+16
View File
@@ -40,6 +40,16 @@ jsonrpsee-web = ["jsonrpsee/async-wasm-client", "jsonrpsee/client-web-transport"
# latest features exposed by the metadata.
unstable-metadata = []
# Activate this to expose the Light Client functionality.
# Note that this feature is experimental and things may break or not work as expected.
experimental-light-client = [
"smoldot-light/std",
"tokio-stream",
"tokio/sync",
"tokio/rt",
"futures-util",
]
[dependencies]
codec = { package = "parity-scale-codec", workspace = true, features = ["derive"] }
scale-info = { workspace = true }
@@ -78,6 +88,12 @@ sp-runtime = { workspace = true, optional = true }
subxt-macro = { workspace = true }
subxt-metadata = { workspace = true }
# Light client support:
smoldot-light = { workspace = true, optional = true }
tokio = { workspace = true, optional = true }
tokio-stream = { workspace = true, optional = true }
futures-util = { workspace = true, optional = true }
[target.wasm32-unknown-unknown.dependencies]
getrandom = { workspace = true, features = ["js"] }
+6
View File
@@ -47,6 +47,9 @@
#[cfg(feature = "jsonrpsee")]
mod jsonrpsee_impl;
#[cfg(feature = "experimental-light-client")]
mod lightclient;
mod rpc;
mod rpc_client;
mod rpc_client_t;
@@ -62,3 +65,6 @@ pub use rpc_client_t::{
};
pub use rpc_client::{rpc_params, RpcClient, RpcParams, Subscription};
#[cfg(feature = "experimental-light-client")]
pub use lightclient::{LightClient, LightClientError};