You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Considering the following example (not in the repo):
use jsonrpsee::ws_client::WsClientBuilder;
use std::env;
fn get_ws_node() -> String {
env::var("POLKADOT_WS").unwrap_or("ws://localhost:9944".to_string())
}
#[tokio::main]
async fn main() -> anyhow::Result<()> {
env_logger::init();
let url = String::from(get_ws_node());
println!("Connecting to {:?}", &url);
let client = WsClientBuilder::default().build(&url).await?;
assert!(client.is_connected());
println!("connected");
Ok(())
}
This will succeed:
POLKADOT_WS=wss://rpc.polkadot.io c run --example ws_polkadot
But this will fail despite the endpoint to be valid and up:
POLKADOT_WS=wss://polkadot.api.onfinality.io/public-ws c run --example ws_polkadot
Finished dev [unoptimized + debuginfo] target(s) in 0.13s
Running `target/debug/examples/ws_polkadot`
Connecting to "wss://polkadot.api.onfinality.io/public-ws"
Error: Networking or low-level protocol error: Couldn't find any IP address for this hostname
Caused by:
Couldn't find any IP address for this hostname
The text was updated successfully, but these errors were encountered:
Considering the following example (not in the repo):
This will succeed:
But this will fail despite the endpoint to be valid and up:
The text was updated successfully, but these errors were encountered: