This repository contains a modular, dockerized development environment for Bitcoin-related services. The environment is designed to be easily deployable, configurable, and extensible.
The environment follows a modular architecture where each service is:
- Independently containerized
- Built from source
- Configurable through environment variables
- Data-persistent
The environment currently includes:
-
Bitcoin Core Node (v29.0)
- Full Bitcoin node with RPC and P2P ports exposed
- Includes transaction indexing and server mode enabled
- Configurable RPC authentication
-
Electrum Server (v3.2.0)
- Built on top of electrs
- Provides Electrum protocol support
- Connects to the Bitcoin node for blockchain data
-
Ordinals Server (v0.23.1)
- Built on top of ord
- Provides Ordinals protocol support
- Includes indexing for addresses, runes, sats, and transactions
To add a new service to this environment:
- Create a new
Dockerfile.<service-name>
in the root directory - Create a new
docker-compose-<service-name>.yml
file - Add a new directory for service data persistence
- Update this README with the new service information
- Add any new environment variables to
.env.example
# docker-compose-<service-name>.yml
services:
<service-name>:
build:
context: .
dockerfile: Dockerfile.<service-name>
container_name: <service-name>
volumes:
- ./<service-name>:/path/to/data
ports:
- ${SERVICE_PORT}:<internal_port>
environment:
- VAR1=${VAR1}
- VAR2=${VAR2}
command:
[
"./<service-name>"
]
- Docker
- Docker Compose
- Git
Create a .env
file in the root directory, copying .env.example
with the following variables:
# Bitcoin Core
RPC_PORT=8332
P2P_PORT=8333
RPC_AUTH=<your_rpc_auth_string>
RPC_USER=<your_rpc_username>
RPC_PASS=<your_rpc_password>
# Electrum Server
ELECTRS_PORT=50001
# Ordinals Server
ORDINALS_PORT=80
# Add new service variables here
.
├── bitcoin/ # Bitcoin Core data directory
├── electrs/ # Electrum server data directory
├── ordinals/ # Ordinals server data directory
├── Dockerfile.bitcoin # Bitcoin Core Dockerfile
├── Dockerfile.electrs # Electrum server Dockerfile
├── Dockerfile.ordinals # Ordinals server Dockerfile
├── docker-compose-bitcoin.yml
├── docker-compose-electrs.yml
└── docker-compose-ordinals.yml
Each service can be started independently:
# Start Bitcoin Node
docker compose -f docker-compose-bitcoin.yml up -d
# Start Electrum Server
docker compose -f docker-compose-electrs.yml up -d
# Start Ordinals Server
docker compose -f docker-compose-ordinals.yml up -d
# Start a new service
docker compose -f docker-compose-<service-name>.yml up -d
Each service exposes its own ports:
- Bitcoin Core RPC: 8332
- Bitcoin Core P2P: 8333
- Electrum Server: 50001
- Ordinals Server: 80
- New Service:
All services maintain data persistence in their respective directories:
- Bitcoin Core data:
./bitcoin
- Electrum server data:
./electrs
- Ordinals server data:
./ordinals
- New Service data:
./<service-name>
Each service is built from source using their respective Dockerfiles. The build process is service-specific:
- Bitcoin Core: Built from source using CMake
- Electrum Server: Built from source using Cargo (Rust)
- Ordinals Server: Built from source using Cargo (Rust)
- New Service:
- Fork the repository
- Create a new branch for your service
- Add your service following the template structure
- Update the README with your service information
- Submit a pull request
- RPC interfaces should be properly secured in production
- Use strong authentication credentials
- Consider using reverse proxies for public-facing services
This project uses components with their respective licenses:
- Bitcoin Core: MIT
- Electrum Server: MIT
- Ordinals: MIT
- New Service: