Skip to content

Commit

Permalink
feat: add new AsyncAnonymizedClient using arti-hyper
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
oleonardolima committed Jan 27, 2024
1 parent c7c2a54 commit 964a9ce
Show file tree
Hide file tree
Showing 4 changed files with 864 additions and 19 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
- async-https-native
- async-https-rustls
- async-https-rustls-manual-roots
- async-arti-hyper
- async-arti-hyper-native
- async-arti-hyper-rustls
steps:
- uses: actions/checkout@v3
- name: Generate cache key
Expand All @@ -52,10 +55,11 @@ jobs:
if: matrix.rust.version == '1.63.0'
run: |
cargo update -p home --precise 0.5.5
cargo update -p tor-error --precise 0.4.1
- name: Build
run: cargo build --features ${{ matrix.features }} --no-default-features
- name: Clippy
if: ${{ matrix.rust.clippy }}
run: cargo clippy --all-targets --features ${{ matrix.features }} --no-default-features -- -D warnings
- name: Test
run: cargo test --features ${{ matrix.features }} --no-default-features
run: cargo test --features ${{ matrix.features }} --no-default-features -- --include-ignored
20 changes: 17 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,39 @@ path = "src/lib.rs"

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" }
bitcoin = { version = "0.30.0", features = ["serde", "std"], default-features = false }
# Temporary dependency on internals until the rust-bitcoin devs release the hex-conservative crate.
bitcoin-internals = { version = "0.1.0", features = ["alloc"] }
log = "^0.4"
ureq = { version = "2.5.0", features = ["json"], optional = true }
ureq = { version = "2.5.0", optional = true, features = ["json"]}
reqwest = { version = "0.11", optional = true, default-features = false, features = ["json"] }
hyper = { version = "0.14", optional = true, features = ["http1", "client", "runtime"], default-features = false }
arti-hyper = { version = "0.8.3", optional = true, features = ["default"] }
arti-client = { version = "0.8.3", optional = true }
tor-rtcompat = { version = "0.8.2", optional = true, features = ["tokio"]}
tls-api = { version = "0.9.0", optional = true }
tls-api-native-tls = { version = "0.9.0", optional = true }
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

[target.'cfg(target_vendor="apple")'.dependencies]
tls-api-openssl = { version = "0.9.0", optional = true }

[dev-dependencies]
serde_json = "1.0"
tokio = { version = "1.20.1", features = ["full"] }
electrsd = { version = "0.24.0", features = ["legacy", "esplora_a33e97e1", "bitcoind_22_0"] }
electrum-client = "0.16.0"
lazy_static = "1.4.0"

[features]
default = ["blocking", "async", "async-https"]
default = ["blocking", "async", "async-https", "async-arti-hyper"]
blocking = ["ureq", "ureq/socks-proxy"]
async = ["reqwest", "reqwest/socks"]
async-https = ["async", "reqwest/default-tls"]
async-https-native = ["async", "reqwest/native-tls"]
async-https-rustls = ["async", "reqwest/rustls-tls"]
async-https-rustls-manual-roots = ["async", "reqwest/rustls-tls-manual-roots"]
# TODO: (@leonardo) Should I rename it to async-anonymized ?
async-arti-hyper = ["hyper", "arti-client", "tor-rtcompat", "tls-api", "tls-api-native-tls", "tls-api-openssl", "arti-hyper"]
async-arti-hyper-native = ["async-arti-hyper", "arti-hyper/native-tls"]
async-arti-hyper-rustls = ["async-arti-hyper", "arti-hyper/rustls"]
Loading

0 comments on commit 964a9ce

Please sign in to comment.