Last active
April 30, 2022 11:01
-
-
Save chokosabe/8598f42cc865ca7cb042aeaf8ba57ce0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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