AcalaNetwork / chopsticks

Create parallel reality of your Substrate network.
Apache License 2.0
138 stars 84 forks source link

Chopsticks provider #432

Closed qiweiii closed 1 year ago

qiweiii commented 1 year 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 1 year 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 1 year 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 1 year 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 1 year ago

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

qiweiii commented 1 year 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 1 year ago

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