AcalaNetwork / chopsticks

Create parallel reality of your Substrate network.
Apache License 2.0
134 stars 80 forks source link

Chopsticks provider #432

Closed qiweiii closed 11 months ago

qiweiii commented 11 months ago

related: https://github.com/polkadot-js/apps/issues/9903

A provider that can be used in ApiPromise, to be integrated here: https://github.com/polkadot-js/apps/compare/master...qiweiii:polkadot-js-apps:integrate-chopsticks

Todo

https://github.com/AcalaNetwork/chopsticks/assets/32790369/e9ee6d6a-45e9-48d3-aaad-441b0a28aa8a

ermalkaleci commented 11 months ago

the only way to make this work on polkadot.js.org/apps is to run chopsticks on background, otherwise this is unusable

xlc commented 11 months ago

@ermalkaleci you mean the wasm execution will freeze UI by blocking the main therad? in that case yeah we need a web worker

ermalkaleci commented 11 months ago

@ermalkaleci you mean the wasm execution will freeze UI by blocking the main therad? in that case yeah we need a web worker

yes

ermalkaleci commented 11 months ago

I think ChopsticksProvider can start a web worker that contains blockchain setup and use post message for rpc calls

qiweiii commented 11 months ago

Yea when I was trying to test tx and it keeps hanging, so I need to setup chain in a web worker

qiweiii commented 11 months ago

Todo in future: node.js compatibility, issue: https://github.com/AcalaNetwork/chopsticks/issues/446