Skip to content

Unsure how to use AbstractWsClient #5

@ltfschoen

Description

@ltfschoen

@wuminzhe @itering recently i presented this repository at a BlockspaceDevRel event as part of Consensus 2024, as I was interested in encouraging its use. Here are the slides https://hackmd.io/@ltfschoen/Hy25QTH40#/.
I have a question, is it possible to use this scale_rb library to connect to a local Substrate-based node using Ws instead of Http? If so how?
There is a AbstractWsClient here https://github.com/wuminzhe/scale_rb/blob/main/lib/client/abstract_ws_client.rb#L6, but could you please share an example of how to use it?
Or if the Ws capability is incomplete, do you have any tips on how I could add that capability?
Should it be added similar to the deprecated repository https://github.com/itering/substrate_client.rb?tab=readme-ov-file#supported-rpc-methods where it was possible to connect using Ws using:

require "substrate_client"
client = SubstrateClient.new("wss://kusama-rpc.polkadot.io/")

I was only able to connect using Http in my fork of this repo in this example https://github.com/ltfschoen/scale_rb/blob/easya/example01/main.rb#L3 based on reviewing the code in this repository.
The reason why I want to connect using Websockets is because most of the available parachain endpoints are Ws endpoints, I'd only use Http for connecting to a Substrate-based node running on localhost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions