Skip to main content

Overview

Services are additional infrastructure that runs alongside your blockchain nodes. They’re defined under services: in dokrypt.yaml and started automatically with dokrypt up.

Supported Service Types

TypeDescriptionDefault Port
ipfsIPFS decentralized storage5001 (API), 8080 (gateway)
blockscoutFull-featured block explorer4000
otterscanLightweight block explorer5100
subgraphThe Graph indexing protocol8000
ponderPonder indexing framework42069
chainlink-mockMock Chainlink oracle
pyth-mockMock Pyth oracle
grafanaMonitoring dashboards3000
prometheusMetrics collection9090
faucetTest token faucet8082
mock-bridgeCross-chain bridge simulator
customAny Docker image

IPFS

services:
  ipfs:
    type: ipfs
    port: 5001          # API port
    gateway_port: 8080  # Gateway port
Access the IPFS API at http://localhost:5001 and the gateway at http://localhost:8080. Upload files via the API:
curl -X POST -F file=@myfile.json http://localhost:5001/api/v0/add

Block Explorers

Blockscout

Full-featured block explorer with transaction tracing, token tracking, and API.
services:
  explorer:
    type: blockscout
    chain: ethereum       # Which chain to index
    port: 4000
    depends_on: [ethereum]
Browse at http://localhost:4000.

Otterscan

Lightweight, fast block explorer.
services:
  explorer:
    type: otterscan
    chain: ethereum
    port: 5100

Indexers

The Graph (Subgraph)

Run a local Graph Node for indexing blockchain data with subgraphs.
services:
  indexer:
    type: subgraph
    chain: ethereum

Ponder

Modern indexing framework.
services:
  indexer:
    type: ponder
    chain: ethereum

Oracles

Simulated Chainlink price feeds with configurable prices and volatility.
services:
  oracle:
    type: chainlink-mock
    chain: ethereum
    depends_on: [ethereum]
    features:
      feeds:
        - pair: ETH/USD
          price: 2000.00
          decimals: 8
          update_interval: 60s
          volatility:
            enabled: true
            max_deviation_pct: 2.0
        - pair: BTC/USD
          price: 45000.00
          decimals: 8
Feed ConfigTypeDescription
pairstringPrice pair (e.g., ETH/USD)
pricefloatInitial price
decimalsintPrice decimals (usually 8 for Chainlink)
update_intervaldurationHow often price updates
volatility.enabledboolEnable random price movements
volatility.max_deviation_pctfloatMax % change per update

Pyth Mock

Simulated Pyth oracle feeds.
services:
  oracle:
    type: pyth-mock
    chain: ethereum

Monitoring

Grafana

Pre-configured dashboards for chain metrics.
services:
  grafana:
    type: grafana
    port: 3000
Access at http://localhost:3000 (default credentials: admin/admin).

Prometheus

Metrics collection for chain and service monitoring.
services:
  prometheus:
    type: prometheus
    port: 9090

Faucet

Web-based test token faucet.
services:
  faucet:
    type: faucet
    chain: ethereum
    port: 8082

Mock Bridge

Cross-chain bridge simulator for multi-chain setups.
services:
  bridge:
    type: mock-bridge
    chains: [ethereum, polygon]
    confirmation_blocks: 12
    relay_delay: 30s
See Bridge for usage details.

Custom Services

Run any Docker image as a service:
services:
  my-api:
    type: custom
    image: my-api:latest
    command: ["--port", "3000"]
    ports:
      http: 3000
      ws: 3001
    volumes:
      - "./data:/app/data"
    environment:
      DATABASE_URL: "postgres://localhost/mydb"
      NODE_ENV: "development"
    depends_on: [ethereum]
    healthcheck:
      http: "http://localhost:3000/health"
      interval: 10s
      timeout: 5s
      retries: 3

Custom Build

Build from a local Dockerfile:
services:
  my-service:
    type: custom
    build:
      context: ./my-service
      dockerfile: Dockerfile
    ports:
      http: 8080

Dependencies

Use depends_on to control startup order:
services:
  explorer:
    type: blockscout
    depends_on: [ethereum]      # Waits for ethereum chain
  indexer:
    type: subgraph
    depends_on: [ethereum, ipfs] # Waits for both
Dokrypt resolves dependencies using topological sort (Kahn’s algorithm) and starts independent services in parallel.

Health Checks

Services support health checks to verify they’re ready:
services:
  my-service:
    healthcheck:
      http: "http://localhost:3000/health"  # HTTP endpoint
      # OR
      tcp: "localhost:3000"                  # TCP port check
      interval: 10s                          # Check interval
      timeout: 5s                            # Timeout per check
      retries: 3                             # Retries before unhealthy