0

I don't see any support for connecting via the substract-connect library for a sovereign chain. E.g. the addChain function has a dependency on the relay chain.

Is there some way to connect to a custom solo chain through this library that I am not seeing? If not, is there a plan to add support?

3
  • Hi @justin-frevert, I think is possible. You can check this code used to run the zombienet tests github.com/paritytech/substrate-connect/blob/…
    – pepoviola
    Jul 10, 2023 at 14:46
  • AFAIK: it should work using the normal addChain function and then passing the chain-spec of your "sovereign chain". Did you try that already? For it to work, though, make sure that there are boot-nodes defined inside the chain-spec.
    – Josep
    Jul 10, 2023 at 18:55
  • Depends on what kind of custom solo chain you are talking about. Smoldot is only capable of connecting to a solo (relay) chain like polkadot, kusame, rococo & westend. Jul 11, 2023 at 8:28

1 Answer 1

1

You can connect with a light client to any Substrate-compatible blockchai by using the addChain function.

To connect to that chain you need to initialize the light client and then call the addChain for your substrate chain (or the addWellKnownChain for any of the polkadot, kusama, westend and/or rococo) on this client.

Connecting to a parachain is done the same way as connecting to a standalone chain, by init-ing a client and then calling addChain. The difference here is that if you call addChain with a parachain chain specification, you must have connected to its corresponding relay chain beforehand (using again the same function addChain. Failing to do so will lead to an error at the initialization of the parachain.

For example the following would work:

// initializethe client
const client = createScClient();
// add the desired chain by providing the (stringified) chainspec
await client.addChain(relayChain);

// (optional) add the parachain (of the above added relay chain) by providing the (strinfied) chainspec of the parachain
await client.addChain(parachain);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.