bitcoindevkit / rust-electrum-client

Bitcoin Electrum client library. Supports plaintext, TLS and Onion servers.
MIT License
79 stars 64 forks source link

[error] Example code does not work #144

Open ssantos21 opened 2 months ago

ssantos21 commented 2 months ago

If you run the example code, you' ll get the error:

let client = Client::new("ssl://electrum.blockstream.info:50002").unwrap();
let res = client.server_features();
println!("{:#?}", res);
Err(
    AllAttemptsErrored(
        [
            JSON(
                Error("EOF while parsing a value", line: 1, column: 0),
            ),
        ],
    ),
)

I tried other Electrum servers and the results were the same. In my Cargo.toml the version is 0.21.0.

[dependencies]
electrum-client = "0.21.0"
sansosti commented 2 months ago

same error here

oleonardolima commented 2 months ago

It's weird, it worked once for me and then it started failing. I'll take a better look at it.

sansosti commented 2 months ago

I run the example code again today and it worked fine. Something going on with electrum.blockstream.info:50002?

oleonardolima commented 2 months ago

I run the example code again today and it worked fine. Something going on with electrum.blockstream.info:50002?

That would be my guess, but still, I think it can be a better error message if it's a specific one from their side.

ssantos21 commented 2 months ago

I don't think so. If you try other servers (Electrum wallet shows multiple servers), you will notice the same issue. Maybe something intermittent?

sansosti commented 2 months ago

definitely something intermittent, as - right after I said it was working fine for me - it started failing again!