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

Requirement
Minimum
Notes

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

circle-exclamation

Step 1 — Clone the Repository

git clone https://github.com/your-org/cocoon.git
cd cocoon

The stack lives in the mvp/ subdirectory:

cd mvp

All 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:

triangle-exclamation

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.

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:

circle-info

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:3000arrow-up-right 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:3002arrow-up-right. 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):

circle-exclamation

Viewing Logs

Last updated