Skip to main content

Local Environment Setup (Docker)

The VELA local environment runs a complete stack on your machine via Docker Compose. It includes a local EVM chain, automatic smart contract deployment, a subgraph indexer, the Processor Manager, and the Authority Service — everything you need to develop and test a VASM application without touching a testnet.

Note: The TEE is emulated in this environment. No real AWS Nitro Enclave is used. Only one WASM application deployment is supported per environment (appId 1).

Prerequisites

  • Docker with Docker Compose v2+
  • Git

No other local tooling is required to run the environment. You only need a language toolchain (Go + TinyGo) if you intend to build your own WASM module.

Setup

1. Clone the starter kit

git clone https://github.com/HorizenOfficial/vela-starterkit
cd vela-starterkit/dockerfiles

2. Create your environment file

For local development, copy the pre-configured dev defaults:

cp .env.dev .env

The .env.dev file has everything pre-configured for local use. You do not need to modify it to get started.

3. Start the stack

docker compose up

Service Startup Sequence

Docker Compose brings up six services in a defined dependency chain:

StepServiceWhat It Does
1chainStarts Foundry Anvil — a local EVM dev chain
2subgraph-postgres, subgraph-ipfsStarts Graph Node infrastructure
3deployerDeploys all VELA smart contracts, writes addresses to a shared volume, then exits
4subgraph-nodeStarts Graph Node, connects to the chain
5subgraph-deployerReads deployed contract addresses, generates the subgraph manifest, deploys it, then exits
6manager, authorityserviceStart and begin polling the chain and subgraph for requests

The full stack is ready when manager and authorityservice are running and healthy. This takes roughly 30–60 seconds on first boot.

Connecting MetaMask

To interact with the local chain from a browser wallet:

FieldValue
RPC URLhttp://localhost:8545
Chain ID31337
CurrencyETH

Anvil pre-funds a set of default accounts with 1000 ETH each. Their private keys are printed in the chain service logs on startup.

Data Persistence and Volume Management

All state is persisted across restarts in Docker volumes.

VolumeContents
vela-skit-chain-dataAnvil chain data
vela-skit-manager-dataProcessor Manager LevelDB state
vela-skit-deploy-dataDeployed contract addresses
vela-skit-manager-reportsDeanonymization reports (shared with Authority Service)
vela-skit-logsCentralized logs

Restart without data loss:

docker compose down && docker compose up

The deployer detects existing contracts and skips redeployment.

Full reset — start from scratch:

docker compose down
docker volume rm dockerfiles_vela-skit-chain-data \
dockerfiles_vela-skit-deploy-data \
dockerfiles_vela-skit-manager-data
docker compose up

If you modify contracts: rebuild the deployer image and delete both the chain and deploy volumes before restarting.