-
Notifications
You must be signed in to change notification settings - Fork 77
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
Running lightnode as a provider for ApiPromise gets stuck, for a parachain. #1486
Comments
Hi, Thanks for reporting this issue and for the amount of details provided in it. I noticed the following in your code-snipped: const relayProvider = new ScProvider(Sc, Sc.WellKnownChain.polkadot)
const provider = new ScProvider(Sc, parachainSpec, relayProvider)
console.time('connect')
await provider.connect() could you please try doing this, instead: const relayProvider = new ScProvider(Sc, Sc.WellKnownChain.polkadot)
const provider = new ScProvider(Sc, parachainSpec, relayProvider)
console.time('connect')
await relayProvider.connect()
await provider.connect() and let me know if that fixes the issue? 🙏 I know, I know... Why should you first connect to the relay-chain yourself, when the parachain provider knows about the existence of the relay-chain, right? Why doesn't it do it automatically for you? Great question! I wish I had a good answer for you 😅 In the meanwhile, could you please try that and let me know if that fixes the current issue? 🙏 Thanks! EDIT:FWIW: I'm don't think that what I've suggested will fix this issue. So, I'm going to first try and see if this is an issue with the |
Hi @fend25 ! So, I've did some digging and there seems to be an issue with the bootnodes of your chainspec? b/c Please have a look at this stackblitz demo, which produces the following output: |
Hi @josepot! Thank you for such warm response! Adding await |
Hi @fend25 ! Did you have a chance to review see my second response? 🙏 |
Yes, the second option works, but it only provides an RPC connection, as far as I can see. The initial idea was to seamlessly use the Polkadot.js library. However, given that I still require a fully synchronized node on the same host to quickly access historic data, making an HTTP request to localhost might not add significantly more overhead compared to using a light node. But it will require to manually parse encoded data from storage (for extrinsic args for example)... |
Issue Description
Hi!
I'm trying to connect to the Polkadot parachain called Unique, and I'm using the code from the documentation found at:
https://github.com/paritytech/substrate-connect/blob/main/packages/connect/README.md?plain=1#L58-L76
However, the code doesn't reach the initialization finish and gets stuck on the
await ApiPromise.create({provider})
expression, with a message printed once per minute, saying:And running almost the same code but for relay chain (I've tested Polkadot and Kusama) it's working properly and not getting stuck.
I'm running this code in Node.js, not in the browser. My goal is to write a block indexer, and my clue is that the light node should speed up scanning significantly.
Here's a gist to reproduce the issue with the code and chain spec: https://gist.github.com/fend25/bcff059ad868f95480c306c7d6ddc87e
Steps to reproduce the issue
Describe the results you received
Describe the results you expected
The expected result is that the code finishes the initialization and runs further.
Substrate-Connect version
0.7.30
Provider
Other (Specify below)
Browser version
node.js version 20.3.0
@substrate/[email protected]
@polkadot/[email protected]
@polkadot/[email protected]
Additional environment details
The same result is obtained on Ubuntu 20.04, macOS 13 and Windows 10.
The text was updated successfully, but these errors were encountered: