No description
Find a file
2026-03-01 09:13:49 +00:00
cc-init.sh cc-init.sh bijwerken 2026-02-18 21:52:45 +00:00
Dockerfile Image setup 2026-02-17 21:26:43 +00:00
README.md README.md bijwerken 2026-03-01 09:13:49 +00:00

This repo was an intermediairy construct to achieve zero-touch deployment of core-rot combination servers; It is superceded by https://git.communitycoins.org/Communitycoins.Rooty/cc-deploy

cc-init

Requires Docker Compose v2+

cc-init is a deterministic provisioning layer for CommunityCoins Simple Payment Verification (SPV) deployments.

It standardizes the integration between:

  • A legacy core wallet daemon
  • The CommunityCoins Ring-of-Trust (ROT) layer
  • Docker-based zero-touch infrastructure

cc-init runs once, prepares the data directory, generates a managed <coin>.conf, optionally injects bootstrap peers, and exits.

It does not run the daemon.
It does not manage services.
It performs deterministic infrastructure provisioning only.


Purpose

Many legacy core forks:

  • Expect a coin-specific <coin>.conf
  • Fail without an existing data directory
  • Contain outdated DNS seeds
  • Require RPC configuration in the config file
  • Behave inconsistently with command-line overrides
  • Hide default datadirs in OS-dependent locations

cc-init solves this generically, without modifying the original source code.

cc-init preserves legacy core forks unmodified while enabling modern, reproducible zero-touch deployment.


Design Principles

  • Zero-touch deployment
  • No source-code modification
  • Deterministic regeneration
  • Coin-agnostic
  • Minimal footprint
  • No runtime supervision

cc-init belongs to the provisioning layer, not the runtime layer.


Configuration Ownership Model

cc-init generates a managed configuration file.

Generated configs contain:

# Managed by cc-init
# Auto-generated  manual changes will be overwritten
# To manage this file manually, remove or disable the 'core-init' service in docker-compose.yml

What It Does

On execution:

  1. Creates the blockchain data directory (if missing)
  2. Generates a managed <coin>.conf
  3. Injects:
    • RPC configuration
    • security defaults
    • optional addnode= bootstrap peers
  4. Exits with status 0 on success

Deterministic Startup

cc-init is designed to work with:

depends_on: core-init: condition: service_completed_successfully

This ensures:

  • Core does not start unless provisioning completed successfully.
  • No race conditions.
  • No timing assumptions.

Environment Variables

All values are set up via Docker Compose.

Variable Purpose
container_root Mounted root data directory inside container
core_data_dir Full blockchain directory path
coin_config Config filename (e.g. eMark.conf)
rpcport RPC port
rpcuser RPC username
rpcpassword RPC password
extra_peers Optional comma-separated bootstrap peers

Example:


🐳 Example Usage (Docker Compose)

services:
  core-init:
    image: communitycoins/cc-init:latest
    container_name: *init_container_name
    restart: "no"
    volumes:
      - *host_data_dir:*container_root
    environment:
      container_root: *container_root
      core_data_dir: *core_data_dir
      coin_config: *coin_config
      rpcport: *rpc_port
      rpcuser: *rpc_user
      rpcpassword: *rpc_password
      extra_peers: *extra_peers

Requirements

Docker Compose Version

cc-init requires Docker Compose v2 or newer.

Specifically, it relies on:

depends_on:
  core-init:
    condition: service_completed_successfully

This condition ensures that the core daemon only starts if provisioning completed successfully.

Legacy docker-compose (v1.x) does not support this condition reliably and may start services out of order. To check your version:

docker compose version

Expected output:

Docker Compose version v2.x.x

If your system uses the legacy binary:

docker-compose version

You should upgrade to the modern Docker Compose plugin: