A simple command-line Bitcoin blockchain explorer that interacts with Bitcoin Core via JSON-RPC.
- Bitcoin Core running in regtest mode
- Python 3.x
requestslibrary
pip install requestsThe explorer connects to Bitcoin Core with these default settings:
- URL:
http://127.0.0.1:18443/ - Username:
bootcamp - Password:
bootcamp123
python3 explorer_starter.pyBase helper that sends JSON-RPC requests to Bitcoin Core. All other functions use this internally.
Displays current blockchain status including chain type, block height and difficulty.
Loads the specified wallet and prints its current BTC balance.
Lists the most recent transactions for a wallet showing direction (IN/OUT) and amount in BTC. Defaults to 5 transactions.
Decodes a raw transaction by txid, showing size, inputs (with coinbase detection) and outputs with addresses and amounts.
Displays block details including height, hash, timestamp and transaction count. Defaults to the latest block if no hash is provided.
Designed for regtest mode on port 18443. For testnet or mainnet change the port in the rpc() function.