Linux command
bitcoin-cli 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Get
bitcoin-cli getblockchaininfo
Get
bitcoin-cli getbalance
Send
bitcoin-cli sendtoaddress [address] [amount]
Get
bitcoin-cli getnewaddress
List
bitcoin-cli listtransactions
说明
bitcoin-cli is the command-line interface for Bitcoin Core. It connects to a running bitcoind daemon via RPC and allows querying blockchain data, managing wallets, and performing transactions. The tool is essential for interacting with Bitcoin Core nodes programmatically or from scripts.
参数
- -conf=_file_
- Configuration file
- -datadir=_dir_
- Data directory
- -rpcuser=_user_
- RPC username
- -rpcpassword=_pass_
- RPC password
- -rpcconnect=_host_
- RPC host (default: localhost)
- -rpcport=_port_
- RPC port (default: 8332)
- -testnet
- Use testnet
- -regtest
- Use regression test network
FAQ
What is the bitcoin-cli command used for?
bitcoin-cli is the command-line interface for Bitcoin Core. It connects to a running bitcoind daemon via RPC and allows querying blockchain data, managing wallets, and performing transactions. The tool is essential for interacting with Bitcoin Core nodes programmatically or from scripts.
How do I run a basic bitcoin-cli example?
Run `bitcoin-cli getblockchaininfo` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -conf=_file_ do in bitcoin-cli?
Configuration file