Skip to content

feat: network faucet field and akt faucet command - #92

Open
cloud-j-luna wants to merge 1 commit into
mainfrom
feat/network-faucet
Open

feat: network faucet field and akt faucet command#92
cloud-j-luna wants to merge 1 commit into
mainfrom
feat/network-faucet

Conversation

@cloud-j-luna

@cloud-j-luna cloud-j-luna commented Aug 31, 2026

Copy link
Copy Markdown
Member

What

Adds an optional faucet URL to each network and a top-level akt faucet command for requesting test funds.

For someone testing on sandbox or testnet, akt faucet prints the active network's faucet URL and the account address to paste; akt faucet --send submits the request for you and reports the transaction hash. For the maintainer, it is one optional field on the network model plus a command whose behavior is a single ordered state machine.

Details

  • Data. Network.Faucet, optional. Populated from the upstream akash-network/net registry meta.json faucets[0].url during first-run bootstrap, from the sandbox template, and manually via --faucet on akt context network create/edit. Renders in network show (pretty and json), omitted when empty. Mainnet publishes no faucets entry upstream, so it never gets one.
  • Command. akt faucet (display) is read-only. akt faucet --send POSTs the address to the faucet's /faucet endpoint. The deployed sandbox/test faucets accept this unauthenticated and broadcast a MsgSend, returning a transaction hash; verified end to end on sandbox-2 (25 AKT credited, tx code 0). --send records a type=faucet action-log entry (state-changing per SPEC §5.6) and is refused on mainnet. akt context show points at the command for discovery.

Behavior

akt faucet runs an ordered check, first match wins:

  • Console context: refuses, points at Console funding (managed wallets have no chain faucet).
  • No network attached: refuses, asks to attach a test network.
  • Mainnet with no faucet: refuses, distinct from a test network with no faucet URL configured.
  • Test network with no faucet configured: points at akt context network edit ... --faucet <url>.
  • Faucet present: prints network, full address, and URL (pretty or json).

--send additionally refuses on mainnet and requires a resolvable default account. The faucet enforces a per-address rate limit (about one grant/day), which surfaces as the faucet's error message.

Verification

  • Full unit suite green (GOWORK=off go test, e2e excluded as CI does), including new tests for the --send HTTP path, action-log entries on success and failure, mainnet refusal, and JSON output shape (via httptest, no real network in tests).
  • Drove the compiled binary through every state plus --send and --output json, and confirmed the resulting transaction on-chain.

@cloud-j-luna
cloud-j-luna force-pushed the feat/network-faucet branch 2 times, most recently from 42887d5 to 9bd9eba Compare September 1, 2026 14:23
@cloud-j-luna
cloud-j-luna marked this pull request as ready for review September 1, 2026 15:52
@cloud-j-luna
cloud-j-luna requested a review from a team as a code owner September 1, 2026 15:52
Networks gain an optional faucet URL, populated from the upstream
akash-network/net registry meta.json faucets entry and settable with
--faucet on 'akt context network create/edit'. Mainnet publishes no
faucet entry, so it never gets one; the field shows in network show.

'akt faucet' resolves the active context's network faucet and default
account. By default it prints the faucet URL and the address to paste;
with --send it submits the address to the faucet's /faucet endpoint and
reports the returned transaction hash. Behavior is a single ordered
state machine covering Console-managed, network-less, mainnet, and
unconfigured contexts. --send records a type=faucet action-log entry
and is refused on mainnet. 'akt context show' points at the command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant