Skip to content

Commit

Permalink
feat(tor): use tor connector when building client
Browse files Browse the repository at this point in the history
  • Loading branch information
oleonardolima committed Sep 26, 2024
1 parent 1037c0d commit aad22e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2024-05-13"
channel = "nightly-2024-09-25"
components = ["rustfmt", "clippy"]
profile = "default"
7 changes: 5 additions & 2 deletions src/fedimint_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ impl FedimintClient {
let is_initialized = fedimint_client::Client::is_initialized(&db.clone().into()).await;

let mut client_builder = fedimint_client::Client::builder(db.into()).await?;
client_builder.with_tor_connector();

client_builder.with_module(WalletClientInit(None));
client_builder.with_module(MintClientInit);
client_builder.with_module(LightningClientInit::default());
Expand All @@ -99,9 +101,10 @@ impl FedimintClient {
e
})?,
)
} else if let FederationInviteOrId::Invite(i) = invite_or_id {
} else if let FederationInviteOrId::Invite(invite_code) = invite_or_id {
let download = Instant::now();
let config = fedimint_api_client::download_from_invite_code(&i)
let config = fedimint_api_client::api::net::Connector::Tor
.download_from_invite_code(&invite_code)
.await
.map_err(|e| {
error!("Could not download federation info: {e}");
Expand Down

0 comments on commit aad22e1

Please sign in to comment.