- Compile CometBFT, i.e. the sequencing layer:
git clone https://github.com/cometbft/cometbft
cd cometbft
git checkout v0.38.10
make install
- Compile Grug, i.e. the execution layer:
git clone https://github.com/left-curve/grug
cd grug
just install
- Compile necessary contracts:
just optimize
- Initialize CometBFT. This will create a directory
~/.cometbft
, which most notably includes the genesis file at~/.cometbft/config/genesis.json
. However, the app genesis state (theapp_state
field in the JSON) is left empty for now:
cometbft init
- Generate two keys. We will create register two accounts during genesis, which will use these two keys, respectively:
grug keys add test1
grug keys add test2
- Prepare the genesis file. This runs an example script, which utilizes
grug_sdk::GenesisBuilder
to create an app genesis state and populate in the CometBFT genesis file:
cargo run -p grug-sdk --example build_genesis
- Start the node. Generally, when starting, start
grug
first, thencometbft
; when shutting down, stopcometbft
first, thengrug
:
grug start
cometbft start
- Optional: deleting existing chain data and restart anew:
cometbft unsafe-reset-all
grug db reset
- How to shut down the node
Use CTRL+C to kill CometBFT first, then CTRL+C to kill Grug.
Generally, when starting, start Grug first then start CometBFT; then stopping, kill CometBFT then kill Grug.
Don't worry, you won't mess up anything if you get the order wrong. This is just the intended order the software are designed.