Conversation
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.
Motivation
/health,POST /faucet,GET /status/:txHash) and rate-limiting/token requirements for safety.Description
tools/faucet/publicand addingGET /ui(changes intools/faucet/server.js).tools/faucet/public/index.html,tools/faucet/public/app.js, andtools/faucet/public/styles.cssimplementing MetaMask connect (auto-fill), token storage inlocalStorage(qik_faucet_token), health polling, faucet requests withX-FAUCET-TOKEN, tx-status polling, and simple copy buttons.401payload for missing/invalid token, consistent429rate-limit payload (error: "rate_limited", message, retryAfterSec), clearer/healthand/status/:txHasherror shapes, and validation messages (changes intools/faucet/server.js).1/min) and per-destination (1/5min) windows with proper retry response formatting.tools/faucet/server.js).make faucet-upnow prints the UI and health URLs and a newmake faucet-uitarget prints localhost + best-effort LAN URLs (changes inMakefile).README.md).Testing
node --check tools/faucet/server.jsandnode --check tools/faucet/public/app.jssucceeded.make faucet-uiexecuted and printed the expected local and LAN URLs (success).curl; results:GET /andGET /uireturned the UI HTML (success).GET /healthreturned200with{ ok: true, chainId, latestBlock }(success).POST /faucetwithoutX-FAUCET-TOKENreturned401with the JSON{ error: "unauthorized", message: "Missing or invalid X-FAUCET-TOKEN" }(success).POST /faucetwith token exercised tx submission and error paths from the mocked RPC and returned appropriatetxHashor500/tx_failedmessages depending on the RPC behavior (observed behavior validated).429responses withretryAfterSec(success).Codex Task