feat(node): initialize decentralized P2P relay queue, Key Transparency log, and config loader

Open
#1 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
docker, markdown, rust

Research direction

The repository is empty: src/ and docs/ have no files, so start by reading the planned layout in Cargo.toml and the src/config.rs section, then tests/node_test.rs. The issue bundles config loading, a mailbox relay, a Merkle key-transparency log and docs into one task, so split it before starting. Done means cargo fmt --check, cargo clippy -- -D warnings, cargo test, and markdownlint pass.

Written by the indexing model from the issue text.

Description

area::node effort::m impact::high priority::high source::user status::review type::feature

Description

sonaraim-node requires its foundational architecture, zero-hardcode configuration loader, ephemeral P2P store-and-forward relay queue (MailboxStore), append-only Key Transparency Merkle log (KeyTransparencyLog), health telemetry endpoint serializer (HealthStatus), and complete standard documentation suite (README.md, REMOTE.md, docs/STANDARDS.md, docs/ARCHITECTURE.md, docs/DIAGRAMS.md, docs/API.md, docs/CONFIGURATION.md, samples/.env.example, configs/node.example.toml, Dockerfile).

Affected Files

  • Cargo.toml (lines 1-20)
  • Dockerfile (lines 1-35)
  • README.md (lines 1-90)
  • REMOTE.md (lines 1-50, local operational reference, gitignored)
  • docs/STANDARDS.md (lines 1-80)
  • docs/ARCHITECTURE.md (lines 1-110)
  • docs/DIAGRAMS.md (lines 1-90)
  • docs/API.md (lines 1-90)
  • docs/CONFIGURATION.md (lines 1-80)
  • samples/.env.example (lines 1-20)
  • configs/node.example.toml (lines 1-25)
  • src/lib.rs (lines 1-25)
  • src/config.rs (lines 1-140)
  • src/relay.rs (lines 1-170)
  • src/merkle.rs (lines 1-190)
  • src/health.rs (lines 1-90)
  • src/main.rs (lines 1-70)
  • tests/node_test.rs (lines 1-150)

Current State / Problem Snippet

$ ls -la src/ docs/
src/:
total 0
docs/:
total 0

Impact

Without the sonaraim-node relay queue, Key Transparency log, and configuration loader, decentralized nodes cannot store and forward metadata-blind sealed envelopes for offline peers, generate cryptographic inclusion proofs for did:sonaraim and did:web identities, or expose standardized health telemetry.

Proposed Solution

  1. Implement src/config.rs with NodeConfig::from_env() and NodeConfig::from_map() reading NODE_ID, NODE_HTTP_HOST, NODE_HTTP_PORT, NODE_P2P_LISTEN_ADDR, and NODE_ENVELOPE_TTL_SECONDS with zero hardcoded values.
  2. Implement src/relay.rs with MailboxStore managing SealedEnvelope items, enforcing TTL expiration, and computing deterministic blind push wake-up tokens.
  3. Implement src/merkle.rs with KeyTransparencyLog supporting did:sonaraim and did:web identity entries, deterministic tree head computation, and Merkle inclusion proof generation/verification.
  4. Implement src/health.rs and src/main.rs for /health status reporting and configuration startup checks.
  5. Create tests/node_test.rs and the complete English documentation suite (README.md, REMOTE.md, docs/*.md, samples/.env.example, configs/node.example.toml, Dockerfile).

Acceptance Criteria

  • NodeConfig::from_env() loads all node parameters strictly from environment variables and fails explicitly when any required variable is missing or invalid.
  • MailboxStore stores and drains SealedEnvelope items per recipient mailbox, enforces TTL expiration, and generates deterministic blind push wake-up tokens.
  • KeyTransparencyLog appends did:sonaraim and did:web identity entries, computes deterministic tree heads, and generates verifiable inclusion proofs.
  • HealthStatus serializes /health telemetry JSON payloads accurately.
  • cargo fmt --check, cargo clippy -- -D warnings, and cargo test pass with zero warnings.
  • markdownlint README.md REMOTE.md docs/*.md passes with zero errors, docs/ARCHITECTURE.md uses text and ASCII diagrams only, and docs/DIAGRAMS.md holds all Mermaid diagrams.
Dominant language
Rust
Stars
0
Forks
0
Avg merge
4m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from alfonsodg/sonaraim-node

All issues in alfonsodg/sonaraim-node

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.