Skip to content

Implement decdn setup — guided node onboarding wizard (ADR 019 Phases 1–2) #933

Closed

Description

@alpergundogdu

Problem

ADR 019 § Deferred & Open calls for a decdn setup command that "walks through Phases 1–2 interactively, generates keys, builds the registerNode calldata, and submits the transactions" to reduce operator error. ADR 019 §10 notes the failure class it prevents: steps run out of order or an under-funded wallet produce mid-sequence reverts and silent protocol failures.

Decision: thin orchestration over the primitives — no new on-chain logic

decdn setup chains the existing primitive commands with pre-flight checks and a readiness summary. It must NOT introduce any chain logic of its own; it is sugar over key-gen (#…), node bond (#932), and node register (#929).

Plan

decdn setup --mbps <N> --region <CC> [--multiaddr …]:

  1. Pre-flight (fail early, before any tx):
    • Clock-skew check — local offset within 10 s of UTC (ADR 019 §1.2); a skew ≥ 60 s silently breaks gossip.
    • Native-gas balance > the Phase-2 transaction cost estimate.
    • TOKEN balance ≥ bondRequired(N) (read from CapacityBond).
    • RPC reachability (reuse the daemon's probe_rpc).
  2. Keys: run key-gen if node.secret / the eth keystore are absent (idempotent — never overwrites without --force).
  3. Stake: invoke the node bond --mbps N flow (idempotent stake-to-tier, Implement decdn node bond — idempotent stake-to-capacity-tier (ADR 019 §2.1–2.2) #932).
  4. Register: invoke the node register --region CC --multiaddr … flow (Implement decdn node register (ADR 019 §2.3 on-chain node registration) #929), surfacing each tx hash.
  5. Readiness summary: print the Phase 5 acceptance-criteria table (registry-active, bond, region, multiaddrs) so the operator sees a single go/no-go signal.

Interactive by default (prompts for missing values, confirms the bond amount before submitting); --yes for non-interactive/CI use; --dry-run to preview the whole sequence.

Sequencing

Blocked on #929 (register) and #932 (bond) — setup has nothing to orchestrate until both primitives exist. Per YAGNI, build it only once those land and only if the two-command flow proves error-prone in practice; the pre-flight checks are the part that adds genuine value over running the primitives by hand.

Out of scope

  • Any on-chain logic (lives in the primitive commands / contracts).
  • Automated updateMultiaddrs refresh and EOA→Safe migration (separately deferred in ADR 019 / appendix-operator-key-rotation).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:featurerust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions