cosmos-sdk/simapp
mergify[bot] 1cf2940393
build(deps): Bump deps (backport #19655) (#19712)
Co-authored-by: Julien Robert <julien@rbrt.fr>
2024-03-11 10:02:49 +00:00
..
params refactor!: extract `AppStateFn` out of simapp (backport #14977) (#14978) 2023-02-09 15:03:57 +00:00
simd feat: add event-query-tx-for cmd to subscribe and wait for transaction (backport #17274) (#17435) 2023-08-18 08:55:44 +00:00
README.md feat(simapp): Genesis related commands under one `genesis` command (backport #14149) (#14199) 2022-12-07 21:08:40 +01:00
app.go fix: correct path required proto testdata (backport #14991) (#16083) 2023-05-10 18:38:09 +02:00
app_config.go refactor: improve `x/upgrade` app wiring (part of upgrade audit) (backport #14216) (#14306) 2022-12-15 18:18:14 +00:00
app_test.go refactor: migrate to CometBFT in v0.47 (#15060) 2023-02-20 16:36:58 +01:00
app_v2.go fix: correct path required proto testdata (backport #14991) (#16083) 2023-05-10 18:38:09 +02:00
export.go refactor: migrate to CometBFT in v0.47 (#15060) 2023-02-20 16:36:58 +01:00
genesis.go fix: app config and simapp (v1,v2) fixes (backport #14209) (#14230) 2022-12-09 13:52:49 +01:00
genesis_account.go x/auth: remove alias.go usage (#6440) 2020-06-17 14:42:27 -04:00
genesis_account_test.go refactor: migrate to CometBFT in v0.47 (#15060) 2023-02-20 16:36:58 +01:00
go.mod build(deps): Bump deps (backport #19655) (#19712) 2024-03-11 10:02:49 +00:00
go.sum build(deps): Bump deps (backport #19655) (#19712) 2024-03-11 10:02:49 +00:00
sim_bench_test.go fix(simapp): set chain-id on `NewSimApp` for sim bench tests (backport #17138) (#17141) 2023-07-26 12:23:03 +00:00
sim_test.go fix: unique constraint violation for group policy sim genesis (backport #15943) (#15951) 2023-04-26 18:40:12 +02:00
sonar-project.properties ci: make sonarcloud more quiet (backport #14585) (#14589) 2023-01-12 10:36:26 +00:00
test_helpers.go fix: remove previous header in Prepare/Process Proposal + provide chain id in baseapp + fix context for verifying txs (backport #15303) (#15377) 2023-03-13 19:25:34 +00:00
testutil_network_test.go refactor: create go.mod for simapp (#13130) 2022-09-07 18:14:22 +00:00
upgrades.go fix: add params migration (backport #14992) (#15004) 2023-02-13 21:19:39 +00:00

README.md

sidebar_position
1

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.

  1. From the root directory of the Cosmos SDK repository, run $ make build. This will build the simd binary inside a new build directory. The following instructions are run from inside the build directory.

  2. 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 tendermint unsafe-reset-all.

  3. $ ./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.

  4. $ ./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.

  5. $ ./simd genesis add-genesis-account [key_name] [amount], where key_name is the same key name as before; and amount is something like 10000000000000000000000000stake.

  6. $ ./simd genesis gentx [key_name] [amount] --chain-id [chain-id]. This will create the genesis transaction for your new chain. Here amount should be at least 1000000000stake. If you provide too much or too little, you will encounter an error when starting your node.

  7. Now, one person needs to create the genesis file genesis.json using the genesis transactions from every participant, by gathering all the genesis transactions under config/gentx and then calling $ ./simd genesis collect-gentxs. This will create a new genesis.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).

  8. Once you've received the super genesis file, overwrite your original genesis.json file with the new super genesis.json.

  9. 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-encoded validator_address. The default port is 26656.

  10. 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.