This is an optiniated alternative implementation in Rust of the bitcoin-cli
tool to interact with Bitcoin Core's RPC interface.
We are currently in the ideation phase, don't expect to find a tool now.
Check the issues and tell us your chores with bitcoin-cli
and how it could be
improved.
The main tool provided by Bitcoin-core is
bitcoind
, a daemon that implements full node, wallet and mining logic.
bitcoin-cli
is a command line RPC client to interact with the node.
The following came as a project suggestion on the 2024 Chaincode Labs FOSS Program.
Some of the shortcomings of bitcoin-cli
:
-datadir
, when most other CLI
tools would use --datadir
.-datadir=foo
, when
most other tools would accept both --datadir=foo
and --datadir foo
.bitcoin-cli
is a bit long to type.bitcoin-cli
is written in C++, which deters
potential contributors, increases review burden, and is error prone and
unsafe.Improvements:
rust-bitcoin
and rust-bitcoincore-rpc
, for parsing bitcoin types
and interacting with bitcoind
's RPC interface.bitcoin-cli
in
particular would provide an extremely approachable way for them to do so.bitcoin
or even btc
, so it's easier to
type.bitcoind
, e.g.,
bitcoin daemon
, to improve the same issues with bitcoind
that
bitcoin-cli
has, e.g., argument parsing, argument validation, help text
formatting, and completion script support.--arg
and short arguments with -a
,
which is standard and familiar among the vast majority of CLI tools.--address foo
,
instead of as JSON. The ability to pass JSON arguments could be retained with
a subcommand for making arbitrary RPC calls which takes a single json
argument: bitcoin rpc --name generateblock --json SOME_JSON_BLOB
.The binary is called bitcoin
.
Usage: bitcoin [options] <method> [--arg value]... Send command to Bitcoin Core with named arguments
or: bitcoin [options] man Display list of supported methods
or: bitcoin [options] man <method> Display manual page for a method
We want to have a coherent user interface, so we define a semantic structure.
Options are information that influences the behavior of the tool and don't have connection to Core's RPC interface methods.
Methods are the available commands known and exposed by the RPC server.
Arguments are input data required by the specified method.
The man
ual method is used to show the manual page of a specified method.