Local development network

Instructions on how to run a local development network

Setting up a local EVM+ Stack


The tooling needed in order to successfully run a local EVM+ development network are:

Starting the mandala node and subquery

To be able to run the local development network, you need to clone our bodhi.js monorepo. Fortunately the network resides within the evm-subql directory, so the full project doesn't have to be built. As the monorepo contains submodules, we recommend cloning them as well:
git clone --recurse-submodules [email protected]:AcalaNetwork/bodhi.js.git
cd bodhi.js
NOTE: We suggest regularly running git pull and re-running update and build tasks in order to use the latest version of the local development network.
The local development network consists of Mandala node, Postgres database, SubQuery node and GraphQL engine. The docker compose script that runs and connects them resides within the evm-subql directory. To spin them up, use:
cd evm-subql
yarn build
docker-compose up
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.
Running a local development network
NOTE: Use Control + c combination of keys to shut down the node.
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
Cleaning up the local development network

Starting the RPC adapter

In addition to the local development network, we need to run an Ethereum RPC adapter, which provides JSON-RPC, so the tools that rely on JSON-RPC (such as Metamask, truffle, hardhat, etc...) will work.
We run it in another window by using:
npx @acala-network/eth-rpc-adapter --local-mode --subql http://localhost:3001
Starting up the RPC node
If you wish to learn more about the RPC adapter, you can find the info in the RPC adapter documentation.

The local development network services

Once the local development network is up and running, the following services are available:
Local development network in Substrate chain explorer
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.