Skip to content

Instantly share code, notes, and snippets.

@Stadicus
Created August 13, 2018 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stadicus/9bbfd78411383fe4675c0fd29c1a5357 to your computer and use it in GitHub Desktop.
Save Stadicus/9bbfd78411383fe4675c0fd29c1a5357 to your computer and use it in GitHub Desktop.
Run docker-bitcoin-core
# Trueno: dockerized Bitcoin Core
# Resources:
# https://github.com/Stadicus/docker-bitcoin-core (forked)
# https://hub.docker.com/r/truenolightning/bitcoin-core/
# Requirements:
# Git: to clone source (only 2 files)
# Python3: to create rpcauth
# Docker: to run docker image
git --version \
&& python3 --version \
&& docker --version
# setup test environment (simulate bitcoin.conf & external hdd
cd ~ \
&& mkdir bitcoin_hdd \
&& touch bitcoin_hdd/init.file \
&& mkdir .bitcoin \
&& echo "# Trueno bitcoin.conf" > .bitcoin/bitcoin.conf
# create RPC auth (replaces rpcuser / rpcpassword)
# The non-sensitive 'rpcauth' is stored in bitcoin.conf (old lines with 'rpcauth' are removed first)
# The secret password is saved in rpcpassword.txt
curl -sSL https://raw.githubusercontent.com/bitcoin/bitcoin/master/share/rpcauth/rpcauth.py | python3 - trueno | tee rpcauth.tmp \
&& mv .bitcoin/bitcoin.conf .bitcoin/bitcoin.old && (sed '/rpcauth/d' .bitcoin/bitcoin.old; cat rpcauth.tmp | grep rpcauth=) > .bitcoin/bitcoin.conf \
&& cat rpcauth.tmp | tail -n 1 > rpcpassword.txt && rm rpcauth.tmp
git clone https://github.com/Stadicus/docker-bitcoin-core/ \
&& cd docker-bitcoin-core/0.16
docker run --rm -it \
--name bitcoin-server \
--volume ~/blockchain:/home/bitcoin/.bitcoin \
--volume ~/.bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf \
truenolightning/bitcoin-core \
-printtoconsole \
-testnet=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment