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
-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,