Local development network

Instructions on how to run a full local development network

The local development network consists of following services:

  • Mandala node

  • Subquery Services

    • Postgres database

    • Subquery node

    • GraphQL engine

  • Eth Rpc Adapter

Starting the stack

start the whole stack together

You can download or copy + paste this docker compose file, and then

docker compose -f docker-compose-bodhi-stack.yml up

Once you see logs like this, the local development stack is ready.

              🚀 SERVER STARTED 🚀
 version         : bodhi.js/eth-rpc-adapter/2.7.3
 endpoint url    : ws://mandala-node:9944
 subquery url    : http://graphql-engine:3001
 listening to    : 8545
 max blockCache  : 200
 max batchSize   : 50
 max storageSize : 5000
 safe mode       : false
 local mode      : false
 rich mode       : false
 http only       : false
 verbose         : true

It's ok to see some error messege in the docker logs, since we don't have transactions in the node yet, so subquery will keep crashing and restarting. Once there are transactions, everything will work normally.

In order to have a clean start after every shutdown of the node, run the following command after the node was shut down:

docker compose down -v

start a light stack

A light stack is a stack without subquery services, it only contains mandala node and eth rpc adapter. It's useful when you want to test some simple transactions, but it lacks the ability to fetch logs. (when do I need subquery?)

To start a light stack, first start a local mandala node

docker run -it --rm -p 9944:9944 -p 9933:9933 ghcr.io/acalanetwork/mandala-node:sha-a32c40b --dev --ws-external --rpc-port=9933 --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive --instant-sealing

Then start an eth rpc adapter

docker run -it --rm -p 8545:8545 acala/eth-rpc-adapter:2.7.4 --endpoint ws://host.docker.internal:9944 --local-mode

The local development network services

Once the full local development network is up and running, the following services are available:

You can now setup Metamask on localhost and interact with your local setup.

Try a few of the EVM tutorials to get familiar with the responses each terminal window provides as feedback.

Last updated