Feature/add rocket (#600)

* Added rocket at a git tag

* Adding Rocket to the mixnode

* Verloc route now in place

* Adding an http api startup notification

* Updated version number to 0.10.1-dev

* Fixing clippy warnings

* Compressing split a bit

* Adjusted used version of js-sys

Co-authored-by: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
This commit is contained in:
Dave Hrycyszyn
2021-05-11 12:40:29 -04:00
committed by GitHub
parent 2f9e67e8b2
commit 7dc4d653c2
21 changed files with 644 additions and 60 deletions
+1
View File
@@ -0,0 +1 @@
pub(crate) mod verloc;
+28
View File
@@ -0,0 +1,28 @@
use rocket_contrib::json::Json;
use serde::Serialize;
/// Provides verifiable location (verloc) measurements for this mixnode - a list of the
/// round-trip times, in milliseconds, for all other mixnodes that this node knows about.
#[get("/verloc")]
pub(crate) fn verloc() -> Json<Vec<Foomp>> {
// replace the foomps with a reference to the measurements vec :)
let foomp1 = Foomp {
ip: "1.2.3.4".to_string(),
port: "1789".to_string(),
identity_key: "abc".to_string(),
};
let foomp2 = Foomp {
ip: "2.3.4.5".to_string(),
port: "1789".to_string(),
identity_key: "def".to_string(),
};
let foomps = vec![foomp1, foomp2];
Json(foomps)
}
#[derive(Serialize)]
pub(crate) struct Foomp {
ip: String,
port: String,
identity_key: String,
}