Repository navigation
Description
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 …]:
- 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 fromCapacityBond). - RPC reachability (reuse the daemon's
probe_rpc).
- Keys: run
key-genifnode.secret/ the eth keystore are absent (idempotent — never overwrites without--force). - Stake: invoke the
node bond --mbps Nflow (idempotent stake-to-tier, Implementdecdn node bond— idempotent stake-to-capacity-tier (ADR 019 §2.1–2.2) #932). - Register: invoke the
node register --region CC --multiaddr …flow (Implementdecdn node register(ADR 019 §2.3 on-chain node registration) #929), surfacing each tx hash. - 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
updateMultiaddrsrefresh and EOA→Safe migration (separately deferred in ADR 019 / appendix-operator-key-rotation).
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
feat(cli): add `decdn node bond` — idempotent stake-to-tier (#932)
feat(cli): add `decdn node bond` — idempotent stake-to-tier (#932)
feat(cli): add `decdn node bond` — idempotent stake-to-tier (#932) (#934
feat(cli): decdn setup — guided node onboarding wizard (#933) (#953)