Docker Compose
With Docker Compose, you can spin up local testnets with a single command.Requirements
Build
Build thecometbft binary and, optionally, the cometbft/localnode
docker image.
Note the binary will be mounted into the container so it can be updated without
rebuilding the image.
Run a testnet
To start a 4 node testnet run:Configuration
Themake localnet-start creates files for a 4-node testnet in ./build by
calling the cometbft testnet command.
The ./build directory is mounted to the /cometbft mount point to attach
the binary and config files to the container.
To change the number of validators / non-validators change the localnet-start Makefile target here:
Configuring ABCI containers
To use your own ABCI applications with 4-node setup edit the docker-compose.yaml file and add images to your ABCI application.Logging
Log is saved under the attached volume, in thecometbft.log file. If the
LOG environment variable is set to stdout at start, the log is not saved,
but printed on the screen.
Special binaries
If you have multiple binaries with different names, you can specify which one to run with theBINARY environment variable. The path of the binary is relative
to the attached volume.