diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2877be6 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "acrate-nodeinfo/nodeinfo"] + path = acrate-nodeinfo/spec + url = https://github.com/jhass/nodeinfo.git diff --git a/acrate-nodeinfo/Cargo.toml b/acrate-nodeinfo/Cargo.toml index 9caaee0..d74de93 100644 --- a/acrate-nodeinfo/Cargo.toml +++ b/acrate-nodeinfo/Cargo.toml @@ -4,7 +4,10 @@ version = "0.1.0" edition = "2021" [dependencies] +acrate-hostmeta = { version = "0.1.0", path = "../acrate-hostmeta" } log = "0.4.22" +reqwest = { version = "0.12.9", features = ["json", "stream"] } +serde = { version = "1.0.214", features = ["derive"] } [dev-dependencies] pretty_env_logger = "0.5.0" diff --git a/acrate-nodeinfo/spec b/acrate-nodeinfo/spec new file mode 160000 index 0000000..1ad645d --- /dev/null +++ b/acrate-nodeinfo/spec @@ -0,0 +1 @@ +Subproject commit 1ad645d23cce892dbb6fbaf349760dfb0f1aeaa1 diff --git a/acrate-nodeinfo/src/lib.rs b/acrate-nodeinfo/src/lib.rs index b93cf3f..90cfed6 100644 --- a/acrate-nodeinfo/src/lib.rs +++ b/acrate-nodeinfo/src/lib.rs @@ -1,14 +1,3 @@ -pub fn add(left: u64, right: u64) -> u64 { - left + right -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn it_works() { - let result = add(2, 2); - assert_eq!(result, 4); - } -} +//! Serde-based [NodeInfo] parser. +//! +//! [NodeInfo]: https://github.com/jhass/nodeinfo/blob/main/PROTOCOL.md