testnet
GitHub

Local Testnet Generation

component developer

Automate the creation of a complete, multi-validator local testing environment.

The marood testnet command is a powerful utility that automates the setup of a local Maroo blockchain network. It generates all necessary configuration files, keys, and genesis information for a specified number of validators, enabling developers to quickly spin up a realistic testing environment without manual configuration.

How It Works

When you run marood testnet, it performs a series of automated steps. First, it creates a separate directory for each validator node. Inside each directory, it runs the equivalent of marood init to create the default configuration files. It then generates a unique validator keypair for each node.

Next, it aggregates the public keys of all generated validators and creates a common genesis.json file. This genesis file includes gentx (genesis transactions) that declare each node as a validator from the very first block. It also allocates initial balances of OKRW and staking tokens to each validator's account. Finally, it places a copy of this common genesis.json into each node's configuration directory, ensuring they all start from the same state.

Generated Artifacts

The command creates a specified output directory (default: ./.testnets). Inside, you will find a directory for each node (e.g., node0, node1, etc.). Each node directory contains:
  • marood.log: The log file for the node.
  • config/: Contains config.toml, app.toml, and the crucial genesis.json.
  • data/: Contains the blockchain data.


The command also prints the mnemonics for each generated account to the console, which is essential for importing them into wallets for testing.

Key Configuration Flags

  • -v or --validator-count: The number of validator nodes to create.
  • -o or --output-dir: The directory where the testnet files will be stored.
  • --starting-ip-address: The base IP address for the nodes. The command increments this for each subsequent node.
  • --chain-id: Sets a specific chain ID for the testnet.
  • --config-changes: Allows for dynamic modification of config.toml settings during generation. See the 'Dynamic Node Configuration' concept for more details.
Source: maroo
ESC
Type to search