From 78e1f916f289b85572545c4d70061c3340f11e6a Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Fri, 13 Mar 2020 16:33:50 +0000 Subject: [PATCH 1/7] Updated presence information with location --- common/clients/directory-client/src/presence/mixnodes.rs | 3 +++ common/clients/directory-client/src/presence/providers.rs | 3 +++ common/topology/src/mix.rs | 1 + common/topology/src/provider.rs | 1 + 4 files changed, 8 insertions(+) diff --git a/common/clients/directory-client/src/presence/mixnodes.rs b/common/clients/directory-client/src/presence/mixnodes.rs index 755c9499a4..a28725af88 100644 --- a/common/clients/directory-client/src/presence/mixnodes.rs +++ b/common/clients/directory-client/src/presence/mixnodes.rs @@ -7,6 +7,7 @@ use topology::mix; #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct MixNodePresence { + pub location: String, pub host: String, pub pub_key: String, pub layer: u64, @@ -27,6 +28,7 @@ impl TryInto for MixNodePresence { } Ok(topology::mix::Node { + location: self.location, host: resolved_hostname.unwrap(), pub_key: self.pub_key, layer: self.layer, @@ -39,6 +41,7 @@ impl TryInto for MixNodePresence { impl From for MixNodePresence { fn from(mn: mix::Node) -> Self { MixNodePresence { + location: mn.location, host: mn.host.to_string(), pub_key: mn.pub_key, layer: mn.layer, diff --git a/common/clients/directory-client/src/presence/providers.rs b/common/clients/directory-client/src/presence/providers.rs index 7528accd93..e3c4065668 100644 --- a/common/clients/directory-client/src/presence/providers.rs +++ b/common/clients/directory-client/src/presence/providers.rs @@ -4,6 +4,7 @@ use topology::provider; #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct MixProviderPresence { + pub location: String, pub client_listener: String, pub mixnet_listener: String, pub pub_key: String, @@ -15,6 +16,7 @@ pub struct MixProviderPresence { impl Into for MixProviderPresence { fn into(self) -> topology::provider::Node { topology::provider::Node { + location: self.location, client_listener: self.client_listener.parse().unwrap(), mixnet_listener: self.mixnet_listener.parse().unwrap(), pub_key: self.pub_key, @@ -32,6 +34,7 @@ impl Into for MixProviderPresence { impl From for MixProviderPresence { fn from(mpn: provider::Node) -> Self { MixProviderPresence { + location: mpn.location, client_listener: mpn.client_listener.to_string(), mixnet_listener: mpn.mixnet_listener.to_string(), pub_key: mpn.pub_key, diff --git a/common/topology/src/mix.rs b/common/topology/src/mix.rs index 4f5a9c2b2e..abf04e72b5 100644 --- a/common/topology/src/mix.rs +++ b/common/topology/src/mix.rs @@ -5,6 +5,7 @@ use std::net::SocketAddr; #[derive(Debug, Clone)] pub struct Node { + pub location: String, pub host: SocketAddr, pub pub_key: String, pub layer: u64, diff --git a/common/topology/src/provider.rs b/common/topology/src/provider.rs index a4d268822b..7687489e3c 100644 --- a/common/topology/src/provider.rs +++ b/common/topology/src/provider.rs @@ -10,6 +10,7 @@ pub struct Client { #[derive(Debug, Clone)] pub struct Node { + pub location: String, pub client_listener: SocketAddr, pub mixnet_listener: SocketAddr, pub pub_key: String, From ab5656ce94cf1ee769ad45fe4737f6f32abda4e8 Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Fri, 13 Mar 2020 16:34:06 +0000 Subject: [PATCH 2/7] Updated configs and args with location --- mixnode/src/commands/init.rs | 6 ++++++ mixnode/src/commands/mod.rs | 4 ++++ mixnode/src/commands/run.rs | 6 ++++++ mixnode/src/config/mod.rs | 20 ++++++++++++++++++++ mixnode/src/config/template.rs | 6 ++++++ mixnode/src/node/mod.rs | 1 + mixnode/src/node/presence.rs | 4 ++++ sfw-provider/src/commands/init.rs | 6 ++++++ sfw-provider/src/commands/mod.rs | 4 ++++ sfw-provider/src/commands/run.rs | 6 ++++++ sfw-provider/src/config/mod.rs | 20 ++++++++++++++++++++ sfw-provider/src/config/template.rs | 6 ++++++ sfw-provider/src/provider/mod.rs | 1 + sfw-provider/src/provider/presence.rs | 6 ++++++ validator/src/commands/init.rs | 6 ++++++ validator/src/commands/mod.rs | 4 ++++ validator/src/commands/run.rs | 6 ++++++ validator/src/config/mod.rs | 23 ++++++++++++++++++++++- validator/src/config/template.rs | 6 ++++++ 19 files changed, 140 insertions(+), 1 deletion(-) diff --git a/mixnode/src/commands/init.rs b/mixnode/src/commands/init.rs index b23b631e94..52400d206d 100644 --- a/mixnode/src/commands/init.rs +++ b/mixnode/src/commands/init.rs @@ -15,6 +15,12 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> { .takes_value(true) .required(true), ) + .arg( + Arg::with_name("location") + .long("location") + .help("Optional geographical location of this node") + .takes_value(true), + ) .arg( Arg::with_name("layer") .long("layer") diff --git a/mixnode/src/commands/mod.rs b/mixnode/src/commands/mod.rs index 0363dcbd57..630390f19b 100644 --- a/mixnode/src/commands/mod.rs +++ b/mixnode/src/commands/mod.rs @@ -41,5 +41,9 @@ pub(crate) fn override_config(mut config: Config, matches: &ArgMatches) -> Confi config = config.with_announce_port(announce_port.unwrap()); } + if let Some(location) = matches.value_of("location") { + config = config.with_location(location); + } + config } diff --git a/mixnode/src/commands/run.rs b/mixnode/src/commands/run.rs index 42baaffe01..30830a23cd 100644 --- a/mixnode/src/commands/run.rs +++ b/mixnode/src/commands/run.rs @@ -15,6 +15,12 @@ pub fn command_args<'a, 'b>() -> App<'a, 'b> { .required(true), ) // the rest of arguments are optional, they are used to override settings in config file + .arg( + Arg::with_name("location") + .long("location") + .help("Optional geographical location of this node") + .takes_value(true), + ) .arg( Arg::with_name("config") .long("config") diff --git a/mixnode/src/config/mod.rs b/mixnode/src/config/mod.rs index 8fc051917b..e69c7a3431 100644 --- a/mixnode/src/config/mod.rs +++ b/mixnode/src/config/mod.rs @@ -91,6 +91,11 @@ impl Config { self } + pub fn with_location>(mut self, location: S) -> Self { + self.mixnode.location = location.into(); + self + } + // if you want to use distinct servers for metrics and presence // you need to do so in the config.toml file. pub fn with_custom_directory>(mut self, directory_server: S) -> Self { @@ -180,6 +185,10 @@ impl Config { self.config_directory().join(Self::config_file_name()) } + pub fn get_location(&self) -> String { + self.mixnode.location.clone() + } + pub fn get_private_sphinx_key_file(&self) -> PathBuf { self.mixnode.private_sphinx_key_file.clone() } @@ -231,6 +240,12 @@ pub struct MixNode { /// ID specifies the human readable ID of this particular mixnode. id: String, + /// Completely optional value specifying geographical location of this particular node. + /// Currently it's used entirely for debug purposes, as there are no mechanisms implemented + /// to verify correctness of the information provided. However, feel free to fill in + /// this field with as much accuracy as you wish to share. + location: String, + /// Layer of this particular mixnode determining its position in the network. layer: u64, @@ -264,12 +279,17 @@ impl MixNode { fn default_public_sphinx_key_file(id: &str) -> PathBuf { Config::default_data_directory(Some(id)).join("public_sphinx.pem") } + + fn default_location() -> String { + "unknown".into() + } } impl Default for MixNode { fn default() -> Self { MixNode { id: "".to_string(), + location: Self::default_location(), layer: 0, listening_address: format!("0.0.0.0:{}", DEFAULT_LISTENING_PORT) .parse() diff --git a/mixnode/src/config/template.rs b/mixnode/src/config/template.rs index 78ec91fa02..00af93298e 100644 --- a/mixnode/src/config/template.rs +++ b/mixnode/src/config/template.rs @@ -13,6 +13,12 @@ pub(crate) fn config_template() -> &'static str { # Human readable ID of this particular mixnode. id = "{{ mixnode.id }}" +# Completely optional value specifying geographical location of this particular node. +# Currently it's used entirely for debug purposes, as there are no mechanisms implemented +# to verify correctness of the information provided. However, feel free to fill in +# this field with as much accuracy as you wish to share. +location = "{{ mixnode.location }}" + # Layer of this particular mixnode determining its position in the network. layer = {{ mixnode.layer }} diff --git a/mixnode/src/node/mod.rs b/mixnode/src/node/mod.rs index c73aade059..4ba30307da 100644 --- a/mixnode/src/node/mod.rs +++ b/mixnode/src/node/mod.rs @@ -46,6 +46,7 @@ impl MixNode { fn start_presence_notifier(&self) { info!("Starting presence notifier..."); let notifier_config = presence::NotifierConfig::new( + self.config.get_location(), self.config.get_presence_directory_server(), self.config.get_announce_address(), self.sphinx_keypair.public_key().to_base58_string(), diff --git a/mixnode/src/node/presence.rs b/mixnode/src/node/presence.rs index 0a4f209d16..f5f650cdf9 100644 --- a/mixnode/src/node/presence.rs +++ b/mixnode/src/node/presence.rs @@ -8,6 +8,7 @@ use tokio::runtime::Handle; use tokio::task::JoinHandle; pub struct NotifierConfig { + location: String, directory_server: String, announce_host: String, pub_key_string: String, @@ -17,6 +18,7 @@ pub struct NotifierConfig { impl NotifierConfig { pub fn new( + location: String, directory_server: String, announce_host: String, pub_key_string: String, @@ -24,6 +26,7 @@ impl NotifierConfig { sending_delay: Duration, ) -> Self { NotifierConfig { + location, directory_server, announce_host, pub_key_string, @@ -46,6 +49,7 @@ impl Notifier { }; let net_client = directory_client::Client::new(directory_client_cfg); let presence = MixNodePresence { + location: config.location, host: config.announce_host, pub_key: config.pub_key_string, layer: config.layer, diff --git a/sfw-provider/src/commands/init.rs b/sfw-provider/src/commands/init.rs index f87e189c51..1d9ecf9bfa 100644 --- a/sfw-provider/src/commands/init.rs +++ b/sfw-provider/src/commands/init.rs @@ -15,6 +15,12 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> { .takes_value(true) .required(true), ) + .arg( + Arg::with_name("location") + .long("location") + .help("Optional geographical location of this provider") + .takes_value(true), + ) .arg( Arg::with_name("mix-host") .long("mix-host") diff --git a/sfw-provider/src/commands/mod.rs b/sfw-provider/src/commands/mod.rs index a9ae6e848b..6d4c4b1481 100644 --- a/sfw-provider/src/commands/mod.rs +++ b/sfw-provider/src/commands/mod.rs @@ -83,5 +83,9 @@ pub(crate) fn override_config(mut config: Config, matches: &ArgMatches) -> Confi config = config.with_custom_clients_ledger(clients_ledger); } + if let Some(location) = matches.value_of("location") { + config = config.with_location(location); + } + config } diff --git a/sfw-provider/src/commands/run.rs b/sfw-provider/src/commands/run.rs index 123398e6db..090ca3a00c 100644 --- a/sfw-provider/src/commands/run.rs +++ b/sfw-provider/src/commands/run.rs @@ -15,6 +15,12 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> { .required(true), ) // the rest of arguments are optional, they are used to override settings in config file + .arg( + Arg::with_name("location") + .long("location") + .help("Optional geographical location of this node") + .takes_value(true), + ) .arg( Arg::with_name("config") .long("config") diff --git a/sfw-provider/src/config/mod.rs b/sfw-provider/src/config/mod.rs index 5be3ac631f..96ba4d8baa 100644 --- a/sfw-provider/src/config/mod.rs +++ b/sfw-provider/src/config/mod.rs @@ -108,6 +108,11 @@ impl Config { self } + pub fn with_location>(mut self, location: S) -> Self { + self.provider.location = location.into(); + self + } + pub fn with_mix_listening_host>(mut self, host: S) -> Self { // see if the provided `host` is just an ip address or ip:port let host = host.into(); @@ -277,6 +282,10 @@ impl Config { self.config_directory().join(Self::config_file_name()) } + pub fn get_location(&self) -> String { + self.provider.location.clone() + } + pub fn get_private_sphinx_key_file(&self) -> PathBuf { self.provider.private_sphinx_key_file.clone() } @@ -332,6 +341,12 @@ pub struct Provider { /// ID specifies the human readable ID of this particular provider. id: String, + /// Completely optional value specifying geographical location of this particular provider. + /// Currently it's used entirely for debug purposes, as there are no mechanisms implemented + /// to verify correctness of the information provided. However, feel free to fill in + /// this field with as much accuracy as you wish to share. + location: String, + /// Path to file containing private sphinx key. private_sphinx_key_file: PathBuf, @@ -351,12 +366,17 @@ impl Provider { fn default_public_sphinx_key_file(id: &str) -> PathBuf { Config::default_data_directory(Some(id)).join("public_sphinx.pem") } + + fn default_location() -> String { + "unknown".into() + } } impl Default for Provider { fn default() -> Self { Provider { id: "".to_string(), + location: Self::default_location(), private_sphinx_key_file: Default::default(), public_sphinx_key_file: Default::default(), nym_root_directory: Config::default_root_directory(), diff --git a/sfw-provider/src/config/template.rs b/sfw-provider/src/config/template.rs index 64208c8ab7..b313cd09fc 100644 --- a/sfw-provider/src/config/template.rs +++ b/sfw-provider/src/config/template.rs @@ -13,6 +13,12 @@ pub(crate) fn config_template() -> &'static str { # Human readable ID of this particular service provider. id = "{{ provider.id }}" +# Completely optional value specifying geographical location of this particular node. +# Currently it's used entirely for debug purposes, as there are no mechanisms implemented +# to verify correctness of the information provided. However, feel free to fill in +# this field with as much accuracy as you wish to share. +location = "{{ provider.location }}" + # Path to file containing private sphinx key. private_sphinx_key_file = "{{ provider.private_sphinx_key_file }}" diff --git a/sfw-provider/src/provider/mod.rs b/sfw-provider/src/provider/mod.rs index e107150908..8c78dee584 100644 --- a/sfw-provider/src/provider/mod.rs +++ b/sfw-provider/src/provider/mod.rs @@ -45,6 +45,7 @@ impl ServiceProvider { fn start_presence_notifier(&self) { info!("Starting presence notifier..."); let notifier_config = presence::NotifierConfig::new( + self.config.get_location(), self.config.get_presence_directory_server(), self.config.get_mix_announce_address(), self.config.get_clients_announce_address(), diff --git a/sfw-provider/src/provider/presence.rs b/sfw-provider/src/provider/presence.rs index c8ff6dcb3a..b67020a1e5 100644 --- a/sfw-provider/src/provider/presence.rs +++ b/sfw-provider/src/provider/presence.rs @@ -9,6 +9,7 @@ use tokio::runtime::Handle; use tokio::task::JoinHandle; pub struct NotifierConfig { + location: String, directory_server: String, mix_announce_host: String, clients_announce_host: String, @@ -18,6 +19,7 @@ pub struct NotifierConfig { impl NotifierConfig { pub fn new( + location: String, directory_server: String, mix_announce_host: String, clients_announce_host: String, @@ -25,6 +27,7 @@ impl NotifierConfig { sending_delay: Duration, ) -> Self { NotifierConfig { + location, directory_server, mix_announce_host, clients_announce_host, @@ -35,6 +38,7 @@ impl NotifierConfig { } pub struct Notifier { + location: String, net_client: directory_client::Client, client_ledger: ClientLedger, sending_delay: Duration, @@ -53,6 +57,7 @@ impl Notifier { Notifier { client_ledger, net_client, + location: config.location, client_listener: config.clients_announce_host, mixnet_listener: config.mix_announce_host, pub_key_string: config.pub_key_string, @@ -62,6 +67,7 @@ impl Notifier { async fn make_presence(&self) -> MixProviderPresence { MixProviderPresence { + location: self.location.clone(), client_listener: self.client_listener.clone(), mixnet_listener: self.mixnet_listener.clone(), pub_key: self.pub_key_string.clone(), diff --git a/validator/src/commands/init.rs b/validator/src/commands/init.rs index c741dca5ee..4cce4199ea 100644 --- a/validator/src/commands/init.rs +++ b/validator/src/commands/init.rs @@ -12,6 +12,12 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> { .takes_value(true) .required(true), ) + .arg( + Arg::with_name("location") + .long("location") + .help("Optional geographical location of this node") + .takes_value(true), + ) .arg( Arg::with_name("directory") .long("directory") diff --git a/validator/src/commands/mod.rs b/validator/src/commands/mod.rs index 60ec03984d..0533e08998 100644 --- a/validator/src/commands/mod.rs +++ b/validator/src/commands/mod.rs @@ -9,5 +9,9 @@ pub(crate) fn override_config(mut config: Config, matches: &ArgMatches) -> Confi config = config.with_custom_directory(directory); } + if let Some(location) = matches.value_of("location") { + config = config.with_location(location); + } + config } diff --git a/validator/src/commands/run.rs b/validator/src/commands/run.rs index 8f06e0e2d9..d47c59e0b1 100644 --- a/validator/src/commands/run.rs +++ b/validator/src/commands/run.rs @@ -15,6 +15,12 @@ pub fn command_args<'a, 'b>() -> clap::App<'a, 'b> { .required(true), ) // the rest of arguments are optional, they are used to override settings in config file + .arg( + Arg::with_name("location") + .long("location") + .help("Optional geographical location of this node") + .takes_value(true), + ) .arg( Arg::with_name("config") .long("config") diff --git a/validator/src/config/mod.rs b/validator/src/config/mod.rs index e23c6f86c0..5ee4f3e2c4 100644 --- a/validator/src/config/mod.rs +++ b/validator/src/config/mod.rs @@ -98,11 +98,21 @@ impl Config { self } + pub fn with_location>(mut self, location: S) -> Self { + self.validator.location = location.into(); + self + } + // getters pub fn get_config_file_save_location(&self) -> PathBuf { self.config_directory().join(Self::config_file_name()) } + #[allow(dead_code)] + pub fn get_location(&self) -> String { + self.validator.location.clone() + } + pub fn get_mix_mining_directory_server(&self) -> String { self.mix_mining.directory_server.clone() } @@ -137,17 +147,28 @@ pub struct Validator { /// ID specifies the human readable ID of this particular validator. id: String, + /// Completely optional value specifying geographical location of this particular node. + /// Currently it's used entirely for debug purposes, as there are no mechanisms implemented + /// to verify correctness of the information provided. However, feel free to fill in + /// this field with as much accuracy as you wish to share. + location: String, + /// nym_home_directory specifies absolute path to the home nym MixNodes directory. /// It is expected to use default value and hence .toml file should not redefine this field. nym_root_directory: PathBuf, } -impl Validator {} +impl Validator { + fn default_location() -> String { + "unknown".into() + } +} impl Default for Validator { fn default() -> Self { Validator { id: "".to_string(), + location: Self::default_location(), nym_root_directory: Config::default_root_directory(), } } diff --git a/validator/src/config/template.rs b/validator/src/config/template.rs index 3e8b0c1f82..ad2c0b9904 100644 --- a/validator/src/config/template.rs +++ b/validator/src/config/template.rs @@ -13,6 +13,12 @@ pub(crate) fn config_template() -> &'static str { # Human readable ID of this particular validator. id = "{{ validator.id }}" +# Completely optional value specifying geographical location of this particular node. +# Currently it's used entirely for debug purposes, as there are no mechanisms implemented +# to verify correctness of the information provided. However, feel free to fill in +# this field with as much accuracy as you wish to share. +location = "{{ validator.location }}" + ##### advanced configuration options ##### # nym_home_directory specifies absolute path to the home nym validators directory. From 3ade8375799ab2bd57177ed95fbabf8b8b162c9a Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Fri, 13 Mar 2020 16:46:04 +0000 Subject: [PATCH 3/7] Added location to CocoPresence --- common/clients/directory-client/src/presence/coconodes.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/clients/directory-client/src/presence/coconodes.rs b/common/clients/directory-client/src/presence/coconodes.rs index e2b61f0771..60ee21f6d9 100644 --- a/common/clients/directory-client/src/presence/coconodes.rs +++ b/common/clients/directory-client/src/presence/coconodes.rs @@ -4,6 +4,7 @@ use topology::coco; #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct CocoPresence { + pub location: String, pub host: String, pub pub_key: String, pub last_seen: u64, @@ -13,6 +14,7 @@ pub struct CocoPresence { impl Into for CocoPresence { fn into(self) -> topology::coco::Node { topology::coco::Node { + location: self.location, host: self.host, pub_key: self.pub_key, last_seen: self.last_seen, @@ -24,6 +26,7 @@ impl Into for CocoPresence { impl From for CocoPresence { fn from(cn: coco::Node) -> Self { CocoPresence { + location: cn.location, host: cn.host, pub_key: cn.pub_key, last_seen: cn.last_seen, From b8bd872cdf99098c1b2fdbb2219c5cd25cbdba13 Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Fri, 13 Mar 2020 16:46:12 +0000 Subject: [PATCH 4/7] ibid. --- common/topology/src/coco.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/common/topology/src/coco.rs b/common/topology/src/coco.rs index bfc20a093e..2acca41598 100644 --- a/common/topology/src/coco.rs +++ b/common/topology/src/coco.rs @@ -2,6 +2,7 @@ use crate::filter; #[derive(Debug, Clone)] pub struct Node { + pub location: String, pub host: String, pub pub_key: String, pub last_seen: u64, From 72ed65dc5fc5bde17029aef76df511f58b2332d7 Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Fri, 13 Mar 2020 16:46:18 +0000 Subject: [PATCH 5/7] Fixed broken tests --- common/clients/directory-client/src/presence/mod.rs | 2 ++ .../directory-client/src/requests/presence_coconodes_post.rs | 1 + .../directory-client/src/requests/presence_mixnodes_post.rs | 1 + .../directory-client/src/requests/presence_providers_post.rs | 1 + 4 files changed, 5 insertions(+) diff --git a/common/clients/directory-client/src/presence/mod.rs b/common/clients/directory-client/src/presence/mod.rs index 99d23ca130..e3b542cb41 100644 --- a/common/clients/directory-client/src/presence/mod.rs +++ b/common/clients/directory-client/src/presence/mod.rs @@ -78,6 +78,7 @@ mod converting_mixnode_presence_into_topology_mixnode { let unresolvable_hostname = "foomp.foomp.foomp:1234"; let mix_presence = mixnodes::MixNodePresence { + location: "".to_string(), host: unresolvable_hostname.to_string(), pub_key: "".to_string(), layer: 0, @@ -94,6 +95,7 @@ mod converting_mixnode_presence_into_topology_mixnode { let resolvable_hostname = "nymtech.net:1234"; let mix_presence = mixnodes::MixNodePresence { + location: "".to_string(), host: resolvable_hostname.to_string(), pub_key: "".to_string(), layer: 0, diff --git a/common/clients/directory-client/src/requests/presence_coconodes_post.rs b/common/clients/directory-client/src/requests/presence_coconodes_post.rs index cc34c13272..3ce9a5e464 100644 --- a/common/clients/directory-client/src/requests/presence_coconodes_post.rs +++ b/common/clients/directory-client/src/requests/presence_coconodes_post.rs @@ -77,6 +77,7 @@ mod metrics_get_request { pub fn new_presence() -> CocoPresence { CocoPresence { + location: "foomp".to_string(), host: "foo.com".to_string(), pub_key: "abc".to_string(), last_seen: 666, diff --git a/common/clients/directory-client/src/requests/presence_mixnodes_post.rs b/common/clients/directory-client/src/requests/presence_mixnodes_post.rs index df110c2fea..a03147658b 100644 --- a/common/clients/directory-client/src/requests/presence_mixnodes_post.rs +++ b/common/clients/directory-client/src/requests/presence_mixnodes_post.rs @@ -77,6 +77,7 @@ mod metrics_get_request { pub fn new_presence() -> MixNodePresence { MixNodePresence { + location: "foomp".to_string(), host: "foo.com".to_string(), pub_key: "abc".to_string(), layer: 1, diff --git a/common/clients/directory-client/src/requests/presence_providers_post.rs b/common/clients/directory-client/src/requests/presence_providers_post.rs index d926700334..57e1e5f5d5 100644 --- a/common/clients/directory-client/src/requests/presence_providers_post.rs +++ b/common/clients/directory-client/src/requests/presence_providers_post.rs @@ -76,6 +76,7 @@ mod metrics_get_request { pub fn new_presence() -> MixProviderPresence { MixProviderPresence { + location: "foomp".to_string(), client_listener: "foo.com".to_string(), mixnet_listener: "foo.com".to_string(), pub_key: "abc".to_string(), From 0546c561a96ac5d9069d50db184b9d21ca27f6c6 Mon Sep 17 00:00:00 2001 From: Jedrzej Stuczynski Date: Fri, 13 Mar 2020 16:50:30 +0000 Subject: [PATCH 6/7] Actually fixed tests this time --- .../src/requests/presence_topology_get.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/clients/directory-client/src/requests/presence_topology_get.rs b/common/clients/directory-client/src/requests/presence_topology_get.rs index 2c5190cec8..431fef5e2f 100644 --- a/common/clients/directory-client/src/requests/presence_topology_get.rs +++ b/common/clients/directory-client/src/requests/presence_topology_get.rs @@ -72,6 +72,7 @@ mod topology_requests { r#"{ "cocoNodes": [ { + "location": "unknown", "host": "3.8.244.109:4000", "pubKey": "AAAAAAAAAAEKwAECSqKy8I8KkSYIBSctxRBRxuR61PpAOwK0UQtkeuPRdwusAyaoBbvv1IBWyMEhvbgT4CtgUnGf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NbJNMjYEq90pp50nowwx8INz20IXET2ZNX6kIXYFCsEvPLZFlG2OoL6xg3uQS1qMl3lIS_VxdO_JfVe0rT65WsJ_P4Nkc1jYiuNPHY6d_iFO0BVYqX0sOCX73GC_TT13BR0jnPwDAVw0rGtYHsXBb8TKOsawAEZIClauuT1V3qOZnb7uRZhFXO-PKTxgc1LCzJt2ChOrMZaBpjlkf3IPpJ2UF4JH4kGaDeBf2k_S-FLAs3drK21efbi5P6_a4QTxAiiRimXGoQIyvOg462s6kP_ZRFufo8YYQHS4olaOeqU4564dNskg_uBPsFMz_2GNOhmn_15cJqP1jfkyD49Z16GTS5YLHgVl9bJKqyvLuypsToLbt1BJzipEP0L2OohuRm-_MvqvwwWKyjNQsubgee1K728d9AawAEBkGggcNVCtXyhoSqi3_w0tVxtkAYeud8sBeAtZHGs06me_QL8co0MFLlO-zdkUb4ZBq08rFEbgLOma8_3whleM8NIPaHNISp1q3IsIhB5zdXcZoGsqLixODBFHtID3YEHAlr4f9T_yh11yJ95xGCl_6Y37hpwLQVGyrfSfccM24mVFqnV3TT5Wdq3ile-jesUx1Q2G1yK_xVqc6itmk-kDuBjyZgzYi1-jsIXAjnhM9G7t8J_Bv5yGGZhLK2dCzM=", "type": "validator", @@ -79,6 +80,7 @@ mod topology_requests { "version": "0.1.0" }, { + "location": "unknown", "host": "3.9.129.61:4000", "pubKey": "AAAAAAAAAAMKwAECSqKy8I8KkSYIBSctxRBRxuR61PpAOwK0UQtkeuPRdwusAyaoBbvv1IBWyMEhvbgT4CtgUnGfYH2s06CIJ09lWWvQ0Jkgthq12mG73H9QSTNM8RITlF1X5ax9BV0EK34M5dUncn1uEYzJzcbaLjUarf2bqoy906dtQpppUWDRLJI6ycw7rKKJ4ZNUhgi4KAEGBsSgLqc0zDKs0rArwouZyz4ofoWnY68mdJKrVy6Zqz83DSdc7B2hqqkHX_Bfeb4SwAEEv6RMevAQmLGkeK0uJKnMPPAtm8GgXjWSQijYdnxlPh5SJSNeJUbPZKWF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ZeKhqH_s05V10xbzkYX71G5cqz--8vr9ZlQRb2BeETF_Tdq_PLk7qbT8WTGIoq7ZwyDRQTgzvkCgyzj_hBLh2o7sSVNgUo38SFUTMn7YtvVFYlSrTDE3WKE-T-nh5SWdDBxgDTc3Bw8JpzNH-WkoJ4Lim7sB4Op1gEUawAEW4-kenlffwsNr_3b3aV0YuusLpxB03sxPzQ5B0CWNiVtbja1Z4tWhKGUUrdq_eUgMV0y5Of-BqNi5FspAQnhJBFSSxtOzRGV1h3qyUTksfZyed9z8zPI-ZPP9XXm7hYgJgDz_kxte-NfS9UG9q5AZetHUN4kGxXutjjzfUQZ9yTvhBKgKgTI2Dp_R_jZrWQ8F1BoWzIJzjddT1K2MvCQEkARYw08isbOeFmCwgVUcjxYZO45WyOmLQA7QJRL9WvA=", "type": "validator", @@ -86,6 +88,7 @@ mod topology_requests { "version": "0.1.0" }, { + "location": "unknown", "host": "3.9.222.1:4000", "pubKey": "AAAAAAAAAAQKwAECSqKy8I8KkSYIBSctxRBRxuR61PpAOwK0UQtkeuPRdwusAyaoBbvv1IBWyMEhvbgT4CtgUnGfYH2s06CIJ09lWWvQ0Jkgthq12mG73H9QSTNM8RITlF1X5ax9BV0EK34M5dUncn1uEYzJzcbaLjUarf2bqoy906dtQpppUWDRLJI6ycw7rKKJ4ZNUhgi4KAEGBsSgLqc0zDKs0rArwouZyz4ofoWnY68mdJKrVy6Zqz83DSdc7B2hqqkHX_Bfeb4SwAECh9xcxpjOp1r7kiNIgrI9GgAlvXwgHkTchOxUiyOzTq6FDWdGN64KiC3NDeyGTg8FmzvGzS3jREeJqOdr4G9ZGtWkauAITgLFiH62t-YntRslhr8_1shxlmzKiNKJN_QFflEq79pZIlWtp3N8LIHMvXRtl-zt2DMze4s02XDmEkviyVE4CkQUDtCc-2MfPT4JcmEFqtFIxjrXn18SbYg3c6XUQHsGIkuDrKuCTRlpC8kvmM0uVoIeWdmwDlZk4jUawAEJhRwK5ozjqIWRP1bFzBPS9VhaJnfKU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lSXNmgjMEhsn823a1LFzpV7rOv4vayYvvFX61hB9R78VjpyxJiYpDwRZLiUY3AK4WY8NqFDbjXR7rT4CkFHEf-VhSQQ8ZNvlpod1nmeVQVizHH9e7Tq7wsWz-LWEk3Hx6LmcrgDsL79LZYG9JXU5IdvG8RvLNx9cSwEI8yxcchpISAaot7UoYQ=", "type": "validator", @@ -93,6 +96,7 @@ mod topology_requests { "version": "0.1.0" }, { + "location": "unknown", "host": "3.9.102.214:4000", "pubKey": "AAAAAAAAAAIKwAECSqKy8I8KkSYIBSctxRBRxuR61PpAOwK0UQtkeuPRdwusAyaoBbvv1IBWyMEhvbgT4CtgUnGfYH2s06CIJ09lWWvQ0Jkgthq12mG73H9QSTNM8RITlF1X5ax9BV0EK34M5dUncn1uEYzJzcbaLjUarf2bqoy906dtQpppUWDRLJI6ycw7rKKJ4ZNUhgi4KAEGBsSgLqc0zDKs0rArwouZyz4ofoWnY68mdJKrVy6Zqz83DSdc7B2hqqkHX_Bfeb4SwAEOVCUN3EwiVroS5-TOq2o7hYSxphK9X0G23N-IBZ0Tr1Rl8XEiJ-OEy0rqnAKwmhAZJWnx3u8oXqbZtOWIZmzQSpcoxhgwfhdmTZJCqT2RVzZyeFItX4sVeilEP3z2xdsJs8-a1kg6UZnx1s1BNLBo7eZrreZygWojPCIDBn03fSAflXoVc5PpY2CGy5MA_IgWgSYBHDdoZEtigp_amjqK7Us44Db20XpLxMXfbahiqa7WKNnMgi6Ca2H67VtaaD8awAEF3zbE1nZRAa7a8vbU25c80YBYJBaW8P6FwXQI-K0Xk5MakwYeMMnIrm6w6IS_0XAO5YlD453GLqnxY8H1BEnRpfOnT7PE4el9mJ8MuYQMo6R2up0lGCmYM0YA9FORjroM3ng69SEPfJPCReG7LfJkERl_m2U403ertDRBYrlqCDagDfyI500srBcMrjSvV3oNouyyx3yZUrjLQfbHhDteQFsYdmakJs8Y-Q9-5MXCcrz6Qa4xwv522Euv0CCxkHcawAEYjfsU_zDhUZA1ey1aquWXlFOnx-iEALqxW1slDYHwQ1M2SILc-v_E6i1doa5e_bAZHVezBHFAlaNAVedNyHFFJxYAqAK3hbzbvl2glw3Q6h_rTXElymloqtaqVFIJ-oUWWOHsZBmu8EDA-HzvGCiBa_GbRaVfh2lE4ObeMXoJrEm_5dbxxeEic2l3IYeIz40N9ooQQOkQcOZdY4AXWYCavIAwWEJBjLtptJgCLu9a_zM1S5GsiyJHpdDs46WbP0EawAEWZ-95Sf0YAHujxRNLdXgpqe0ZF8loVwzZfvyMvqaxF1Ug274BqHuY_c5NdPAzuqoTwjfEn8NKEoaNqlumM75FUYbaTd7mXvk4WVYWjVnkO40dfQjRB7DYhvj0LBlbndAJ4wJIA2ilPYgjZsXVbNNh3e2j3u9eABd0VaFMbSb8Sz5_31r8HzoWmPJs3HiyuyANGFUA6CvAnMN6K3b-D8BhFZU_nPUTgu80o8_n6LQt-XWbaC_mTHzsnOjzBiPJxlYawAEW3bmOEtStH2T8q7vMkhchImp2-hg9MFYGBmEe9sSByTn3NUf8eksqXOC1dUjHkXoZm298FgUYLkNdnlxWpf993j5mEDoFxjcTB7scBD7k6nu6Nrs_wK0-seS8gsHrx9UK7GwAsi10q82Cm4PFyAtrWjmy_d9WLHuZt6VIOKunTs8cf0FwNUiMcvZsruqIFJcP7iWxdiFdUkh65P_iCz1ZEjJcj2GEZoq4v3a3by1aizGPaaiKc1jd_T-XJg_YpncawAEWnstu5b9WiZv0x8xfsiMk6YRlU0Cnj5svxLLXz_8drvwAa--GBY5yH0ke2EM6udMEi2EPeFcGTe6Sjs0YEhSbY7Uad_8suD2J4tIWJSWBbiyvh7rSqzv57m7BlsVcHfQJn_wNH-UlC9xkx8vg-LwfN8_FlxvHNPTc7XZG3lKYbwpUWlZxAziOYT1VQ-2K2bQQBBMdix-ht_SjccL1Dc2dP5kDazQ8yZV_8xnyeheazEedWe63uutfkHlZRg9YwP8=", "type": "validator", @@ -102,6 +106,7 @@ mod topology_requests { ], "mixNodes": [ { + "location": "unknown", "host": "35.176.155.107:1789", "pubKey": "zSob16499jT7C3S3ky4GihNOjlU6aLfSRkf1xAxOwV0=", "layer": 3, @@ -109,6 +114,7 @@ mod topology_requests { "version": "0.1.0" }, { + "location": "unknown", "host": "18.130.86.190:1789", "pubKey": "vCdpFc0NvW0NSqsuTxtjFtiSY35aXesgT3JNA8sSIXk=", "layer": 1, @@ -116,6 +122,7 @@ mod topology_requests { "version": "0.1.0" }, { + "location": "unknown", "host": "3.10.22.152:1789", "pubKey": "OwOqwWjh_IlnaWS2PxO6odnhNahOYpRCkju50beQCTA=", "layer": 1, @@ -123,6 +130,7 @@ mod topology_requests { "version": "0.1.0" }, { + "location": "unknown", "host": "35.178.213.77:1789", "pubKey": "nkkrUjgL8UJk05QydvWvFSvtRB6nmeV8RMvH5540J3s=", "layer": 2, @@ -130,6 +138,7 @@ mod topology_requests { "version": "0.1.0" }, { + "location": "unknown", "host": "52.56.99.196:1789", "pubKey": "whHuBuEc6zyOZOquKbuATaH4Crml61V_3Y-MztpWhF4=", "layer": 2, @@ -137,6 +146,7 @@ mod topology_requests { "version": "0.1.0" }, { + "location": "unknown", "host": "3.9.12.238:1789", "pubKey": "vk5Sr-Xyi0cTbugACv8U42ZJ6hs6cGDox0rpmXY94Fc=", "layer": 3, @@ -146,6 +156,7 @@ mod topology_requests { ], "mixProviderNodes": [ { + "location": "unknown", "clientListener": "3.8.176.11:8888", "mixnetListener": "3.8.176.11:9999", "pubKey": "54U6krAr-j9nQXFlsHk3io04_p0tctuqH71t7w_usgI=", @@ -263,6 +274,7 @@ mod topology_requests { "version": "0.1.0" }, { + "location": "unknown", "clientListener": "3.8.176.12:8888", "mixnetListener": "3.8.176.12:9999", "pubKey": "sA-sxi038pEbGy4lgZWG-RdHHDkA6kZzu44G0LUxFSc=", From 64bb7ea350491e5ac1471866b767fbd80cc31b18 Mon Sep 17 00:00:00 2001 From: Dave Hrycyszyn Date: Mon, 16 Mar 2020 11:42:35 +0000 Subject: [PATCH 7/7] Renamed binaries with correct binary names --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 82767c0049..f8b9f3c176 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@ This repository contains the full Nym platform, written in Rust. The platform is composed of multiple Rust crates. Top-level executable binary crates include: -* mixnode - shuffles [Sphinx](https://github.com/nymtech/sphinx) packets together to provide privacy against network-level attackers. +* nym-mixnode - shuffles [Sphinx](https://github.com/nymtech/sphinx) packets together to provide privacy against network-level attackers. * nym-client - an executable which you can build into your own applications. Use it for interacting with Nym nodes. -* sfw-provider - a store-and-forward service provider. The provider acts sort of like a mailbox for mixnet messages. -* validator - currently just starting development. Handles consensus ordering of transactions, mixmining, and coconut credential generation and validation. +* nym-sfw-provider - a store-and-forward service provider. The provider acts sort of like a mailbox for mixnet messages. +* nym-validator - currently just starting development. Handles consensus ordering of transactions, mixmining, and coconut credential generation and validation. [![Build Status](https://travis-ci.com/nymtech/nym.svg?branch=develop)](https://travis-ci.com/nymtech/nym)