feat: start to implement node_registry

This commit is contained in:
2024-03-01 18:23:40 +01:00
parent 27b6514167
commit 738bc1cf7a
8 changed files with 1473 additions and 140 deletions

View File

@ -0,0 +1,18 @@
pub struct NodeRegistryCore {
storage_path: String,
}
impl NodeRegistryCore {
pub fn new(storage_path: &str) -> NodeRegistryCore {
NodeRegistryCore {
storage_path: storage_path.to_string()
}
}
// Function that takes a string and returns bytes
pub fn string_to_bytes(&self, input: &str) -> Vec<u8> {
// Combine the initialization argument and input string into bytes
let result: Vec<u8> = format!("{} {}", self.storage_path, input).into_bytes();
result
}
}