Running a Bitcoin Node

Feb 2, 2018 12:00pm

This is a technical rundown on how to install and run a full node on the Bitcoin testnet.

Before you begin, you’ll need the following.

  • A good chunk of time and disk space (~15GB as of Feb. 2018) to sync with the network.
  • Golang – we’ll be using the Go implementation of btcd and lnd.
  • Glide – the dependency manager (brew install glide).

Installing btcd

btcsuite/btcd is a Go implementation of the bitcoin protocol. You can find it here:

The following fetches the repository, navigates to the btcd directory, installs dependencies via glide, and installs the CLI tools.

$ go get && \
cd $GOPATH/ && \
glide install && \
go install . ./cmd/...

Starting btcd

Once everything is installed, you should be able to run btcd from the command line.

$ btcd --testnet --txindex --rpcuser=$SOME_USERNAME --rpcpass=$SOME_PASSWORD

The syncing phase might take a few hours depending on your hardware and bandwidth.

To monitor progress you can run the following and compare it to testnet3’s height/block count.

$ btcctl --testnet --rpcuser=$SOME_USERNAME--rpcpass=$SOME_PASSWORD getblockcount

After a few hours, you should see something like this:

2018-02-03 21:53:14.939 [INF] SYNC: Processed 1099 blocks in the last 10s (23358 transactions, height 992559, 2016-10-18 22:40:26 -0400 EDT)
2018-02-03 21:53:21.986 [INF] CHAN: Verified checkpoint at height 1000007/block 00000000001ccb893d8a1f25b70ad173ce955e5f50124261bbbc50379a612ddf
2018-02-03 21:53:21.986 [INF] SYNC: Reached the final checkpoint -- switching to normal mode