Skip to content

Instantly share code, notes, and snippets.

@chokosabe
Last active April 30, 2022 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chokosabe/8598f42cc865ca7cb042aeaf8ba57ce0 to your computer and use it in GitHub Desktop.
Save chokosabe/8598f42cc865ca7cb042aeaf8ba57ce0 to your computer and use it in GitHub Desktop.
[package]
name = "ws-test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tokio = { version = "1.18.0", features = ["full"] }
jsonrpsee = { version = "0.11.0", features = ["full"] }
url = "2.2.2"
use jsonrpsee::ws_client::WsClientBuilder;
use tokio::sync::broadcast;
#[tokio::main]
async fn main() {
let addr = "wss://kusama-rpc.polkadot.io";
let port_number = "443";
println!("Using port number {}", port_number);
let url = format!("wss://{addr}:{port_number");
println!("The url is {url}");
let client = WsClientBuilder::default().build(&url).await.unwrap();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment