Running the RPC adapter
Instructions on how to locally run the RPC adapter
Running the RPC adapter allows for interaction with the Acala EVM+, be it with the local development network, public test network or either of the main networks.
There are three ways of running the RPC node in a local environment:
Running the RPC adapter as a package allows you to use the RPC adapter without having to set up anything else. To run it in a this way, use:
npx @acala-network/eth-rpc-adapter \
--endpoint ws://localhost:9944 \
Once the repository is cloned install the necessary dependencies as well as build the adapter:
rush build -t @acala-network/eth-rpc-adapter
The RPC adapter is ready run:
yarn start --local-mode [--other-options]
Running the RPC adapter in Docker required Docker to be running and issuing the following command:
docker run -it --rm -e LOCAL_MODE=1 -p 8545:8545 acala/eth-rpc-adapter:v2.5.3 yarn start
Options can be passed to the RPC adapter in three ways:
- 1.As CLI options (recommended)
- 2.As environment variables
- 3.As environment variables in the
Passing the options as CLI options is done by appending the values to the command when running the RPC adapter:
npx @acala-network/eth-rpc-adapter -l -e ws://localhost:9944
If you wish to pass the options as environment variables in the terminal, you can add them with the
exportstatements, or by prepending the command used to spin up RPC adapter:
LOCAL_MODE=1 yarn start
Both the environment variable that is defined by itself as well as the one defined inline with the
yarn startwill be used in this case.
In case you are building the RPC adapter from source, you can set the options as variables within the
.envfile, like this
More details can also be found by
yarn start --helpor
npx @acala-network/eth-rpc-adapter --help.
-eflag and passing the URL of a Mandala, Acala and Karura node allows for running the local RPC adapter while communicating with a public network.
In this mode, Txs and logs can only be found after they are finalized. Now deprecated in favor for the
For local testing, we usually turn this mode on, together with a local
--instant-sealingmandala node. It has some optimization to run faster with local node, and some minor bug prevention.
In rich mode, default gas params are much bigger than normal, so we don't need to worry about overriding gas params when running tests. As a result, all truffle/hardhat tests can be run unchanged.