Sign inSign up

jr0sco/bitcoind

By jr0sco

Updated over 4 years ago

Bitcoind and LND Docker Containers

Image
0

1.7K

jr0sco/bitcoind repository overview

Lightning Node Docker Container Stack

Repo for spinning up your own Lightning Node Stack (bitcoind, lnd, neutrino)

Bitcoin (bitcoind) Container

Bitcoind Docker Stars Bitcoind Docker Pulls


See Dockerfile

Bitcoin Dockerfile Build Argument Values
KeyDefault ValuesInfo
BITCOIN_VERSION0.17.0.1Bitcoin version to use
USER_ID1000bitcoin user UID. Make this the same as the local directory UID permissions
GROUP_ID1000bitcoin group GID. Make this the same as the local directory UID permissions
Bitcoin Container Environment Values

KeyDefault ValuesInfo
BITCOIN_SERVER1Enable(1) / Disable(0) Bitcoin server
LISTEN1Enable(1) / Disable(0) Bitcoin to listen
BITCOIN_TESTNET"0"Enable(1) / Disable(0) testnet (overrides bitcoin.conf value)
BITCOIN_RPC_ALLOWED127.0.0.1RPC Whitelist IPs addresses
BITCOIN_RPC_USERbitcoinThe Bitcoin RPC user
BITCOIN_RPC_PASSWORDrandomly generated passwordThe Bitcoin RPC password
BITCOIN_RPC_PORT8332Bitcoin RPC Port
ZMQ_PUB_RAW_TXtcp://127.0.0.1:28332The ZeroMQ raw publisher transactions URL
ZMQ_PUB_RAW_BLKtcp://127.0.0.1:28333The ZeroMQ raw publisher blocks URL

Bitcoin Docker Build

docker build -t bitcoind docker/bitcoind/

Build with differnet Bitcoin version

docker build --build-arg BITCOIN_VERSION=0.16.3 -t bitcoind docker/bitcoind/

Build with different UID/GID

docker build --build-arg USER_ID=1001 --build-arg GROUP_ID=1001 -t bitcoind  docker/bitcoind/

Example Run bitcoind

docker run --name bitcoind -d \
    -v {local.bitcoin.dir}:/home/bitcoin \
    -v {local.bitcoin.config}:/home/bitcoin/.bitcoin/bitcoin.conf \
    -e TESTNET=1 \
    -p 0.0.0.0:9735:9735 \
    -p 127.0.0.1:28332:28332 \
    -p 127.0.0.1:28333:28333 \
    bitcoind

Lightning (lnd) Container

Lightning Docker Stars Lightning Docker Pulls


See Dockerfile

Lightning Dockerfile Argument Values
KeyDefault ValuesInfo
LND_VERSIONv0.10.4-betaLightning version to use
USER_ID1000The run container as bitcoin UID. Make this the same as the local directory UID permissions
Lightning Container Environment Values
KeyDefault ValuesInfo
BITCOIN_RPC_USERbitcoinThe Bitcoin RPC user
BITCOIN_RPC_PASSWORDpasswordThe Bitcoin RPC password
DEBUGinfoLogging level
NETWORKtestnetWhich network to use (testnet,simnet,mainnet)
CHAINbitcoinWhich blockchain to use (bitcoin,litecoin)
BACKENDbitcoindWhich backend to use (bitcoind,btcd,litecoind,ltcd,neutrino )
ZMQ_PUB_RAW_TXtcp://127.0.0.1:28332The ZeroMQ raw publisher transactions URL
ZMQ_PUB_RAW_BLKtcp://127.0.0.1:28333The ZeroMQ raw publisher blocks URL
LIGHTNING_DATA/data/.lndThe Lightning .lnd directory location
Lightning Docker Build

docker build -t lnd docker/lnd

Build with differnet Lightning version

docker build --build-arg LND_VERSION=v0.10.4-beta -t lnd docker/lnd

Build with different UID

docker build --build-arg USER_ID=1001 -t lnd docker/lnd

Run Lightning with Bitcoin Backend

docker run --rm --name lnd --network container:bitcoind -d \
    -v {local.bitcoin.dir}:/home/bitcoin \
    -v :/data/.lnd \
    lnd

Run Lightning with Neutrino Backend

docker run --rm --name lnd -d \
    -e BACKEND=neutrino \
    -v {local.lightning.dir}:/data \
    -v :/data/.lnd \
    lnd

Build you own LND certificate:


cd ~/.lnd
openssl ecparam -genkey -name prime256v1 -out tls.key
openssl req -new -sha256 -key tls.key -out csr.csr -subj '/CN=localhost/O=lnd'
openssl req -x509 -sha256 -days 36500 -key tls.key -in csr.csr -out tls.cert
rm csr.csr

Tag summary

Content type

Image

Digest

Size

44.5 MB

Last updated

about 6 years ago

docker pull jr0sco/bitcoind