Skip to content

Commit 1156a48

Browse files
committed
feat: add new AsyncAnonymizedClient using arti-hyper
- feat: add new async client, `AsyncAnonymizedClient`, that uses `arti-hyper`, and `arti-client` to connect and do requests over the Tor network. - feat+test: add all methods and tests for `get_tx_..`, `Transaction` related endpoints. - feat+test: add all methods and tests for `get_block_...`, all `Block` related endpoints. - feat+test: add all methods and tests for `get_tx...`, all `TxId`,`Transaction` related endpoints.
1 parent 98edbc5 commit 1156a48

File tree

4 files changed

+863
-17
lines changed

4 files changed

+863
-17
lines changed

.github/workflows/cont_integration.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131
- async-https-native
3232
- async-https-rustls
3333
- async-https-rustls-manual-roots
34+
- async-arti-hyper
35+
- async-arti-hyper-native
36+
- async-arti-hyper-rustls
3437
steps:
3538
- uses: actions/checkout@v3
3639
- name: Generate cache key
@@ -58,10 +61,11 @@ jobs:
5861
cargo update -p zstd-sys --precise "2.0.8+zstd.1.5.5"
5962
cargo update -p time --precise "0.3.20"
6063
cargo update -p home --precise 0.5.5
64+
cargo update -p tor-error --precise 0.4.1
6165
- name: Build
6266
run: cargo build --features ${{ matrix.features }} --no-default-features
6367
- name: Clippy
6468
if: ${{ matrix.rust.clippy }}
6569
run: cargo clippy --all-targets --features ${{ matrix.features }} --no-default-features -- -D warnings
6670
- name: Test
67-
run: cargo test --features ${{ matrix.features }} --no-default-features -- --test-threads=1
71+
run: cargo test --features ${{ matrix.features }} --no-default-features -- --test-threads=1 --include-ignored

Cargo.toml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,30 @@ path = "src/lib.rs"
1818

1919
[dependencies]
2020
serde = { version = "1.0", features = ["derive"] }
21+
serde_json = { version = "1.0" }
2122
bitcoin = { version = "0.31.0", features = ["serde", "std"], default-features = false }
2223
hex = { package = "hex-conservative", version = "*" }
2324
log = "^0.4"
2425
minreq = { version = "2.11.0", features = ["json-using-serde"], optional = true }
2526
reqwest = { version = "0.11", optional = true, default-features = false, features = ["json"] }
27+
hyper = { version = "0.14", optional = true, features = ["http1", "client", "runtime"], default-features = false }
28+
arti-hyper = { version = "0.8.3", optional = true, features = ["default"] }
29+
arti-client = { version = "0.8.3", optional = true }
30+
tor-rtcompat = { version = "0.8.2", optional = true, features = ["tokio"]}
31+
tls-api = { version = "0.9.0", optional = true }
32+
tls-api-native-tls = { version = "0.9.0", optional = true }
33+
ahash = { version = "=0.8.6" } # ahash 0.8.7 version don't work with our MSRV on aarch64, check: https://github.com/tkaitchuck/aHash/issues/195
34+
35+
[target.'cfg(target_vendor="apple")'.dependencies]
36+
tls-api-openssl = { version = "0.9.0", optional = true }
2637

2738
[dev-dependencies]
28-
serde_json = "1.0"
2939
tokio = { version = "1.20.1", features = ["full"] }
3040
electrsd = { version = "0.27.0", features = ["legacy", "esplora_a33e97e1", "bitcoind_25_0"] }
3141
lazy_static = "1.4.0"
3242

3343
[features]
34-
default = ["blocking", "async", "async-https"]
44+
default = ["blocking", "async", "async-https", "async-arti-hyper"]
3545
blocking = ["minreq", "minreq/proxy"]
3646
blocking-https = ["blocking", "minreq/https"]
3747
blocking-https-rustls = ["blocking", "minreq/https-rustls"]
@@ -42,3 +52,7 @@ async-https = ["async", "reqwest/default-tls"]
4252
async-https-native = ["async", "reqwest/native-tls"]
4353
async-https-rustls = ["async", "reqwest/rustls-tls"]
4454
async-https-rustls-manual-roots = ["async", "reqwest/rustls-tls-manual-roots"]
55+
# TODO: (@leonardo) Should I rename it to async-anonymized ?
56+
async-arti-hyper = ["hyper", "arti-client", "tor-rtcompat", "tls-api", "tls-api-native-tls", "tls-api-openssl", "arti-hyper"]
57+
async-arti-hyper-native = ["async-arti-hyper", "arti-hyper/native-tls"]
58+
async-arti-hyper-rustls = ["async-arti-hyper", "arti-hyper/rustls"]

0 commit comments

Comments
 (0)