Feature/version in config (#376)

* Added version field to config files

* Removed built dependency

* Missing non-removed call to built
This commit is contained in:
Jędrzej Stuczyński
2020-10-12 16:35:26 +01:00
committed by GitHub
parent c3a812b3cb
commit 1e35eeefaa
44 changed files with 42 additions and 337 deletions
Generated
-29
View File
@@ -323,15 +323,6 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb"
[[package]]
name = "built"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fa7899958f4aa3c40edc1b033d0e956763319e398924abb80a0034dda5bb198"
dependencies = [
"cargo-lock",
]
[[package]]
name = "bumpalo"
version = "3.4.0"
@@ -366,18 +357,6 @@ version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
[[package]]
name = "cargo-lock"
version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8504b63dd1249fd1745b7b4ef9b6f7b107ddeb3c95370043c7dbcc38653a2679"
dependencies = [
"semver",
"serde",
"toml",
"url 2.1.1",
]
[[package]]
name = "cc"
version = "1.0.59"
@@ -430,7 +409,6 @@ dependencies = [
name = "client-core"
version = "0.8.0-dev"
dependencies = [
"built",
"config",
"crypto",
"directory-client",
@@ -1740,7 +1718,6 @@ dependencies = [
name = "nym-client"
version = "0.9.0-dev"
dependencies = [
"built",
"clap",
"client-core",
"config",
@@ -1771,7 +1748,6 @@ dependencies = [
name = "nym-client-wasm"
version = "0.9.0-dev"
dependencies = [
"built",
"console_error_panic_hook",
"crypto",
"directory-client",
@@ -1793,7 +1769,6 @@ dependencies = [
name = "nym-gateway"
version = "0.9.0-dev"
dependencies = [
"built",
"clap",
"config",
"crypto",
@@ -1824,7 +1799,6 @@ name = "nym-mixnode"
version = "0.9.0-dev"
dependencies = [
"bs58",
"built",
"clap",
"config",
"crypto",
@@ -1850,7 +1824,6 @@ dependencies = [
name = "nym-socks5-client"
version = "0.9.0-dev"
dependencies = [
"built",
"clap",
"client-core",
"config",
@@ -1882,7 +1855,6 @@ version = "0.9.0-dev"
dependencies = [
"abci",
"bodyparser",
"built",
"byteorder",
"clap",
"config",
@@ -2830,7 +2802,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
dependencies = [
"semver-parser",
"serde",
]
[[package]]
-4
View File
@@ -1,5 +1,4 @@
[package]
build = "build.rs"
name = "client-core"
version = "0.8.0-dev"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"]
@@ -27,8 +26,5 @@ nymsphinx = { path = "../../common/nymsphinx" }
pemstore = { path = "../../common/pemstore" }
topology = { path = "../../common/topology" }
[build-dependencies]
built = "0.4.3"
[dev-dependencies]
tempfile = "3.1.0"
-19
View File
@@ -1,19 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use built;
fn main() {
built::write_built_file().expect("Failed to acquire build-time information");
}
-16
View File
@@ -1,16 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// The file has been placed there by the build script.
include!(concat!(env!("OUT_DIR"), "/built.rs"));
@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::built_info;
use directory_client::DirectoryClient;
use log::*;
use nymsphinx::addressing::clients::Recipient;
@@ -175,7 +174,7 @@ impl TopologyRefresher {
}
Ok(topology) => {
let nym_topology: NymTopology = topology.try_into().ok()?;
Some(nym_topology.filter_system_version(built_info::PKG_VERSION))
Some(nym_topology.filter_system_version(env!("CARGO_PKG_VERSION")))
}
}
}
+5 -1
View File
@@ -266,6 +266,9 @@ impl<T: NymConfig> Default for Config<T> {
#[derive(Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Client<T> {
/// Version of the client for which this configuration was created.
version: String,
/// ID specifies the human readable ID of this particular client.
id: String,
@@ -313,13 +316,14 @@ pub struct Client<T> {
nym_root_directory: PathBuf,
#[serde(skip)]
super_struct: PhantomData<T>,
super_struct: PhantomData<*const T>,
}
impl<T: NymConfig> Default for Client<T> {
fn default() -> Self {
// there must be explicit checks for whether id is not empty later
Client {
version: env!("CARGO_PKG_VERSION").to_string(),
id: "".to_string(),
directory_server: DEFAULT_DIRECTORY_SERVER.to_string(),
vpn_mode: false,
-1
View File
@@ -1,3 +1,2 @@
pub mod built_info;
pub mod client;
pub mod config;
-4
View File
@@ -1,5 +1,4 @@
[package]
build = "build.rs"
name = "nym-client"
version = "0.9.0-dev"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
@@ -42,9 +41,6 @@ pemstore = { path = "../../common/pemstore" }
topology = { path = "../../common/topology" }
websocket-requests = { path = "websocket-requests" }
[build-dependencies]
built = "0.4.3"
[dev-dependencies]
tempfile = "3.1.0"
serde_json = "1.0" # for the "textsend" example
-19
View File
@@ -1,19 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use built;
fn main() {
built::write_built_file().expect("Failed to acquire build-time information");
}
-16
View File
@@ -1,16 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// The file has been placed there by the build script.
include!(concat!(env!("OUT_DIR"), "/built.rs"));
@@ -24,6 +24,9 @@ pub(crate) fn config_template() -> &'static str {
##### main base client config options #####
[client]
# Version of the client for which this configuration was created.
version = '{{ client.version }}'
# Human readable ID of this particular client.
id = '{{ client.id }}'
+1 -2
View File
@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::built_info;
use crate::client::config::Config;
use crate::commands::override_config;
use clap::{App, Arg, ArgMatches};
@@ -108,7 +107,7 @@ async fn gateway_details(directory_server: &str, gateway_id: &str) -> gateway::N
let directory_client = directory_client::Client::new(directory_client_config);
let topology = directory_client.get_topology().await.unwrap();
let nym_topology: NymTopology = topology.try_into().expect("Invalid topology data!");
let version_filtered_topology = nym_topology.filter_system_version(built_info::PKG_VERSION);
let version_filtered_topology = nym_topology.filter_system_version(env!("CARGO_PKG_VERSION"));
version_filtered_topology
.gateways()
-1
View File
@@ -12,6 +12,5 @@
// See the License for the specific language governing permissions and
// limitations under the License.
pub mod built_info;
pub mod client;
pub mod websocket;
+2 -3
View File
@@ -14,7 +14,6 @@
use clap::{App, ArgMatches};
pub mod built_info;
pub mod client;
pub mod commands;
pub mod websocket;
@@ -25,7 +24,7 @@ fn main() {
println!("{}", banner());
let arg_matches = App::new("Nym Client")
.version(built_info::PKG_VERSION)
.version(env!("CARGO_PKG_VERSION"))
.author("Nymtech")
.about("Implementation of the Nym Client")
.subcommand(commands::init::command_args())
@@ -60,7 +59,7 @@ fn banner() -> String {
(client - version {:})
"#,
built_info::PKG_VERSION
env!("CARGO_PKG_VERSION")
)
}
-4
View File
@@ -1,5 +1,4 @@
[package]
build = "build.rs"
name = "nym-socks5-client"
version = "0.9.0-dev"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"]
@@ -35,8 +34,5 @@ socks5-requests = { path = "../../common/socks5/requests" }
topology = { path = "../../common/topology" }
proxy-helpers = { path = "../../common/socks5/proxy-helpers" }
[build-dependencies]
built = "0.4.3"
[dev-dependencies]
tempfile = "3.1.0"
-19
View File
@@ -1,19 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use built;
fn main() {
built::write_built_file().expect("Failed to acquire build-time information");
}
-16
View File
@@ -1,16 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// The file has been placed there by the build script.
include!(concat!(env!("OUT_DIR"), "/built.rs"));
@@ -24,6 +24,9 @@ pub(crate) fn config_template() -> &'static str {
##### main base client config options #####
[client]
# Version of the client for which this configuration was created.
version = '{{ client.version }}'
# Human readable ID of this particular client.
id = '{{ client.id }}'
+1 -2
View File
@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::built_info;
use crate::client::config::Config;
use crate::commands::override_config;
use clap::{App, Arg, ArgMatches};
@@ -109,7 +108,7 @@ async fn gateway_details(directory_server: &str, gateway_id: &str) -> gateway::N
let directory_client = directory_client::Client::new(directory_client_config);
let topology = directory_client.get_topology().await.unwrap();
let nym_topology: NymTopology = topology.try_into().expect("Invalid topology data!");
let version_filtered_topology = nym_topology.filter_system_version(built_info::PKG_VERSION);
let version_filtered_topology = nym_topology.filter_system_version(env!("CARGO_PKG_VERSION"));
version_filtered_topology
.gateways()
-1
View File
@@ -11,6 +11,5 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
pub mod built_info;
pub mod client;
pub mod socks;
+2 -3
View File
@@ -14,7 +14,6 @@
use clap::{App, ArgMatches};
pub mod built_info;
pub mod client;
mod commands;
pub mod socks;
@@ -25,7 +24,7 @@ fn main() {
println!("{}", banner());
let arg_matches = App::new("Nym Socks5 Proxy")
.version(built_info::PKG_VERSION)
.version(env!("CARGO_PKG_VERSION"))
.author("Nymtech")
.about("A Socks5 localhost proxy that converts incoming messages to Sphinx and sends them to a Nym address")
.subcommand(commands::init::command_args())
@@ -60,7 +59,7 @@ fn banner() -> String {
(socks5 proxy - version {:})
"#,
built_info::PKG_VERSION
env!("CARGO_PKG_VERSION")
)
}
-4
View File
@@ -1,5 +1,4 @@
[package]
build = "build.rs"
name = "nym-client-wasm"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jedrzej Stuczynski <andrew@nymtech.net>"]
version = "0.9.0-dev"
@@ -45,9 +44,6 @@ console_error_panic_hook = { version = "0.1", optional = true }
# Unfortunately, `wee_alloc` requires nightly Rust when targeting wasm for now.
wee_alloc = { version = "0.4", optional = true }
[build-dependencies]
built = "0.4.3"
[dev-dependencies]
wasm-bindgen-test = "0.2"
-19
View File
@@ -1,19 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use built;
fn main() {
built::write_built_file().expect("Failed to acquire build-time information");
}
-18
View File
@@ -1,18 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// The file has been placed there by the build script.
#![allow(dead_code)]
include!(concat!(env!("OUT_DIR"), "/built.rs"));
+2 -3
View File
@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::built_info;
use crypto::asymmetric::{encryption, identity};
use directory_client::DirectoryClient;
use futures::channel::mpsc;
@@ -255,8 +254,8 @@ impl NymClient {
.try_into()
.ok()
.expect("this is not a NYM topology!");
let version = built_info::PKG_VERSION;
nym_topology.filter_system_version(&version)
let version = env!("CARGO_PKG_VERSION");
nym_topology.filter_system_version(version)
}
}
}
-1
View File
@@ -14,7 +14,6 @@
use wasm_bindgen::prelude::*;
pub(crate) mod built_info;
#[cfg(target_arch = "wasm32")]
mod client;
-4
View File
@@ -1,5 +1,4 @@
[package]
build = "build.rs"
name = "nym-gateway"
version = "0.9.0-dev"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
@@ -37,8 +36,5 @@ pemstore = { path = "../common/pemstore" }
version = "0.11"
default-features = false
[build-dependencies]
built = "0.4.3"
[dev-dependencies]
tempfile = "3.1.0"
-19
View File
@@ -1,19 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use built;
fn main() {
built::write_built_file().expect("Failed to acquire build-time information");
}
-16
View File
@@ -1,16 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// The file has been placed there by the build script.
include!(concat!(env!("OUT_DIR"), "/built.rs"));
+4
View File
@@ -407,6 +407,9 @@ impl Config {
#[derive(Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Gateway {
/// Version of the gateway for which this configuration was created.
version: String,
/// ID specifies the human readable ID of this particular gateway.
id: String,
@@ -461,6 +464,7 @@ impl Gateway {
impl Default for Gateway {
fn default() -> Self {
Gateway {
version: env!("CARGO_PKG_VERSION").to_string(),
id: "".to_string(),
location: Self::default_location(),
private_identity_key_file: Default::default(),
+3
View File
@@ -24,6 +24,9 @@ pub(crate) fn config_template() -> &'static str {
##### main base mixnode config options #####
[gateway]
# Version of the gateway for which this configuration was created.
version = '{{ gateway.version }}'
# Human readable ID of this particular gateway.
id = '{{ gateway.id }}'
+2 -3
View File
@@ -14,7 +14,6 @@
use clap::{App, ArgMatches};
pub mod built_info;
mod commands;
mod config;
mod node;
@@ -25,7 +24,7 @@ fn main() {
println!("{}", banner());
let arg_matches = App::new("Nym Mixnet Gateway")
.version(built_info::PKG_VERSION)
.version(env!("CARGO_PKG_VERSION"))
.author("Nymtech")
.about("Implementation of the Nym Mixnet Gateway")
.subcommand(commands::init::command_args())
@@ -60,7 +59,7 @@ fn banner() -> String {
(gateway - version {:})
"#,
built_info::PKG_VERSION
env!("CARGO_PKG_VERSION")
)
}
+1 -2
View File
@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::built_info;
use directory_client::presence::gateways::GatewayPresence;
use directory_client::DirectoryClient;
use log::{error, trace};
@@ -87,7 +86,7 @@ impl Notifier {
identity_key: self.identity.clone(),
sphinx_key: self.sphinx_key.clone(),
last_seen: 0,
version: built_info::PKG_VERSION.to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
}
}
-4
View File
@@ -1,5 +1,4 @@
[package]
build = "build.rs"
name = "nym-mixnode"
version = "0.9.0-dev"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
@@ -30,8 +29,5 @@ nymsphinx = {path = "../common/nymsphinx" }
pemstore = {path = "../common/pemstore"}
topology = {path = "../common/topology"}
[build-dependencies]
built = "0.4.3"
[dev-dependencies]
tempfile = "3.1.0"
-19
View File
@@ -1,19 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use built;
fn main() {
built::write_built_file().expect("Failed to acquire build-time information");
}
-16
View File
@@ -1,16 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// The file has been placed there by the build script.
include!(concat!(env!("OUT_DIR"), "/built.rs"));
+4
View File
@@ -267,6 +267,9 @@ impl Config {
#[derive(Debug, Deserialize, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct MixNode {
/// Version of the mixnode for which this configuration was created.
version: String,
/// ID specifies the human readable ID of this particular mixnode.
id: String,
@@ -326,6 +329,7 @@ impl MixNode {
impl Default for MixNode {
fn default() -> Self {
MixNode {
version: env!("CARGO_PKG_VERSION").to_string(),
id: "".to_string(),
location: Self::default_location(),
layer: 0,
+3
View File
@@ -24,6 +24,9 @@ pub(crate) fn config_template() -> &'static str {
##### main base mixnode config options #####
[mixnode]
# Version of the mixnode for which this configuration was created.
version = '{{ mixnode.version }}'
# Human readable ID of this particular mixnode.
id = '{{ mixnode.id }}'
+2 -3
View File
@@ -14,7 +14,6 @@
use clap::{App, ArgMatches};
pub mod built_info;
mod commands;
mod config;
mod node;
@@ -25,7 +24,7 @@ fn main() {
println!("{}", banner());
let arg_matches = App::new("Nym Mixnode")
.version(built_info::PKG_VERSION)
.version(env!("CARGO_PKG_VERSION"))
.author("Nymtech")
.about("Implementation of the Loopix-based Mixnode")
.subcommand(commands::init::command_args())
@@ -60,7 +59,7 @@ fn banner() -> String {
(mixnode - version {:})
"#,
built_info::PKG_VERSION
env!("CARGO_PKG_VERSION")
)
}
+1 -2
View File
@@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::built_info;
use directory_client::presence::mixnodes::MixNodePresence;
use directory_client::DirectoryClient;
use log::{error, trace};
@@ -66,7 +65,7 @@ impl Notifier {
pub_key: config.pub_key_string,
layer: config.layer,
last_seen: 0,
version: built_info::PKG_VERSION.to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
};
Notifier {
net_client,
-4
View File
@@ -1,5 +1,4 @@
[package]
build = "build.rs"
name = "nym-validator"
version = "0.9.0-dev"
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jedrzej Stuczynski <andrew@nymtech.net>"]
@@ -26,8 +25,5 @@ tokio = { version = "0.2", features = ["full"] }
## internal
config = { path = "../common/config" }
[build-dependencies]
built = "0.4.3"
[dev-dependencies]
tempfile = "3.1.0"
-19
View File
@@ -1,19 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use built;
fn main() {
built::write_built_file().expect("Failed to acquire build-time information");
}
-16
View File
@@ -1,16 +0,0 @@
// Copyright 2020 Nym Technologies SA
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// The file has been placed there by the build script.
include!(concat!(env!("OUT_DIR"), "/built.rs"));
+2 -3
View File
@@ -14,7 +14,6 @@
use clap::{App, ArgMatches};
pub mod built_info;
mod commands;
mod config;
mod network;
@@ -27,7 +26,7 @@ fn main() {
println!("{}", banner());
let arg_matches = App::new("Nym Validator")
.version(built_info::PKG_VERSION)
.version(env!("CARGO_PKG_VERSION"))
.author("Nymtech")
.about("Implementation of Nym Validator")
.subcommand(commands::init::command_args())
@@ -62,7 +61,7 @@ fn banner() -> String {
(validator - version {:})
"#,
built_info::PKG_VERSION
env!("CARGO_PKG_VERSION")
)
}