Skip to content

Commit db4554f

Browse files
committed
Test against mainnet servers
1 parent f37bcd5 commit db4554f

35 files changed

+84
-273
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ language: rust
22
rust:
33
- stable
44
# - 1.31.0 TODO: support the first 2018-edition toolchain
5+
env:
6+
- TEST_ELECTRUM_SERVER=electrum.blockstream.info:50001
7+
- TEST_ELECTRUM_SERVER=bitcoin.aranguren.org:50001
58
before_script:
69
- rustup component add rustfmt
710
# Run tests and check a few combinations of features

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ documentation = "https://docs.rs/electrum-client/"
99
description = "Bitcoin Electrum client library. Supports plaintext, TLS and Onion servers."
1010
keywords = ["bitcoin", "electrum"]
1111
readme = "README.md"
12-
exclude = [
13-
"test_data/*",
14-
]
1512

1613
# loosely based on https://github.com/evgeniy-scherbina/rust-electrumx-client
1714

examples/plaintext.rs

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,9 @@
11
extern crate electrum_client;
2-
extern crate env_logger;
3-
4-
use std::sync::Arc;
5-
use std::thread;
62

73
use electrum_client::Client;
84

95
fn main() {
10-
env_logger::init();
11-
12-
let client = Arc::new(Client::new("electrum.blockstream.info:50001").unwrap());
13-
14-
let mut handles = Vec::new();
15-
16-
/*let _client = Arc::clone(&client);
17-
let handle = thread::spawn(move || {
18-
_client.reader_thread().unwrap();
19-
println!("reader thread exited");
20-
});
21-
22-
handles.push(handle);*/
23-
24-
thread::sleep(std::time::Duration::from_secs(1));
25-
26-
for _ in 0..4 {
27-
let client = Arc::clone(&client);
28-
let handle = thread::spawn(move || {
29-
let res = client.batch_estimate_fee(vec![1, 3, 6, 12]);
30-
println!("{:?}", res);
31-
});
32-
33-
handles.push(handle);
34-
}
35-
36-
for h in handles {
37-
h.join().unwrap();
38-
}
6+
let client = Client::new("kirsche.emzy.de:50001").unwrap();
7+
let res = client.server_features();
8+
println!("{:#?}", res);
399
}

examples/ssl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ extern crate electrum_client;
33
use electrum_client::Client;
44

55
fn main() {
6-
let mut client = Client::new_ssl("electrum2.hodlister.co:50002", true).unwrap();
6+
let client = Client::new_ssl("electrum2.hodlister.co:50002", true).unwrap();
77
let res = client.server_features();
88
println!("{:#?}", res);
99
}

examples/tor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ fn main() {
66
// NOTE: This assumes Tor is running localy, with an unauthenticated Socks5 listening at
77
// localhost:9050
88

9-
let mut client = Client::new_proxy("ozahtqwp25chjdjd.onion:50001", "127.0.0.1:9050").unwrap();
9+
let client = Client::new_proxy("ozahtqwp25chjdjd.onion:50001", "127.0.0.1:9050").unwrap();
1010
let res = client.server_features();
1111
println!("{:#?}", res);
1212

1313
// works both with onion v2/v3 (if your Tor supports them)
14-
let mut client = Client::new_proxy(
14+
let client = Client::new_proxy(
1515
"v7gtzf7nua6hdmb2wtqaqioqmesdb4xrlly4zwr7bvayxv2bpg665pqd.onion:50001",
1616
"127.0.0.1:9050",
1717
)

0 commit comments

Comments
 (0)