Skip to content

feat: integrate chopsticks proxy directly into nigiri CLI - #248

Open
tiero wants to merge 5 commits into
vulpemventures:masterfrom
tiero:feat/embedded-chopsticks
Open

feat: integrate chopsticks proxy directly into nigiri CLI#248
tiero wants to merge 5 commits into
vulpemventures:masterfrom
tiero:feat/embedded-chopsticks

Conversation

@tiero

@tiero tiero commented Feb 27, 2026

Copy link
Copy Markdown
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'
@socket-security

socket-security Bot commented Feb 27, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgithub.com/​gorilla/​mux@​v1.8.198100100100100
Addedgithub.com/​sdomino/​scribble@​v0.0.0-20191024200645-4116320640ba100100100100100

View full report

Concierge and others added 2 commits February 27, 2026 16:08
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>
@tiero

tiero commented Apr 20, 2026

Copy link
Copy Markdown
Member Author

This would
Remove an extra container and move the extra logic in a single place (setup services after starting them)

We already did that with arkd that is not managed by chopstick anymore

Ideally we may want to add any TCP proxy we need for electrum as well

@altafan @Kukks

tiero and others added 2 commits April 22, 2026 16:21
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>
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