var img = document.createElement('img'); img.src = "https://terradocs.matomo.cloud//piwik.php?idsite=1&rec=1&url=https://docs.terra.money" + location.pathname; img.style = "border:0"; img.alt = "tracker"; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(img,s);
Skip to main content

Configure LocalTerra

The majority of LocalTerra is implemented inside of the docker-compose.yml file, making it easily customizable. You can use LocalTerra as a starting point for setting up your own local Terra testnet with Docker containers.

Out of the box, LocalTerra comes with several preconfigured settings such as:

  • Ports defined for RPC (26657), LCD (1317), and FCD (3060).
  • Standard accounts.

Access config.toml

To access the config file, run the following.

Terminal
Copy

_5
docker compose run -it terrad vi config/config.toml
_5
_5
# or use the command line options below
_5
_5
docker compose run -it terrad terrad start --help

Modify node configuration

You can modify the node configuration of your validator in the config/config.toml and config/app.toml files.

Speed up block time

LocalTerra is often used alongside feather.js or Terra.py scripting as it is a convenient environment in which to run integration tests. LocalTerra also allows developers to speed up the block time to improve the development experience.

To increase block time, edit the [consensus] parameters in the config/config.toml file.

The following example configures all timeouts to 200ms.


_16
##### consensus configuration options #####
_16
[consensus]
_16
_16
wal_file = "data/cs.wal/wal"
_16
- timeout_propose = "3s"
_16
- timeout_propose_delta = "500ms"
_16
- timeout_prevote = "1s"
_16
- timeout_prevote_delta = "500ms"
_16
- timeout_precommit_delta = "500ms"
_16
- timeout_commit = "5s"
_16
+ timeout_propose = "200ms"
_16
+ timeout_propose_delta = "200ms"
_16
+ timeout_prevote = "200ms"
_16
+ timeout_prevote_delta = "200ms"
_16
+ timeout_precommit_delta = "200ms"
_16
+ timeout_commit = "200ms"

Additionally, you can use the following command to achieve the same result.


_1
sed -E -i '/timeout_(propose|prevote|precommit|commit)/s/[0-9]+m?s/200ms/' config/config.toml

Modifying genesis

You can modify the genesis.json file by altering config/genesis.json. Make sure to restart LocalTerra for your changes to be implemented.