docker-compose.yml


Overview

This `docker-compose.yml` file serves as the foundational Docker Compose configuration for the ShapeShift Unchained platform's **local development environment**. It orchestrates core services essential for running and developing blockchain node clients, API servers, and supporting tooling containers in a containerized, reproducible manner on local developer machines.

Primary Purposes

This setup enables developers to quickly spin up a realistic multi-blockchain API environment locally, without requiring a full Kubernetes or production-like cluster.


Services

The file defines four main services:

1. unchained-local-node

**Usage:** This service compiles and provides the Node.js runtime environment for blockchain API servers to run against local source code.


2. unchained-local-go

**Usage:** Provides a local Go runtime container for blockchain services implemented in Go, facilitating development and testing.


3. watcher

**Important Implementation Detail:** The extra `yarn install` inside the container addresses a known issue on macOS where platform-specific packages (e.g., `@nx/nx-linux-arm64-musl`) fail if `node_modules` are copied directly from the host.

**Usage Example:** During development, as files change on the host, this watcher container detects those changes and recompiles/restarts Node.js services automatically, improving feedback loops.


4. reverse-proxy

**Usage:** Traefik serves as the unified gateway for all blockchain API endpoints, using Docker labels and networks to route requests transparently.


Networks

The file defines multiple Docker networks, each corresponding to a blockchain coinstack environment. This isolates services per blockchain while allowing the reverse proxy to connect across them.

**Defined Networks:**

Network Name

Description

`arbitrum_default`

Arbitrum blockchain network

`arbitrum-nova_default`

Arbitrum Nova blockchain network

`avalanche_default`

Avalanche blockchain network

`base_default`

Base blockchain network

`bitcoin_default`

Bitcoin blockchain network

`bitcoincash_default`

Bitcoin Cash blockchain network

`bnbsmartchain_default`

Binance Smart Chain network

`dogecoin_default`

Dogecoin blockchain network

`ethereum_default`

Ethereum blockchain network

`gnosis_default`

Gnosis blockchain network

`litecoin_default`

Litecoin blockchain network

`optimism_default`

Optimism blockchain network

`polygon_default`

Polygon blockchain network

`thorchain_default`

Thorchain blockchain network

`thorchain-v1_default`

Thorchain v1 blockchain network

`solana_default`

Solana blockchain network

`proxy_default`

Proxy network for Traefik

Each network is explicitly named to ensure consistent references across multiple docker-compose files.


Important Implementation Details


Interaction with Other Parts of the System


Usage Example

To start the local development environment with this compose file:

docker-compose up --build

This command builds the `unchained-local-node` and `unchained-local-go` images, starts the watcher service to enable live code watching, and runs Traefik reverse proxy for routing.

Developers can then access local blockchain APIs via URLs like:

http://api.litecoin.localhost
http://api.ethereum.localhost

Assuming coinstack-specific Compose files define the appropriate Traefik labels.


Visual Diagram: Service and Network Structure

flowchart TD
  subgraph Services
    ULN[unchained-local-node]
    ULG[unchained-local-go]
    Watcher[Watcher Service]
    Traefik[Traefik Reverse Proxy]
  end

  subgraph Networks
    Arbitrum[arbitrum_default]
    Bitcoin[bitcoin_default]
    Litecoin[litecoin_default]
    Proxy[proxy_default]
  end

  ULN -->|Builds Node.js blockchain runtime| Networks
  ULG -->|Builds Go blockchain runtime| Networks
  Watcher -->|Watches source & rebuilds| ULN
  Watcher --> ULN
  Traefik -->|Routes HTTP/WS traffic| Networks
  Traefik --> Proxy

  %% Connections to networks
  Traefik --- Arbitrum
  Traefik --- Bitcoin
  Traefik --- Litecoin
  Traefik --- Proxy

  %% Example API containers (defined in coinstack-specific compose files)
  BitcoinAPI[Bitcoin API Container]
  LitecoinAPI[Litecoin API Container]
  BitcoinAPI --- Bitcoin
  LitecoinAPI --- Litecoin
  Traefik --> BitcoinAPI
  Traefik --> LitecoinAPI

**Diagram Explanation:** This flowchart shows the core services (`unchained-local-node`, `unchained-local-go`, `watcher`, `Traefik`) and their connections to various blockchain networks. Traefik connects to all relevant networks and routes requests to blockchain API containers (defined elsewhere). The watcher triggers rebuilds of the Node.js runtime image.


Summary

The `docker-compose.yml` file is a central piece in the ShapeShift Unchained developer tooling ecosystem. It:

This setup forms the backbone upon which coinstack-specific API services and performance testing scripts operate, streamlining developers' ability to run and iterate on the entire blockchain API platform locally.


End of Documentation for docker-compose.yml