A btcd image, an alternative full node bitcoin implementation written in Go (golang).
3.9K
docker installed. If this is not the case, then check out the official installation docs so you can get docker up and running on your machine.This repo is also hosted as an automated build repository which can be found here.
To grab the lastest build of this image straight from the registry, run:
$ sudo docker pull roasbeef/btcd
You can check that the image has been installed successfully by running:
$ sudo docker images
You should see something like:
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
*snip*
roasbeef/btcd latest 1b6af1fcbeef 1 second ago 651.4 MB
Alternatively, if you'd like to make some additions or modifications to the Dockerfile, you can build the image manually directly on your machine:
$ sudo docker build --rm -t="<your_user_name>/btcd:<optional_tag>" .
Creating and running the initial container is very simple. Run this command to boot up your node:
$ docker run -p 8333:8333 -d -v /root/.btcd/:/root/.btcd/ -v /root/.btcctl/:/root/.btcctl/ --name btcd roasbeef/btcd --externalip <your_external_ip_address>
-p 8333:8333
8333 from our host, into the container that our node is running in. This will allow our node to successfully accept incoming onnections.mainnet port, if you'd like to run your node on testnet3, then pass in 18333 instead.Dockerfile.-d
ENTRYPOINT command as a daemon (i.e non-interactive).-v
docker coolness. docker containers are meant to be single-purpose, ephemeral, and loosely coupled. Allowing one to easily bring containers up and down without affecting your system's state.btcd and btcctl to a local direcotry on our host machine. This allows us to build and run any btcd image we want, while perserving our logs and blockchain data outside the container's namespace.--name
docker start btcd or docker stop btcd.--externalip
Dockerfile for this image, you'll notice we've created an ENTRYPOINT, so we can simply used docker run <image>, without having to specify the command each time.addr responses.Although this is an unofficial image, I'm commited to keeping the image up to date to the latest state of the btcd master branch. So in order to update your node, you can simply re-pull or re-build the image.
btcctlIdeally, docker containers should only be running one process. So we're not running an sshd right off the bat, which would required us also running a supervisord within the containers. Also, running sshd within docker containers is considered evil.
Instead, if we'd like to fire off some rpc commands to our host we can enter the namespace of our container and used the btcctl binary that's already installed in our btcd container. You can install nsenter via this Github repo, and the helper script docker-enter.
Once you've installed nsenter and optionally, docker-enter, you can fire off rpc requests like so:
$ docker-enter btcd /gopath/bin/btcctl getinfo
Content type
Image
Digest
sha256:7cdea2d2c…
Size
205.1 MB
Last updated
almost 11 years ago
docker pull roasbeef/btcd