Suffix

The Bitcoin testnet

Getting started with the Bitcoin testnet.

Are you a Bitcoin power user discovering its more advanced features?

Lets see how to get started with the Bitcoin testnet. A toy blockchain to learn and play without losing your real, hard-earned coins. None of the Bitcoin client applications implement all those features yet, you will have to use the Bitcoin RPC interface from the command line.

Install

Download and install the Bitcoin Core client (previously called Bitcoin-Qt). You can, but do not have to, start the application. It will start downloading the huge, real blockchain, which is not needed for the testnet.

Configure

  1. Find the Bitcoin Core data directory for your operating system.
  2. Create this directory if it does not exist yet (it will when you ran the client earlier).
  3. Create a bitcoin.conf configuration file in the directory. A minimal example might look like:
    testnet=1
    server=1
    rpcuser=Ulysseys
    rpcpassword=YourPassword
    rpctimeout=30
    rpcport=8332

Run

Start the Bitcoin Core client. The application icon should be green instead of orange. The green icon indicates it is running in testnet mode. This time the Bitcoin client will download the testnet blockchain. While you wait for the testnet blockchain to download, you can grab some testnet coins. Find a Bitcoin testnet faucet and send yourself some coins (find an address in the Bitcoin Core client). The coins will only show up in the Bitcoin Core client application when the blockchain download has caught up, so wait for it to finish.

Play

Time to try it out. Here is a simple cURL command to ask the Bitcoin daemon for some general info using a JSON RPC:

curl --user Ulysseys \
  --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' \
  -H 'content-type: text/plain;' http://127.0.0.1:8332/