Local Testnet Generation
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
Next, it aggregates the public keys of all generated validators and creates a common
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:
The command also prints the mnemonics for each generated account to the console, which is essential for importing them into wallets for testing.
./.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/: Containsconfig.toml,app.toml, and the crucialgenesis.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
-vor--validator-count: The number of validator nodes to create.-oor--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 ofconfig.tomlsettings during generation. See the 'Dynamic Node Configuration' concept for more details.