Skip to content
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

feat: wasm support for browser #204

Merged

Conversation

Officeyutong
Copy link
Collaborator

@Officeyutong Officeyutong commented Dec 1, 2024

This PR adds support for running light client in browser, including the following major changes:

  • Split light-client into light-client-lib, light-client-bin, and light-client-wasm
  • Uses IndexedDB in browser instead of RocksDB
  • Adds light-client-db-worker to provide sync API access for IndexedDB
  • Adds light-client-js as a JS API wrapper for frontend developers, with type definition from @ckb-ccc/core and similar APIs like RPC client
  • Adds webpack/esbuild configuration for light-client-wasm, light-client-db-worker and light-client-js, making them easy to be published to registries like npm

Things need to be done:

@Hanssen0
Copy link

Hanssen0 commented Dec 3, 2024

CCC fix released in ckb-devrel/ccc#93

@Officeyutong Officeyutong reopened this Dec 3, 2024
@Officeyutong
Copy link
Collaborator Author

(Mis-clicked to close, please ignore that)

@Hanssen0
Copy link

Hanssen0 commented Dec 3, 2024

CCC fix released in ckb-devrel/ccc#93

But I didn't find any changes related to code in this PR, seems something was forgotten

ckb-devrel/ccc#92 is the fix, and ckb-devrel/ccc#93 is the release of the fix. The fix was included in the changelog.

@Officeyutong
Copy link
Collaborator Author

CCC fix released in ckb-devrel/ccc#93

But I didn't find any changes related to code in this PR, seems something was forgotten

ckb-devrel/ccc#92 is the fix, and ckb-devrel/ccc#93 is the release of the fix. The fix was included in the changelog.

I found it just now, thank you!

light-client-lib/src/storage/mod.rs Outdated Show resolved Hide resolved
light-client-lib/src/storage/mod.rs Outdated Show resolved Hide resolved
yangby-cryptape

This comment was marked as resolved.

Copy link
Collaborator

@yangby-cryptape yangby-cryptape left a comment

Choose a reason for hiding this comment

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

Rust part LGTM.

light-client-bin/.gitignore Show resolved Hide resolved
light-client-lib/src/protocols/filter/block_filter.rs Outdated Show resolved Hide resolved
light-client-lib/src/protocols/filter/block_filter.rs Outdated Show resolved Hide resolved
light-client-lib/src/protocols/filter/block_filter.rs Outdated Show resolved Hide resolved
wasm/light-client-js/README.md Outdated Show resolved Hide resolved
@quake quake merged commit da9fa4c into nervosnetwork:develop Jan 21, 2025
7 checks passed
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.

6 participants