Git Product home page Git Product logo

docker-btc's Introduction

docker-btc

Docker Stars Docker Pulls

Running a full node ain't never been so easy!

A Docker configuration with sane defaults for running a full validating Bitcoin node.

Quick start

Requires that Docker be installed on the host machine:

  • Ubuntu: sudo apt-get install docker
  • otherwise: docs
# Create some directory where your bitcoin data will be stored.
$ mkdir /home/youruser/bitcoin_data

$ docker run --name bitcoind -d \
   --env 'BTC_RPCUSER=foo' \
   --env 'BTC_RPCPASSWORD=password' \
   --volume /home/youruser/bitcoin_data:/bitcoin \
   --p 8332:8332
   --publish 8333:8333
   jamesob/bitcoind

$ docker logs -f bitcoind
[ ... ]

Configuration

A custom bitcoin.conf file can be placed in the mounted data directory. Otherwise, a default bitcoin.conf file will be automatically generated based on environment variables passed to the container:

name default
BTC_RPCUSER btc
BTC_RPCPASSWORD changemeplz
BTC_RPCPORT 8332
BTC_RPCALLOWIP ::/0
BTC_RPCCLIENTTIMEOUT 30

Daemonizing

If you're using systemd, you can use a config file like

$ cat /etc/systemd/system/bitcoind.service

# bitcoind.service #######################################################################
[Unit]
Description=Bitcoind
After=docker.service
Requires=docker.service
 
[Service]
ExecStartPre=-/usr/bin/docker kill bitcoind
ExecStartPre=-/usr/bin/docker rm bitcoind
ExecStartPre=/usr/bin/docker pull jamesob/bitcoind
ExecStart=/usr/bin/docker run \
    --name bitcoind \
    -p 8333:8333 \
    -p 8332:8332 \
    -v /data/bitcoind:/bitcoin \
    jamesob/bitcoind 
ExecStop=/usr/bin/docker stop bitcoind 

to ensure that bitcoind continues to run.

Alternatives

  • docker-bitcoind: sort of the basis for this repo, but configuration is a bit more confusing.
  • docker-bitcoin: more complex, but more granular versioning. Includes XT & classic.

docker-btc's People

Contributors

jamesob avatar

Watchers

James Cloos avatar steph avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.