Skip to main content

Learning objectives

  • Understand what Bitcoin Core is and how it differs from wallets or Lightning nodes
  • Install and configure bitcoind in regtest mode
  • Use bitcoin-cli to connect, query, and control your node
  • Set up a persistent Bitcoin Core environment for future modules

What is Bitcoin Core?

It is the reference implementation of the Bitcoin protocol. It includes:
  • bitcoind: the daemon that runs the full node
  • bitcoin-cli: the command-line tool to interact with it
Unlike wallet apps or exchanges, Bitcoin Core gives you full control and visibility over the network.

Preparing your system

Dependencies:
  • Linux/macOS (Ubuntu preferred)
  • 2–4GB RAM minimum
  • Disk space: ~500MB for regtest; ~800GB+ for full mainnet node
Recommended Setup:
  • Use a clean VPS or local Linux machine
  • Optional: Use Docker for sandboxing (we’ll cover later)

Downloading Bitcoin Core

Visit: https://bitcoincore.org/en/download/ Choose the binary for your OS (Linux, Mac, Windows). Verify the GPG signature (optional but best practice).

Launching in Regtest mode

Regtest = “Regression Test” mode = your own private Bitcoin network.
This:
  • Starts the node in the background
  • Creates a local chain with zero blocks
  • No external network connection required

Connecting via bitcoin-cli

Once the daemon is running, connect using:
This should return JSON showing:
  • Chain: regtest
  • Blocks: 0
  • Headers: 0
  • VerificationProgress: 1.000000

Setting up a bitcoin.conf file (optional)

Located at ~/.bitcoin/bitcoin.conf
Restart with:

bitcoind as a daemon

By default, bitcoind runs in the foreground. To run it in the background (as a daemon), simply add the -daemon flag:
This will:
  • Start the Bitcoin Core node in regtest mode
  • Fork it into the background so you can continue using the terminal
  • Create and use the default data directory at ~/.bitcoin/regtest
You can always check whether it’s running with:
To stop the daemon gracefully:

Basic node health checks

After launching your node, verify it’s functioning properly with these checks: Check the blockchain state:
Look for:
  • blocks: should be 0 initially
  • initialblockdownload: true until you mine the first block, then false
  • chain: should be regtest
Check your wallet:
If you haven’t created a wallet yet, it will return an empty list. You can create one with:
Check node status:
Version Local relay status Reachable networks (ipv4, ipv6, onion) Connection count (should be 0 in regtest) Check available RPC commands:
This is useful to explore the full range of bitcoin-cli capabilities. This shows:
  • Version
  • Local relay status
  • Reachable networks (ipv4, ipv6, onion)
  • Connection count (should be 0 in regtest)
Check available RPC commands:
This is useful to explore the full range of bitcoin-cli capabilities.

Activity

Run this sequence:
  1. Start bitcoind in regtest mode.
  2. Query the chain info with bitcoin-cli.
  3. Generate your first block
    Ensure to replace <your_address> with the actual address from getnewaddress
  4. Confirm you now have spendable coins in your wallet with: