Repository navigation
Run exnode as a public serverless endpoint - #11
Merged
Merged
Conversation
Passphrases and SDF archive mirrors were private to package main, so anything else that builds a node had to copy them. internal/network owns them now and the CLI looks them up there.
Behind a proxy every request arrives from the proxy's address, so the per-client limit became one limit shared by everybody. --client-ip-header (EXNODE_CLIENT_IP_HEADER) names a header to key on instead. It must be one the proxy overwrites on every request; the doc comment and README say so, since a client-controlled header would let anyone reset their own limit.
max-age covers browsers only; CDNs such as Vercel's edge cache a function response when it carries s-maxage. A bundle built from an archived ledger never changes, so shared caches may keep it for a year too.
api/exnode.go serves the same routes as exnode serve, built once per warm instance from the EXNODE_* environment, and vercel.json routes every path to it. Defaults suit a public endpoint: CORS for any origin, a rate limit keyed on X-Real-Ip, the checkpoint cache in the temp dir, and builds capped at 50 seconds. The node stays untrusted, so a deployment holds no secrets.
samjay8
added a commit
to Externalize-Labs/externalize
that referenced
this pull request
Oct 25, 2026
https://externalize-node.vercel.app is exnode running as a Vercel function (Externalize-Labs/externalize-node#11, #12). Like any node it is untrusted: the page verifies what it returns. ?node=URL still points elsewhere.
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.
Lets exnode run as a public, serverless endpoint, so the browser verifier can prove any mainnet transaction without the visitor running a node.
api/exnode.go+vercel.json: the same server asexnode serve, as a Vercel function configured from the usualEXNODE_*variables. Defaults suit a public endpoint: CORS for any origin, a rate limit of 1 request/s with bursts of 10, the checkpoint cache in the temp dir, and builds capped at 50 seconds, inside the platform's 60-second limit. The node stays untrusted, so a deployment holds no secrets.--client-ip-header/EXNODE_CLIENT_IP_HEADER: behind a proxy every request comes from the proxy's address, so the per-client limit became one shared limit. The limiter can now key on a header the proxy overwrites on every request, such as Vercel'sX-Real-Ip. The docs warn against client-controlled headers.s-maxageon bundles: CDNs cache function responses only with it. Bundles of archived ledgers never change, so each is built once.internal/network: the network table moves out ofcmd/exnode, so the CLI and the function share it.Checked
go vet,go test ./..., and golangci-lint (0 issues). New tests cover the header-keyed limiter (two clients behind one proxy address), thes-maxageheader, and the function's defaults.externalize verify, signed by 30 validators from all 10 tier-1 organizations.