3fd376bd56
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ v ✰ Thanks for creating a PR! ✰ v Before smashing the submit button please review the checkboxes. v If a checkbox is n/a - please still include it but + a little note why ☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --> ## Description <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> closes: #9106 --- Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why. - [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - [ ] Wrote unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`) - [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [ ] Re-reviewed `Files changed` in the Github PR explorer - [ ] Review `Codecov Report` in the comment section below once CI passes |
||
---|---|---|
.. | ||
helpers | ||
params | ||
simd | ||
README.md | ||
app.go | ||
app_test.go | ||
config.go | ||
encoding.go | ||
export.go | ||
genesis.go | ||
genesis_account.go | ||
genesis_account_test.go | ||
sim_bench_test.go | ||
sim_test.go | ||
state.go | ||
test_helpers.go | ||
types.go | ||
utils.go | ||
utils_test.go |
README.md
order |
---|
false |
simapp
simapp is an application built using the Cosmos SDK for testing and educational purposes.
Running testnets with simd
If you want to spin up a quick testnet with your friends, you can follow these steps. Unless otherwise noted, every step must be done by everyone who wants to participate in this testnet.
-
From the root directory of the Cosmos SDK repository, run
$ make build
. This will build thesimd
binary inside a newbuild
directory. The following instructions are run from inside thebuild
directory. -
If you've run
simd
before, you may need to reset your database before starting a new testnet. You can reset your database with the following command:$ ./simd unsafe-reset-all
. -
$ ./simd init [moniker] --chain-id [chain-id]
. This will initialize a new working directory at the default location~/.simapp
. You need to provide a "moniker" and a "chain id". These two names can be anything, but you will need to use the same "chain id" in the following steps. -
$ ./simd keys add [key_name]
. This will create a new key, with a name of your choosing. Save the output of this command somewhere; you'll need the address generated here later. -
$ ./simd add-genesis-account [key_name] [amount]
, wherekey_name
is the same key name as before; andamount
is something like10000000000000000000000000stake
. -
$ ./simd gentx [key_name] [amount] --chain-id [chain-id]
. This will create the genesis transaction for your new chain. Hereamount
should be at least1000000000stake
. If you provide too much or too little, you will encounter an error when starting your node. -
Now, one person needs to create the genesis file
genesis.json
using the genesis transactions from every participant, by gathering all the genesis transactions underconfig/gentx
and then calling$ ./simd collect-gentxs
. This will create a newgenesis.json
file that includes data from all the validators (we sometimes call it the "super genesis file" to distinguish it from single-validator genesis files). -
Once you've received the super genesis file, overwrite your original
genesis.json
file with the new supergenesis.json
. -
Modify your
config/config.toml
(in the simapp working directory) to include the other participants as persistent peers:# Comma separated list of nodes to keep persistent connections to persistent_peers = "[validator_address]@[ip_address]:[port],[validator_address]@[ip_address]:[port]"
You can find
validator_address
by running$ ./simd tendermint show-node-id
. The output will be the hex-encodedvalidator_address
. The defaultport
is 26656. -
Now you can start your nodes:
$ ./simd start
.
Now you have a small testnet that you can use to try out changes to the Cosmos SDK or Tendermint!
NOTE: Sometimes creating the network through the collect-gentxs
will fail, and validators will start
in a funny state (and then panic). If this happens, you can try to create and start the network first
with a single validator and then add additional validators using a create-validator
transaction.