You can connect with a light client to any Substrate-compatible blockchai by using the
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
// (optional) add the parachain (of the above added relay chain) by providing the (strinfied) chainspec of the parachain