feat: integrate chopsticks proxy directly into nigiri CLI - #248
Open
tiero wants to merge 5 commits into
Open
Conversation
tiero
commented
Feb 27, 2026
Member
- Embed the chopsticks HTTP proxy directly into the nigiri binary
- Start proxy in-process (goroutine) during 'nigiri start' on :3000/:3001
- Remove chopsticks/chopsticks-liquid Docker containers from compose
- Update faucet, push, mint commands to use embedded proxy ports
- Add 'nigiri serve' command for standalone proxy usage
- Update ark service to reach proxy via host.docker.internal
- Graceful proxy shutdown on 'nigiri stop'
- Embed the chopsticks HTTP proxy directly into the nigiri binary - Start proxy in-process (goroutine) during 'nigiri start' on :3000/:3001 - Remove chopsticks/chopsticks-liquid Docker containers from compose - Update faucet, push, mint commands to use embedded proxy ports - Add 'nigiri serve' command for standalone proxy usage - Update ark service to reach proxy via host.docker.internal - Graceful proxy shutdown on 'nigiri stop'
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Tests: - nigiri start/stop lifecycle - Electrs proxy endpoints (/blocks/tip/height, /blocks/tip/hash, /fee-estimates) - Faucet endpoint with address generation - Transaction indexing verification Run with: go test -tags=e2e ./test -run TestE2ESmoke Quick check: NIGIRI_E2E_QUICK=1 go test ./test -run TestE2ESmokeQuick
The proxy was started as goroutines inside `nigiri start`, but urfave/cli exits the process on action return — killing the proxy immediately. Spawn `nigiri serve` as a detached subprocess (Setsid) with a PID file so it survives parent exit and can be stopped by `nigiri stop`. Also bump proxy WriteTimeout to 30s so faucet + 101-block mining completes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Member
Author
Bitcoin Core v31.0 added a check in CreateWallet() that rejects empty
wallet names ("Wallet name cannot be empty"). The proxy (ported from
nigiri-chopsticks) was calling `createwallet ""` on startup and routing
RPCs through `/wallet/` with an empty trailing name — both break on v31.
Default the wallet name to "nigiri", plumb it through CreateWalletIfNotExists,
and only create the wallet if it isn't already loaded. Works unchanged on
v30 and forward-compatible with v31+.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Strip trailing blank line introduced when the lastIndex helper and serveDefaultsFile var were removed, so `gofmt -l .` is clean on the files touched by this PR. Co-Authored-By: Claude Opus 4.7 <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.