| Crates.io | posemesh-node-registration |
| lib.rs | posemesh-node-registration |
| version | 0.2.0 |
| created_at | 2025-09-18 03:30:31.570567+00 |
| updated_at | 2026-01-20 01:45:28.570962+00 |
| description | Posemesh node registration client and Axum handlers for DDS callbacks. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1844211 |
| size | 88,503 |
This crate packages the logic required for nodes to register with the discovery service.
crypto: helpers for secp256k1 key loading, Ethereum address derivation, and SIWE signature generation.http: an axum router that handles legacy DDS callbacks (e.g. /internal/v1/registrations) and health probes.state: in-memory cache plus persistence primitives for registration status and a cross-process lock.register: async registration client that periodically signs and submits SIWE-based registration payloads to DDS.# Cargo.toml
[dependencies]
posemesh-node-registration = "0.1.0"
use axum::Router;
use posemesh_node_registration::http::{router_dds, DdsState};
fn build_app() -> Router {
let dds_state = DdsState;
// Merge with your existing routes as needed
router_dds(dds_state)
}
The callback handler automatically persists secrets in-memory via state::write_node_secret.
Consumers that need to read the cached secret can call state::read_node_secret().
use posemesh_node_registration::register::{self, RegistrationConfig};
async fn spawn_registration(config: RegistrationConfig) {
tokio::spawn(register::run_registration_loop(config));
}
fn build_registration_config() -> RegistrationConfig {
RegistrationConfig {
dds_base_url: "https://dds.auki.network".into(),
node_version: "1.0.0".into(),
reg_secret: "my-reg-secret".into(),
secp256k1_privhex: std::env::var("SECP256K1_PRIVHEX").expect("missing key"),
client: reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(10))
.build()
.expect("client"),
register_interval_secs: 60,
max_retry: -1,
capabilities: vec![
"/reconstruction/global-refinement/v1".into(),
"/reconstruction/local-refinement/v1".into(),
],
}
}
run_registration_loop takes care of: