Skip to content

Improve RPC selection logic #5

@wottpal

Description

@wottpal

Currently, the RPC selection is too simple. It picks the first item in the rpcUrls array of a SubstrateChain (see https://github.com/scio-labs/use-inkathon/blob/main/src/provider.tsx#L82) and creates a WsProvider object (which even fails if the provided url is not a websocket).

  • It must be determined whether it's a wss/https rpc url (e.g. via regex) and create the according provider object
  • If an RPC connection fails multiple times it should try the next rpc (until the first one works). Otherwise, providing a full list of RPCs somehow makes no sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions