Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (44 sloc) 3.11 KB
layout: post
title: "Getting started: Bitcoin testnet"
date: 2013-12-23 11:42:00
updated: 2014-01-14 22:35:00
coordinates: 50.86505 4.70068
proofread: yes
<div class="narrow-col">
<p>Are you a developer working on a <a href="" title="Bitcoin, open source P2P money">Bitcoin</a> project or are you a power user discovering the more <a href="" title="The future of Bitcoin: new applications and rebuilding the banking system talk by Mike Hearn">advanced Bitcoin features</a>? This post explains how to get started with the Bitcoin <a href="" title="What is this Bitcoin testnet you speak of?">testnet</a> so you can play without using your real, hard-earned coins.</p>
<p>None of the Bitcoin client applications implement all of those features, (yet) so you'll have to use the Bitcoin <abbr "Remote Procedure Call">RPC</abbr> interface from the command line.</p>
<p><a href="" title="Download Bitcoin Core">Download</a> and install the Bitcoin Core client (previously named Bitcoin-Qt). You can, but don't have to, start the application. It will start downloading the huge, real blockchain, which you don't need for testing.</p>
<li>Find the Bitcoin Core <a href="" title="Bitcoin Core data directories for each OS">data directory</a> for your system.</li>
<p>Create this directory if it doesn't exist yet (should be there from when you ran the client before). On Mac OS X for example:</p>
<p><code>mkdir ~/Library/Application\ Support/Bitcoin/</code></p>
Create a <code><a href="" title="Configuration file options">bitcoin.conf</a></code> configuration file in that directory. A minimal example might look like:
{% highlight ini %}
{% endhighlight %}
<p>Start the Bitcoin Core client. The application icon should be green instead of orange. The green icon indicates it's running in testnet mode. The client will start downloading the testnet blockchain and this will take a while.</p>
<p>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 (you can find an address in the Bitcoin Core client).</p>
<p>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.</p>
<p>Time to try it out. Here is a simple cURL command to ask the Bitcoin daemon for some general info using a JSON <abbr title="Remote Procedure Call">RPC</abbr>:</p>
{% highlight bash %}
curl --user Ulysseys \
--data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' \
-H 'content-type: text/plain;'
{% endhighlight %}