-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add light client platform WASM compatible #1026
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
a1a6178
Cargo update in prep for wasm build
lexnv 4f0f69e
Add light client test
lexnv 467a4e8
Implement low level socket
lexnv 52ee64d
Add native platform primitives
lexnv f2b3547
Add wasm platform primitives
lexnv 9a52898
Implement smoldot platform
lexnv ebb0ba8
Adjust code to use custom platform
lexnv a8576ac
Adjust feature flags
lexnv 4dec3b7
tests: Adjust wasm endpoint to accept ws for p2p
lexnv 2e660bb
Adjust wasm socket
lexnv f9b0834
Book mention of wasm
lexnv d23b398
ci: Propagate env variable properly
lexnv 03407cd
subxt: Revert to native feature flags
lexnv 540172f
cli: Use tokio rt-multi-thread feature
lexnv b25ce5c
subxt: Add tokio feature flags for native platform
lexnv ad33620
wasm: Use polkadot live for wasm testing
lexnv 8ba2e0f
wasm: Add support for DNS p2p addresses
lexnv 4452fc3
wasm: Disable logs
lexnv 1615313
wasm: Run wasm test for firefox driver
lexnv 680aadd
Merge remote-tracking branch 'origin/master' into lexnv/light_client_…
lexnv 1e8c949
wasm: Reenable chrome driver
lexnv 3a65573
Move lightclient RPC to dedicated crate for better feature flags and …
lexnv 5e850aa
Use subxt-lightclient low level RPC crate
lexnv 2b99fd4
Apply cargo fmt
lexnv a3eedc6
Enable default:native feature for cargo check
lexnv 2dc1384
ci: Extra step for subxt-lightclient similar to signer crate
lexnv 6223e05
Remove native platform code and use smoldot instead
lexnv 33880cc
codegen: Enable tokio/multi-threads
lexnv 290651d
lightclient: Refactor modules
lexnv a58f04f
Adjust testing crates
lexnv d119ae6
ci: Run light-client WASM tests
lexnv 95a9c8f
wasm-rpc: Remove light-client imports
lexnv 085d3dd
Merge remote-tracking branch 'origin/master' into lexnv/light_client_…
lexnv 4d4f085
testing: Update wasm cargo.lock files
lexnv 1293210
ci: Spawn substrate node with deterministic p2p address for WASM tests
lexnv a781435
wasm_socket: Use rc and refcell
lexnv 7178f55
Merge remote-tracking branch 'origin/master' into lexnv/light_client_…
lexnv 6c46995
wasm_socket: Switch back to Arc<Mutex<>>
lexnv e172bbb
Add comments
lexnv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
[package] | ||
name = "subxt-lightclient" | ||
version.workspace = true | ||
authors.workspace = true | ||
edition.workspace = true | ||
rust-version.workspace = true | ||
publish = true | ||
|
||
license.workspace = true | ||
readme = "../README.md" | ||
repository.workspace = true | ||
documentation.workspace = true | ||
homepage.workspace = true | ||
description = "Light Client for chain interaction" | ||
keywords = ["parity", "substrate", "blockchain"] | ||
|
||
[features] | ||
default = ["native"] | ||
|
||
# Enable this for native (ie non web/wasm builds). | ||
# Exactly 1 of "web" and "native" is expected. | ||
native = [ | ||
"smoldot-light/std", | ||
"tokio-stream", | ||
"tokio/sync", | ||
"tokio/rt", | ||
"futures-util", | ||
] | ||
|
||
# Enable this for web/wasm builds. | ||
# Exactly 1 of "web" and "native" is expected. | ||
web = [ | ||
"getrandom/js", | ||
|
||
"smoldot", | ||
"smoldot-light", | ||
"tokio-stream", | ||
"tokio/sync", | ||
"futures-util", | ||
|
||
# For the light-client platform. | ||
"wasm-bindgen-futures", | ||
"futures-timer/wasm-bindgen", | ||
"instant/wasm-bindgen", | ||
|
||
# For websocket. | ||
"js-sys", | ||
"send_wrapper", | ||
"web-sys", | ||
"wasm-bindgen", | ||
] | ||
|
||
[dependencies] | ||
futures = { workspace = true } | ||
serde = { workspace = true, features = ["derive"] } | ||
serde_json = { workspace = true, features = ["raw_value"] } | ||
thiserror = { workspace = true } | ||
tracing = { workspace = true } | ||
|
||
# Light client support: | ||
smoldot = { workspace = true, optional = true } | ||
smoldot-light = { workspace = true, optional = true } | ||
either = { workspace = true, optional = true } | ||
tokio = { workspace = true, optional = true } | ||
tokio-stream = { workspace = true, optional = true } | ||
futures-util = { workspace = true, optional = true } | ||
js-sys = { workspace = true, optional = true } | ||
send_wrapper = { workspace = true, optional = true } | ||
web-sys = { workspace = true, optional = true } | ||
wasm-bindgen = { workspace = true, optional = true } | ||
wasm-bindgen-futures = { workspace = true, optional = true } | ||
jsdw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
futures-timer = { workspace = true, optional = true } | ||
instant = { workspace = true, optional = true } | ||
tokio-util = { workspace = true, optional = true } | ||
|
||
# Included if "web" feature is enabled, to enable its js feature. | ||
getrandom = { workspace = true, optional = true } | ||
|
||
[profile.dev.package.smoldot-light] | ||
opt-level = 2 | ||
[profile.test.package.smoldot-light] | ||
opt-level = 2 | ||
[profile.dev.package.smoldot] | ||
opt-level = 2 | ||
[profile.test.package.smoldot] | ||
opt-level = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea to have this as a separate crate!