Giter Site home page Giter Site logo

docker-bitcoind's Introduction

docker-bitcoind

Install

Docker Hub

Just pull the docker image from Docker Hub.

$ docker pull visvirial/bitcoind

Building By Yourself

Alternatively, you can build the docker image on your own.

$ docker build --tag=visvirial:bitcoind .

Run

You can simply launching the container:

$ docker run -itd --name bitcoind -p 8332:8332 -p 8333:8333 visvirial/bitcoind

However, it is strongly recommended that you change the user and password for RPC access (change ${RPCUSER} and ${RPCPASSWORD} below).

$ docker run -itd --name bitcoind -p 8332:8332 -p 8333:8333 \
	-e BITCOIND_RPCUSER=${RPCUSER} \
	-e BITCOIND_RPCPASSWORD=${RPCPASSWORD} \
	visvirial/bitcoind

Bitcoin Core will sync every time you launch the container, which consumes much CPU resources and time. In order to skip the initial sync, you can mount and share the data directory.

$ export DATADIR=/path/to/data/directory
$ docker run -itd --name bitcoind -p 8332:8332 -p 8333:8333 \
	$(test -d $DATADIR/blocks && echo -v $DATADIR/blocks:/home/docker/.bitcoin/blocks) \
	$(test -d $DATADIR/chainstate && echo -v $DATADIR/chainstate:/home/docker/.bitcoin/chainstate) \
	-e BITCOIND_RPCUSER=${RPCUSER} \
	-e BITCOIND_RPCPASSWORD=${RPCPASSWORD} \
	visvirial/bitcoind

Customize launch-docker.sh script to fit your environment.

Using RPC

You can use bitcoin-cli to invoke RPC calls from the host machine as follows.

$ bitcoin-cli -rpcuser=${RPCUSER} -rpcpassword=${RPCPASSWORD} getinfo

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.