Creating a Local Bitcoin Testnet – Programming Bitcoin

Creating a Local Bitcoin Testnet - Programming Bitcoin

In this video we create a local bitcoin testnet within a docker container. From there, we will connect to our testnet from Bitcoin-Qt on our desktop (host) machine.

Here’s the docker box we’re going to use: https://github.com/freewil/bitcoin-testnet-box.

Essentially, run:

docker pull freewil/bitcoin-testnet-box
docker run -t -i --name bitcoind -P -p 49020:19000 freewil/bitcoin-testnet-box
make start

Now we’ll have a local testnet we can use for test transactions.

Tips: 1FfxymRtVTJbqtFg5ZK9p16mABVFCjqg6J.

source.

  1. I was having trouble getting Bitcoin-QT to talk to the latest version of the bitcoin-testnet-box.

    Problem #1: on my Mac I couldn't connect to port 49020, even though the forwarding was turned on in docker.

    Solution #1: Launch virtual box and for your Port settings for the boot2docker-vm, go to Settings -> Network -> Port Forwarding and add a line for forwarding host port 49020 to guest port 49020.

    Problem #2: bitcoind didn't like the messages Bitcoin-QT was sending to it. It would repeatedly emit an error saying PROCESSMESSAGE: INVALID MESSAGESTART.

    Solution #2: It turns out the new bitcoin-testnet-box uses the test mode of regtest, not testnet3. So make sure when you launch Bitcoin-QT you use the -regtest flag instead of the -testnet flag. That made the errors go away and allows the two applications to talk to each other.

Leave a Reply

Your email address will not be published.


*