Skip to content

Commit

Permalink
Re-export geo topology types
Browse files Browse the repository at this point in the history
  • Loading branch information
octol committed Sep 30, 2023
1 parent 1801e13 commit 867716e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 2 additions & 6 deletions sdk/rust/nym-sdk/examples/geo_topology_provider.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Copyright 2023 - Nym Technologies SA <[email protected]>
// SPDX-License-Identifier: Apache-2.0

use nym_client_core::client::topology_control::geo_aware_provider::{
CountryGroup, GeoAwareTopologyProvider,
};
use nym_client_core::config::GroupBy;
use nym_sdk::mixnet;
use nym_sdk::mixnet::MixnetMessageSender;

Expand All @@ -15,13 +11,13 @@ async fn main() {
let nym_api = "https://validator.nymtech.net/api/".parse().unwrap();

// We can group on something which is to a first approximation a continent.
let group_by = GroupBy::CountryGroup(CountryGroup::Europe);
let group_by = mixnet::GroupBy::CountryGroup(mixnet::CountryGroup::Europe);

// ... or on a nym-address. This means we use the geo location of the gateway that the
// nym-address is connected to.
//let group_by = GroupBy::NymAddress("id.enc@gateway".parse().unwrap());

let geo_topology_provider = GeoAwareTopologyProvider::new(
let geo_topology_provider = mixnet::GeoAwareTopologyProvider::new(
vec![nym_api],
// We filter on the version of the mixnodes. Be prepared to manually update
// this to keep this example working, as we can't (currently) fetch to current
Expand Down
3 changes: 2 additions & 1 deletion sdk/rust/nym-sdk/src/mixnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ pub use nym_client_core::{
fs_backend::Backend as ReplyStorage, CombinedReplyStorage, Empty as EmptyReplyStorage,
ReplyStorageBackend,
},
topology_control::geo_aware_provider::{CountryGroup, GeoAwareTopologyProvider},
},
config::GatewayEndpointConfig,
config::{GatewayEndpointConfig, GroupBy},
};
pub use nym_credential_storage::{
ephemeral_storage::EphemeralStorage as EphemeralCredentialStorage, models::CoconutCredential,
Expand Down

0 comments on commit 867716e

Please sign in to comment.