Sign inSign up

fiftysix/bitcoin-core

By fiftysix

Updated 2 months ago

A fully functional Bitcoin Core client. Simplifying the process of running a Bitcoin node.

Image
0

2.6K

fiftysix/bitcoin-core repository overview

Fiftysix Bitcoin Core Docker Image

Maintainer: [email protected]

Overview

This Docker image provides a fully functional Bitcoin Core client built using the Fiftysix base image. It is designed to simplify running a Bitcoin node, offering secure and efficient participation in the Bitcoin network. Perfect for developers, blockchain enthusiasts, and institutions. The code can be viewed on the Fiftysix Github.

Tags
  • latest: Points to the latest version of Bitcoin Core.
  • <version>: Points to a specific version of Bitcoin Core. For example, 26.2, 27.1.
What is Bitcoin Core?

Bitcoin Core is the reference client that implements the Bitcoin protocol for remote procedure call (RPC) use. It is a secure and reliable way to interact with the Bitcoin network.

Usage
Basic Usage

To run a Bitcoin Core node:

docker pull fiftysix/bitcoin-core
docker run --name bitcoin-core -d fiftysix/bitcoin-core
Directory Structure

In this Docker image, the following directories are used:

  • Data Directory (/node/bitcoin-core/data): This is where Bitcoin Core stores the block data and other related files. Mounting this directory ensures blockchain data is persisted between container runs.
  • Config Directory (/node/bitcoin-core/configs): This directory is used for storing configuration files for Bitcoin Core. You can provide your custom configuration file by mounting it to this directory and specifying it with the -conf flag.
  • Scripts Directory (/node/bitcoin-core/scripts): This directory contains any scripts that you may want to execute as part of the Bitcoin Core startup or maintenance process. The entry point script (bitcoin-core-entrypoint.sh) is located here.
Mounting Directories

You can mount host directories to the container’s data, config, and scripts directories to customize the behavior of the Bitcoin Core node.

Mounting the Data Directory: To persist Bitcoin Core data across container restarts, you can mount a host directory to the container's data directory:

docker run --name bitcoin-core -v /path/to/local/data:/node/bitcoin-core/data -d fiftysix/bitcoin-core

This command mounts the /path/to/local/data directory on your host to /node/bitcoin-core/data in the container, ensuring that blockchain data is preserved between container instances.

Mounting a Config File: To use a custom Bitcoin Core configuration file, mount your configuration file to the container’s config directory and specify it using the -conf flag:

docker run --name bitcoin-core -v /path/to/local/config.conf:/node/bitcoin-core/configs/your-config.conf -d fiftysix/bitcoin-core \
  -conf="/node/bitcoin-core/configs/your-config.conf"

This command mounts your custom config.conf file to the container’s config directory and instructs Bitcoin Core to use it.

Note, Bitcoin Core flags can be added on top of a configuration file to overwrite the setting.

Mounting the Scripts Directory: If you have custom scripts you want to include, you can mount them to the scripts directory. For example, to replace the entrypoint script:

docker run --name bitcoin-core -v /path/to/local/scripts:/node/bitcoin-core/scripts -d fiftysix/bitcoin-core

This command mounts your local scripts directory to /node/bitcoin-core/scripts in the container, allowing you to customize the startup behavior.

Logging Bitcoin Core
docker logs bitcoin-core --tail 100
Using Bitcoin RPC and REST Endpoints
RPC Endpoint

The Bitcoin Core daemon (bitcoind) provides an RPC interface that allows you to interact with the Bitcoin network programmatically.

Start the Bitcoin Core daemon:

docker run --name bitcoin-core -d \
  -p 8332:8332 \
  -p 8333:8333 \
  fiftysix/bitcoin-core \
  -rpcallowip=0.0.0.0/0 \
  -rpcbind=0.0.0.0 \
  -rpcuser='user' \
  -rpcpassword='your_password'

Example RPC Query:

curl --user user:your_password --data-binary '{"jsonrpc":"1.0","id":"curltest","method":"getnetworkinfo","params":[]}' \
  -H 'content-type:text/plain;' http://127.0.0.1:8332/
Docker Compose

Bitcoin Core can also be run using Docker Compose. An example compose file can be found on the Fiftysix Github.

Ordinals

The Ordinals software ord can also be attached to Bitcoin Core. Fiftysix also provides an ord image compatible with Bitcoin Core that can be found here.

An example compose file that utilizes both Bitcoin Core and Ord can be found on the Fiftysix Github.

Support

For support, please contact [email protected].

About Fiftysix

Fiftysix is committed to making blockchain technology accessible, efficient, and reliable through robust decentralization. Learn more at fiftysix.xyz.

Tag summary

Content type

Image

Digest

sha256:bc94a8c0e

Size

164.6 MB

Last updated

2 months ago

docker pull fiftysix/bitcoin-core