-
Notifications
You must be signed in to change notification settings - Fork 70
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
WASM Client Features #1339
Comments
So I just tested disconnection/reconnection behavior. Detection of network loss takes around 10-12 seconds (all peers leave and consensus is marked as "lost" when the number of peers drop under the configured minimum). However, when network is reconnected, the client does not start reconnecting by itself. So we need a way to tell it to start connecting again. Or we need to kill it and start a new client, but the first option would be better. |
As for the export of further primitives and structs, we will run into various problems with Rust things that wasm-bindgen does not (yet) support:
I think exposing these extra classes to JS would require proxying them by structs that wasm-bindgen understands. Related wasm-bindgen issue and incomplete draft PR for trait impls. |
Proxying the structs we want to expose could look like this: eee2035. This creates a Doing this for all classes we want to expose and their APIs will be a lot of work though. |
I extended the proof-of-concept for the proxied structs in 64714ad. One thing to note is that every struct that is passed to JS is pushed onto the WASM stack, and only removed when its
|
Good news! wasm-bindgen actually supports automatic freeing of the rust struct when the Javascript reference is dereferenced (i.e. garbage collected). wasm-pack also merged support for it, but has not released a new version with it. It can however be enabled by an environment flag: Enabling this feature requires support for So I'd say let's enable that and pass structs to JS to our heart's content! 👌 |
All items are now addressed with the exception of multisig which will be tracked in a different issue as documented in the issue description. |
SerialBuffer, etc. Sign a transaction with my PrivateKeysign()
method does not support it.client.waitForConsensusEstablished()
#1418getTransactionsByAddress
:(address, sinceBlockHeight, knownTransactionDetails, limit)
getTransactionReceiptsByAddress(address, limit)
Transaction | PlainTransaction | string
forsendTransaction
getTransaction(hash, blockHash, blockHeight)
getTransactionReceipt(hash)
getTransactionReceiptsByHashes(hashes)
The text was updated successfully, but these errors were encountered: