Posemesh Node Registration SDK
This crate packages the logic required for nodes to register with the discovery service.
Modules
crypto: helpers for secp256k1 key loading, Ethereum address derivation, and SIWE signature generation.http: anaxumrouter 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.
Adding the Dependency
# Cargo.toml
[]
= "0.2.1"
Example: Mounting the HTTP Routes
use Router;
use ;
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().
Example: Spawning the Registration Loop
use ;
async
run_registration_loop takes care of:
- Generating SIWE messages/signatures for registration payloads.
- Persisting registration state for downstream consumers.
- Parking once the runtime has successfully acquired registration, then re-arming only on recovery signals.
- Enforcing a process-local lock so that only one registrar task runs at a time.
- Exponential backoff with jitter when DDS requests fail, while rate-limiting repeated
409 Conflictwarnings.