Skip to content

Commit 964a9ce

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 c7c2a54 commit 964a9ce

File tree

4 files changed

+864
-19
lines changed

4 files changed

+864
-19
lines changed

.github/workflows/cont_integration.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
- async-https-native
2828
- async-https-rustls
2929
- async-https-rustls-manual-roots
30+
- async-arti-hyper
31+
- async-arti-hyper-native
32+
- async-arti-hyper-rustls
3033
steps:
3134
- uses: actions/checkout@v3
3235
- name: Generate cache key
@@ -52,10 +55,11 @@ jobs:
5255
if: matrix.rust.version == '1.63.0'
5356
run: |
5457
cargo update -p home --precise 0.5.5
58+
cargo update -p tor-error --precise 0.4.1
5559
- name: Build
5660
run: cargo build --features ${{ matrix.features }} --no-default-features
5761
- name: Clippy
5862
if: ${{ matrix.rust.clippy }}
5963
run: cargo clippy --all-targets --features ${{ matrix.features }} --no-default-features -- -D warnings
6064
- name: Test
61-
run: cargo test --features ${{ matrix.features }} --no-default-features
65+
run: cargo test --features ${{ matrix.features }} --no-default-features -- --include-ignored

Cargo.toml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,39 @@ path = "src/lib.rs"
1818

1919
[dependencies]
2020
serde = { version = "1.0", features = ["derive"] }
21+
serde_json = { version = "1.0" }
2122
bitcoin = { version = "0.30.0", features = ["serde", "std"], default-features = false }
2223
# Temporary dependency on internals until the rust-bitcoin devs release the hex-conservative crate.
2324
bitcoin-internals = { version = "0.1.0", features = ["alloc"] }
2425
log = "^0.4"
25-
ureq = { version = "2.5.0", features = ["json"], optional = true }
26+
ureq = { version = "2.5.0", optional = true, features = ["json"]}
2627
reqwest = { version = "0.11", optional = true, default-features = false, features = ["json"] }
28+
hyper = { version = "0.14", optional = true, features = ["http1", "client", "runtime"], default-features = false }
29+
arti-hyper = { version = "0.8.3", optional = true, features = ["default"] }
30+
arti-client = { version = "0.8.3", optional = true }
31+
tor-rtcompat = { version = "0.8.2", optional = true, features = ["tokio"]}
32+
tls-api = { version = "0.9.0", optional = true }
33+
tls-api-native-tls = { version = "0.9.0", optional = true }
34+
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
35+
36+
[target.'cfg(target_vendor="apple")'.dependencies]
37+
tls-api-openssl = { version = "0.9.0", optional = true }
2738

2839
[dev-dependencies]
29-
serde_json = "1.0"
3040
tokio = { version = "1.20.1", features = ["full"] }
3141
electrsd = { version = "0.24.0", features = ["legacy", "esplora_a33e97e1", "bitcoind_22_0"] }
3242
electrum-client = "0.16.0"
3343
lazy_static = "1.4.0"
3444

3545
[features]
36-
default = ["blocking", "async", "async-https"]
46+
default = ["blocking", "async", "async-https", "async-arti-hyper"]
3747
blocking = ["ureq", "ureq/socks-proxy"]
3848
async = ["reqwest", "reqwest/socks"]
3949
async-https = ["async", "reqwest/default-tls"]
4050
async-https-native = ["async", "reqwest/native-tls"]
4151
async-https-rustls = ["async", "reqwest/rustls-tls"]
4252
async-https-rustls-manual-roots = ["async", "reqwest/rustls-tls-manual-roots"]
53+
# TODO: (@leonardo) Should I rename it to async-anonymized ?
54+
async-arti-hyper = ["hyper", "arti-client", "tor-rtcompat", "tls-api", "tls-api-native-tls", "tls-api-openssl", "arti-hyper"]
55+
async-arti-hyper-native = ["async-arti-hyper", "arti-hyper/native-tls"]
56+
async-arti-hyper-rustls = ["async-arti-hyper", "arti-hyper/rustls"]

0 commit comments

Comments
 (0)