Quick Start
This guide takes you from zero to a running Cocoon stack in under ten minutes. By the end you will have two Erigon chains, the backend proxy, admin dashboard, investor frontends, user database, and block explorer all running locally via Docker Compose.
Prerequisites
Docker Engine
24.x or later
Docker Desktop also works
Docker Compose
v2.20 or later
Bundled with Docker Desktop
Git
Any recent version
For cloning the repo
RAM
16 GB recommended
8 GB minimum for single-chain only
Disk
20 GB free
For chain data volumes
CPU
4 cores recommended
The prover is CPU-intensive
Apple Silicon (M-series) users: all images build natively for linux/arm64. If you encounter exec format error on any container, ensure Docker Desktop is set to use the native ARM engine, not Rosetta emulation.
Step 1 — Clone the Repository
git clone https://github.com/your-org/cocoon.git
cd cocoonThe stack lives in the mvp/ subdirectory:
cd mvpAll subsequent commands in this guide are run from the mvp/ directory.
Step 2 — Configure Environment Variables
Copy the example environment file and open it in your editor:
The minimum required values are:
Never commit .env to version control. The file contains your admin private key. Verify .env is listed in .gitignore before proceeding.
For a full list of supported variables see Configuration.
Step 3 — Start the Stack
The Makefile target runs docker compose up --build -d and tails the logs.
To start only Chain A (lighter on resources):
Docker builds all images on first run. This takes 3–8 minutes depending on your machine and network. Subsequent starts are fast because layers are cached.
Step 4 — Wait for Services to Become Healthy
The stack uses Docker health checks. The deploy and deploy-chain2 one-shot containers wait for their respective Erigon nodes to be healthy before deploying contracts. You can watch progress:
Expected output when everything is up:
The deploy containers exit with code 0 when contract deployment succeeds. If they show exited (1), check the logs with docker compose logs deploy.
Step 5 — Verify the Stack
Check the backend health endpoint:
Expected response:
Check the Erigon RPC directly:
Expected response (Chain A):
Check the latest block:
The block number should be increasing (the Clique PoA engine produces a block every second).
Check the user database:
Expected: {"status":"ok"}
Open the dashboard:
Navigate to http://localhost:3000 in your browser. The admin dashboard shows token balances, recent transfers, and the audit log for Chain A.
Open the block explorer:
Navigate to http://localhost:3002. Blocks appear in real time as the chain produces them.
Step 6 — Confirm Contract Deployment
Contract addresses are written to deployments.json after the deploy container completes. Verify the file exists and contains addresses:
You should see a JSON object with chainId: 33 and addresses for PermissionRegistry, MMFToken, Stablecoin, and the Uniswap V3 pool contracts.
For Chain B:
Next Steps
With the stack running you can:
Onboard an investor
Use the admin dashboard to whitelist an address on the MMF token, or call token_onboardInvestor directly via the RPC.
Issue a token subscription
Have a whitelisted investor call token_subscribe or use the investor frontend at port 3001 to subscribe stablecoin for MMF shares.
Deploy a custom token
Call token_deploy via the RPC to deploy a new ERC-3643 permissioned token with your own compliance parameters.
Configure for production
Review the full Configuration reference and harden the deployment: replace demo keys, restrict port exposure, and enable strict auth mode.
Stopping the Stack
To stop and remove all data volumes (full reset):
docker compose down -v deletes all chain data and the user database. Contract addresses in deployments.json will no longer match the new chain state. Only use this for a clean development reset.
Viewing Logs
Last updated