| Crates.io | posemesh-compute-node |
| lib.rs | posemesh-compute-node |
| version | 0.3.0 |
| created_at | 2025-10-17 05:00:41.174918+00 |
| updated_at | 2026-01-20 01:47:24.379519+00 |
| description | Posemesh compute node engine: config, DDS/DMS, heartbeat, storage (no persistence). |
| homepage | |
| repository | https://github.com/aukilabs/prompting |
| max_upload_size | |
| id | 1887133 |
| size | 368,850 |
posemesh-compute-node hosts the node engine and all reusable infrastructure that
the binary crate (bin) wires together. The crate is responsible for
loading configuration, authenticating with DDS, polling DMS for work, managing
sessions, streaming heartbeats, and brokering storage traffic to the domain
server on behalf of capability-specific runners.
config) with typed accessors and sane
defaults where permitted.telemetry) that installs a tracing subscriber and
exposes helper spans.dds::register) and the in-memory persistence stub
used by legacy registration callbacks (dds::persist).auth module).dms::client) plus request/response data contracts.storage::{input, output, client, token}).session, heartbeat,
engine::HeartbeatDriver).poller) and top-level execution loop (engine).http); compute nodes no longer
need to expose inbound endpoints.telemetry::init_from_env() installs logging based on LOG_FORMAT.NodeConfig::from_env() loads operational settings. The node currently
requires DDS configuration (see below) because SIWE tokens are mandatory.RunnerRegistry; the binary decides which
capabilities to advertise.dds::register::spawn_registration_if_configured() starts the outbound
SIWE-based registration loop, and auth::SiweAfterRegistration waits for a
successful registration before requesting access tokens.run_node loop obtains an access token from DDS, builds a DMS
client, leases tasks, initializes session state, and dispatches to the
correct runner via RunnerRegistry::run_for_lease.HeartbeatDriver coalesces progress updates and posts heartbeats on the TTL
schedule computed by session::HeartbeatPolicy, refreshing storage tokens
when DDS returns new ones.complete or fail, and the cycle restarts.Required environment variables:
REG_SECRET — shared secret issued by DDS during provisioning.SECP256K1_PRIVHEX — 32-byte hex-encoded private key used to sign SIWE
messages.Optional environment variables:
DMS_BASE_URL (default https://dms.auki.network/v1) — base URL of the DMS
REST API.DDS_BASE_URL (default https://dds.auki.network) — base URL of the DDS API
(used for SIWE authentication).REQUEST_TIMEOUT_SECS (default 60) — per-request timeout applied to DMS
calls.NODE_VERSION (default crate version) — optional override for the advertised
node version.HEARTBEAT_JITTER_MS (default 250) — backoff applied when coalescing
heartbeat updates for the legacy scheduler in heartbeat::run_scheduler.POLL_BACKOFF_MS_MIN / POLL_BACKOFF_MS_MAX (defaults 1000 / 30000) —
jitter range used between idle lease polls.TOKEN_SAFETY_RATIO (default 0.75) — SIWE token renewal threshold.TOKEN_REAUTH_MAX_RETRIES (default 3) — retries before bailing on token
refresh.TOKEN_REAUTH_JITTER_MS (default 500) — jitter applied between retries.REGISTER_INTERVAL_SECS (default 120) — DDS registration loop cadence.REGISTER_MAX_RETRY (default -1, meaning infinite retries) — DDS
registration retry cap.MAX_CONCURRENCY (default 1) — staging knob for future multi-runner
concurrency.LOG_FORMAT (default json) — set to text for pretty console logs.ENABLE_NOOP (default false) — when true the binary registers noop runners.NOOP_SLEEP_SECS (default 5) — noop runner sleep duration.auth::siwe_after_registration — waits for DDS registration, then spins up
the SIWE token manager and refresh loop.dds::register — normalizes versions (stripping leading v), validates the
secp256k1 key, and launches the registration task using posemesh-node-registration.engine — orchestrates leasing, cancellation, heartbeat posting, and
completion/failure reporting. The RunnerRegistry façade makes it easy to add
new capabilities.storage::client — performs authenticated multipart downloads/uploads
against the domain server using safe temporary directories.session — tracks lease metadata, computes TTL-driven heartbeat deadlines,
and survives new heartbeats refreshing tokens or signalling cancellation.cargo test -p posemesh-compute-node to exercise storage, session, and DDS
registration behaviour.LOG_FORMAT=text is useful during local development to keep logs readable.