Regtest tooling
Bitcoin CLI
An understandable command-line boundary around Bitcoin Core, from configuration and typed responses to actionable RPC errors.
Software engineer
System flow
- 01Parse a command
- 02Resolve configuration
- 03Call Bitcoin Core
- 04Decode the response
- 05Print results or errors
Scope & architecture
Bitcoin CLI exposes blockchain information, wallet information, balances, receiving addresses, and a generic RPC command. Bitcoin Core remains responsible for node and wallet behavior; this project supplies the client interface.
Command handling, configuration, RPC transport, errors, and logging are separate modules. Named commands use typed responses, while generic RPC parameters are parsed as JSON where possible and otherwise treated as strings.
Packages & boundaries
Clap supplies the command interface, blocking Reqwest supplies HTTP transport with a configured timeout, and Serde handles request and response structures. URL handles wallet endpoint construction; TOML and Dotenvy support configuration; Tracing provides structured logs.
Thiserror represents RPC failures, while Anyhow adds command context. Authentication, transport, invalid responses, and missing-wallet failures have distinct error paths. Logs go to stderr so stdout remains available for command results.
Configuration & wallet calls
The documented configuration precedence is command-line flags, environment variables, TOML configuration, then defaults. Wallet calls use an encoded wallet-specific endpoint instead of assuming that every node request targets the same wallet.
Verification & next steps
The README records manual verification of required commands against a Polar-managed Bitcoin Core regtest node and includes terminal output. Focused unit tests are present; automated integration tests remain on the roadmap. The portfolio review did not independently run the CLI or node.
The next verification layer is repeatable integration testing for real RPC responses, missing wallets, authentication failures, and connection timeouts.