Providing settings for client
Before connecting with Substrate network, you need to provide all required settings. Here is a settings struct declaration:
All nodes are different, and their configurations are different.
For a regular Kusama node by Parity (kusama-rpc.polkadot.io
), you might provide rpcPath
, rpcParams
, webSocketPath
, webSocketParams
, webSocketPort
as nil. These will be fully ignored.
But for OnFinality nodes, with your own API key with RPC at https://kusama.api.onfinality.io/rpc?apikey=<YOUR_KEY>
and web socket as wss://kusama.api.onfinality.io/ws?apikey=<YOUR_KEY>
you need to provide settings like that:
Speaking of other parameters, runtimeMetadataUpdateTimeoutMs is delay in milliseconds (1 hour by default) which defines how often runtime metadata should be updated. Applicable only after your receive a runtime metadata at least once.
Naming policy is a enum:
It is used in all services to match your outgoing requests. If you're sure that you can provide pallets, constants, storage, and functions names exactly as they're declared in metadata, feel free to apply NONE policy to avoid extra computation.
Last updated