Running the devnet
Leverage a Dockerized multi-node setup for development.
This page walks through how to spin up a local Recall network on your machine (devnet
) and
presumes you've done the steps described in the preceding setup page. Most
developers will never need to run the devnet. It's only useful if you're making changes to the core
ipc
protocol codebase and want to test your changes.
Overview
The devnet requires you run multiple services manually and have the binaries installed on your host
machine. At a minimum, you'll need to install CometBFT, Fendermint, and Iroh. Optionally, you can
also run the EVM RPC service, in case you want to interact with the devnet via EVM RPCs (e.g.,
deploying Solidity contracts). It's significantly faster to spin up as compared to the localnet
setup.
Build dependencies
The following assumes you're working in the root of the ipc
repo, and not in this scripts
directory.
CometBFT
Navigate outside this repo and install CometBFT (note: you must install v0.37.1
since the
latest version is not compatible with the rest of the codebase):
Fendermint & IPC CLI
Navigate back into ipc
. The default make
task will build the contracts, libraries, and CLIs
needed to run a devnet
.
Setup
First, configure the devnet
with the following, which creates some keys and alters the
configuration located in ~/.fendermint
:
The keys used here are a bit different from how the localnet
setup works. The localnet
relies on
the ipc-cli
for much of its logic, whereas the devnet
relies primarily on the fendermint
CLI.
Accounts
The keys you'll use can be found in the test-network/keys
directory within this scripts
folder.
Only the alice
key is deterministically coded into the Fendermint startup process. You can export
any of the keys to a hex encoded EVM format.
From the root of this repo, run the following command, replacing alice.sk
with the corresponding
filename and alice_eth
with a desired name (for files that get created later):
Since the alice.sk
will always be the same, the following is consistent across machines and can be
used for devnet
interactions (e.g., creating buckets, timehubs, writing data, etc.):
- EVM address:
0xc05fe6b63ffa4b3c518e6ff1e597358ee839db01
- Hex private key:
1c323d494d1d069fe4c891350a1ec691c4216c17418a0cb3c7533b143bd2b812
Startup & shutdown
Finally, start all the services in separate terminal windows in the following order. The associated endpoints are shown below.
Once these are running, you should be able to interact with the devnet
and most of the expected
functionality. One thing to be aware of: there's no parent (rootnet), so certain parts of the
protocol (like deploying parent contracts, ERC20s, or Solidity wrappers) don't happen automatically.
Lastly, keep in mind that if you ever make changes to the core ipc
codebase and want the devnet to
use these changes, you'll need to shut these services down (i.e., exit the processes), run make
,
and then make config-devnet
again.
Usage
If you're using the recall
CLI, you must set the RECALL_NETWORK
environment variable to devnet
in order to use it. Note that fendermint
ipc-cli
the NETWORK
flag but with different target
functionality, so be sure the RECALL_
prefix is attached.
Similarly, you'll use the devnet
in the Rust SDK where necessary—e.g.,
recall_sdk::network::Network::Devnet.init()
, or the JS SDK lets you import the devnet
chain.