Skip to main content

Docker DevNet

The Docker DevNet provides a self-contained, 4-validator Basalt network for local development and integration testing.

Prerequisites

Starting the DevNet

docker compose up -d

This starts four validator nodes (validator-0 through validator-3) with pre-configured keys and addresses.

Port Mapping

Each validator exposes its REST API on a unique host port:

ValidatorREST PortP2P Port
validator-0localhost:510030300
validator-1localhost:510130301
validator-2localhost:510230302
validator-3localhost:510330303

Verifying the Network

Health Check

curl http://localhost:5100/v1/health

View Logs

Follow the log output for a specific validator:

docker compose logs -f validator-0

Configuration Details

SettingValue
Chain ID31337
Validator keysDeterministic (development only)
Docker networkbasalt-devnet (bridge mode)
StoragePer-validator persistent RocksDB volumes
Restart policyunless-stopped
danger

The devnet uses deterministic validator addresses and private keys that are publicly known. Never use devnet keys in production.

Security Hardening

Even in development mode, the Docker containers apply the following security constraints:

  • security_opt: no-new-privileges -- prevents privilege escalation inside the container
  • cap_drop: ALL -- drops all Linux capabilities

Health Checks

Each container runs an internal health check:

curl -sf http://localhost:5000/v1/health

Health checks execute every 30 seconds with a 10-second timeout.

Dockerfile

The devnet uses a multi-stage Dockerfile:

StageBase ImagePurpose
Buildmcr.microsoft.com/dotnet/sdk:9.0Compile the Basalt node
Runtimemcr.microsoft.com/dotnet/aspnet:9.0Run the compiled binary

The runtime container runs as a non-root basalt user and exposes the following ports:

PortService
5000REST API
5001gRPC API
30303P2P

Common Operations

Rebuild Without Cache

Force a clean rebuild of the Docker image and restart all validators:

docker compose build --no-cache && docker compose up -d

Stop and Clean Up

Stop all containers and remove persistent volumes:

docker compose down -v

This removes all blockchain data. The network will start from genesis on the next docker compose up.