# Single Node
# Pre-requisite Readings
# Automated Localnet (script)
You can customize the local testnet script by changing values for convenience for example:
The default configuration will generate a single validator localnet with the chain-id
evmosd-1 and one predefined account (
dev0) with some allocated funds at the genesis.
You can start the local chain using:
To avoid overwriting any data for a real node used in production,
it was decided to store the automatically generated testing configuration at
instead of the default
When working with the
local_node.sh script, it is necessary to extend all
that target the local test node, with the
--home ~/.tmp-evmosd flag.
This is mandatory, because the
home directory cannot be stored in the
which can be seen in the output below.
For ease of use, it might be sensible to export this directory path as an environment variable:
# Manual Localnet
This guide helps you create a single validator node that runs a network locally for testing and other development related uses.
# Initialize the chain
Before actually running the node, we need to initialize the chain, and most importantly its genesis file.
This is done with the
You can edit this
by updating the
The command above creates all the configuration files needed for your node and validator to run,
as well as a default genesis file, which defines the initial state of the network.
All these configuration files
~/.evmosd by default, but you can overwrite the location of this folder by passing the
# Genesis Procedure
# Adding Genesis Accounts
Before starting the chain, you need to populate the state with at least one account using the keyring:
Once you have created a local account, go ahead and grant it some
aevmos tokens in your chain's genesis file.
Doing so will also make sure your chain is aware of this account's existence:
Now that your account has some tokens, you need to add a validator to your chain.
For this guide, you will add your local node (created via the
init command above) as a validator of your chain.
Validators can be declared before a chain is first started
via a special transaction included in the genesis file called a
gentx does three things:
- Registers the
validatoraccount you created as a validator operator account (i.e. the account that controls the validator).
- Self-delegates the provided
amountof staking tokens.
- Link the operator account with a Tendermint node pubkey that will be used for signing blocks.
--pubkeyflag is provided, it defaults to the local node pubkey created via the
evmosd initcommand above.
For more information on
gentx, use the following command:
By default, the genesis file do not contain any
gentx is a transaction that bonds
staking token present in the genesis file under
accounts to a validator, essentially creating a
validator at genesis. The chain will start as soon as more than 2/3rds of the validators (weighted
by voting power) that are the recipient of a valid
gentx come online after
gentx can be added manually to the genesis file, or via the following command:
This command will add all the
gentxs stored in
~/.evmosd/config/gentx to the genesis file.
# Run Testnet
Finally, check the correctness of the
Now that everything is set up, you can finally start your node:
To check all the available customizable options when running the node, use the
You should see blocks come in.
The previous command allow you to run a single node. This is enough for the next section on interacting with this node, but you may wish to run multiple nodes at the same time, and see how consensus happens between them.
You can then stop the node using