feat(cli): add yacd wallet verbs with direct tx submission#106
Merged
Conversation
Add a `yacd wallet` subtree (list/add/topup/export/remove) that manages test wallets as labeled Kubernetes Secrets and funds them by building, signing, and submitting transactions directly against Ogmios/Kupo via internal/cardano/tx, spending from the genesis-funded faucet wallet. The standalone `yacd topup` command and its faucet-HTTP transport + token trust gate are removed and folded into `wallet topup` (faucet is the default --from source). New: wallet.DecodePaymentKeyEnvelope (manager-safe); a cli/internal/wallet store + name|pubkey|address selector + embedded wordlist; kube.Client Secret ops; an injectable tx.Submitter seam for unit-testable funding. The manager (./cmd) stays free of ogmigo/kugo/tx; only the CLI gains the chain-tx stack. Phase 3 of the CLI-native wallets / faucet-removal plan. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jmgilman
added a commit
that referenced
this pull request
Jun 4, 2026
- Route Apollo's genesis-config warning (a hardcoded fmt.Printf to stdout during chain-context init) to stderr while funding, so 'wallet topup/add --json' emits valid JSON. - Validate the wallet name as a DNS-1123 label up front, with a clear error instead of a raw Kubernetes label-validation message. - Report a missing wallet as 'wallet "X" not found' for 'export' and 'remove' (consistent with the funding path), instead of leaking the Secret name or printing a misleading 'Removed'. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
Full manual functional test (Kind dev stack) — done, with fixesRan the complete Found and fixed 4 UX issues (commit
Added test coverage for the new validation + not-found paths. |
jmgilman
added a commit
that referenced
this pull request
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 3 — CLI-native wallets / faucet-removal plan
Adds a
yacd walletcommand subtree that manages test wallets as Kubernetes Secrets and funds them by building, signing, and submitting transactions directly against Ogmios/Kupo (viainternal/cardano/tx), spending from the genesis-fundedfaucetwallet (P2). The standaloneyacd topupand its faucet-HTTP transport + token trust gate are removed and folded intowallet topup.Verbs
yacd wallet list NET [--json]yacd wallet add NET [--name N] [--topup L] [--await]— keygen → owned Secret → optional fund fromfaucetyacd wallet topup NET WALLET L [--from SRC] [--await]— fund a wallet (or raw address) fromfaucet/--fromyacd wallet export NET WALLET [--out DIR] [--force]— write0600.skey/.vkey/.addryacd wallet remove NET WALLETWALLETis a second positional accepting a name / pubkey-hex / bech32 address (a raw address funds directly). Names come from an embedded adjective-noun wordlist (collision-checked, ~50/network ceiling).Internals
wallet.DecodePaymentKeyEnvelope(manager-safe) decodes the cardano-cli key envelope → raw 32-byte hex for bothskey(signing) andvkey(pubkey).cli/internal/walletstore (labeled Secrets matching P2'syacd.meigma.io/wallet-name/wallet-source, ownerRef → the network) + name/pubkey/address selector + wordlist.kube.Clientgains Secret CRUD/list-by-label; an injectabletx.Submitterseam makes the funding verbs unit-testable without a real chain.forwardEndpoints; confirmation reuses the kugo path.Manager boundary (load-bearing)
go list -deps ./cmdstays free of ogmigo/kugo/internal/cardano/tx;internal/cardano/wallet's new helper is manager-safe (cbor/json/ed25519 only). Only the CLI gains the chain-tx stack.Verification
moon run root:check✅ ·moon run root:test✅ (wallet verbs + store + decode, all against mocks —--from, readiness gating, partial-failure, export edge cases, selector resolution, ceiling).gofmt/go build/go vetclean.wallet add alice --topup 1000000000 --awaithad the CLI build+sign+submit a real funding tx from the faucet wallet (tx1198bc05…, confirmed on-chain);cardano-cli query utxoshowed alice holding 1,000,000,000 lovelace;wallet listshowed her;wallet exportwrote a valid0600cardano-cli.skey.Known follow-up (not blocking)
Apollo's chain-context init logs a transient Ogmios websocket hiccup (the known ogmigo/Gorilla-WS behavior) during funding; the tx still succeeds. Worth quieting/handling later.
Plan context
Phase 3 of 5. Next: P4 (cut over
devnet/dev-wallet funding to the CLI, then delete the in-cluster faucet service +spec.chainAPI.{faucet,wallet}).🤖 Generated with Claude Code