Repository navigation
ci(examples): fund each Devnet run from one faucet grant instead of a secret - #41
Merged
Merged
Conversation
… secret The scheduled Examples workflow no longer reads a repository secret. Each run generates a throwaway account with `python -m examples.faucet_funder`, which makes one faucet request (with the examples' bounded TryLater retry), waits for the balance, prints only the private key on stdout and everything else on stderr, and refuses Mainnet. The workflow masks the key with `::add-mask::` and runs `make examples EXAMPLES_EXCLUDE=faucet` from that account, so a run makes one faucet request from the runner's IP address. `faucet.py` is excluded in CI because its own request would be a second one. `make examples` takes `EXAMPLES_EXCLUDE` to leave examples out. The examples README describes the funder and the workflow. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
What
The scheduled Examples workflow (#39) no longer needs the
SUPRA_EXAMPLES_PRIVATE_KEYrepository secret, which wouldhave to be replaced after every Devnet reset. Each run funds itself from the Devnet faucet with one request and runs
the examples from that account.
Changes
examples/faucet_funder.py(python -m examples.faucet_funder; not an example):TryLaterretry and wait.
.github/workflows/examples.yaml:secrets.reference; the key-present check and the skip notice are removed.key="$(uv run python -m examples.faucet_funder)", masks it with::add-mask::, and runsSUPRA_EXAMPLES_PRIVATE_KEY="$key" make examples EXAMPLES_EXCLUDE=faucet.faucet.pyis left out in CI: its own request would be a second faucet request from the runner's IP address,and the funding step makes the same SDK faucet call.
workflow_dispatchtriggers only,contents: read,persist-credentials: false, pinnedactions, uv 0.13.7,
UV_FROZEN=1andUV_NO_SYNC=1on the step that holds the key, and the concurrency group,whose comment now gives its reason as the faucet's per-IP limit.
Makefile:make examplestakesEXAMPLES_EXCLUDEto leave examples out.examples/README.md: without a key each example makes its own faucet request, which Devnet's per-IP limit canrefuse. To run all of them against Devnet, set a funded key or create one from a single grant:
SUPRA_EXAMPLES_PRIVATE_KEY="$(uv run python -m examples.faucet_funder)" make examples EXAMPLES_EXCLUDE=faucet.The CI workflow is described.
Why one request is enough
from the funding account.
and each run funds a new address.
request per run stays well within a limit of that kind; the limit's value is not published.
Checks
make fmt-check,make lint,make typecheck(45 files),make build,actionlint: pass.make test-unit: 394 tests, 26 node-backed skipped. One failure, whichmasterhas too and which a separate PRfixes (
test_a_node_without_the_route_raises_api_error, from feat(client)!: typed HTTP errors, a configurable timeout, opt-in GET retries and faucet TryLater #35 and feat(rest): add account_history to master, iter_account_fa_transactions, and one cursor rule #40 merging). New offline tests check that thefunder's stdout is exactly one key line, that its progress goes to stderr, and that it refuses Mainnet.
supra_node_v12.0.0.rc7localnet (500 SUPRA per faucet grant), the workflow's command (funder, thenmake examples EXAMPLES_EXCLUDE=faucetwith its key) ran four times:simulate_transfer_coinon. A funding transferfrom the shared account stayed pending across the localnet's first epoch change, and every later example was
refused because it reused that sequence number. A localnet changes epoch within minutes of starting; Devnet's
epochs are longer. A run that hits it fails rather than passing.
🤖 Generated with Claude Code