-
Notifications
You must be signed in to change notification settings - Fork 228
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
Expose light client verifier to JavaScript #671
Conversation
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.
Thank you! Some first thoughts here
@@ -0,0 +1,6 @@ | |||
/target |
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.
Regarding the empty file above: As far as I know, .cargo-ok
can be deleted.
@@ -0,0 +1,38 @@ | |||
[package] | |||
name = "wasm-client" |
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.
Suggestion: rename to something like "js-verifier" or "light-client-js" because wasm-bindgen
binds to JS only.
@@ -0,0 +1,176 @@ | |||
Apache License |
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.
Should not be needed since there is a LICENSE in the repo root
@@ -0,0 +1,25 @@ | |||
Copyright (c) 2018 Romain Ruetschi <[email protected]> |
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.
Should not be needed since there is a LICENSE in the repo root
name = "wasm-client" | ||
version = "0.1.0" | ||
authors = ["Romain Ruetschi <[email protected]>"] | ||
edition = "2018" |
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.
license
entry here would be nice
@@ -0,0 +1,5 @@ | |||
language: node_js |
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.
I think this file is not needed
@@ -0,0 +1,201 @@ | |||
Apache License |
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.
Should not be needed since there is a LICENSE in the repo root
@@ -0,0 +1,25 @@ | |||
Copyright (c) [year] [name] |
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.
Should not be needed since there is a LICENSE in the repo root
"rust", | ||
"webpack" | ||
], | ||
"author": "Ashley Williams <[email protected]>", |
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.
"author": "Ashley Williams <[email protected]>", | |
"contributors": ["Romain Ruetschi <[email protected]>"], |
ce0b311
to
92f222f
Compare
This PR made the following dependency changes: Added Packages (Duplicate versions in '()'):
bumpalo 3.4.0
console_error_panic_hook 0.1.6
js-sys 0.3.46
scoped-tls 1.0.0
wasm-bindgen 0.2.69
wasm-bindgen-backend 0.2.69
wasm-bindgen-futures 0.4.19
wasm-bindgen-macro 0.2.69
wasm-bindgen-macro-support 0.2.69
wasm-bindgen-shared 0.2.69
wasm-bindgen-test 0.3.19
wasm-bindgen-test-macro 0.3.19
wasm-client 0.1.0
web-sys 0.3.46
|
See: #463
Basic prototype that exposes the verifier to JS via wasm-pack/wasm-bindgen.
Rust wrapper: https://github.com/informalsystems/tendermint-rs/blob/romac/wasm-verifier/wasm-client/src/lib.rs
Usage from JS: https://github.com/informalsystems/tendermint-rs/blob/romac/wasm-verifier/wasm-client/app/index.js
To make this work, one currently has to:
wasm-pack build
from within thewasm-client
folderapp
directory and runnpm start
http://localhost:8080/
and look at the console