cosmos-sdk/simapp
Amaury 5d13b1fc63
InitGenesis in migrations when fromVersion==0 (#9007)
* InitGenesis in migrations when fromVersion==0

* Add test

* Fix test

* Fix comment

* cdc=>codec

* Don't break Configurator

* Remove method

* Add comments

* Add more comments

* Update types/module/module.go

Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>

* Update types/module/module.go

Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>

* Update types/module/module.go

Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>

Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>
2021-04-02 15:41:35 +00:00
..
helpers Replace tmcrypto.PubKey by our own cryptotypes.PubKey (#7419) 2020-11-09 16:01:43 +00:00
params Fix typo (#8905) 2021-03-17 09:53:51 +00:00
simd Add client config subcommand to CLI (#8953) 2021-03-31 12:04:33 +02:00
README.md simapp: add testnet instructions (#8342) 2021-01-19 17:08:09 -05:00
app.go InitGenesis in migrations when fromVersion==0 (#9007) 2021-04-02 15:41:35 +00:00
app_test.go InitGenesis in migrations when fromVersion==0 (#9007) 2021-04-02 15:41:35 +00:00
config.go Remove dependency of types/module package on x/simulation (#5835) 2020-03-23 12:55:44 +01:00
encoding.go codecs: rename MakeCodecs rename and docs update (#8245) 2021-01-07 21:50:52 +00:00
export.go Refactor store keys for variable-length addresses (#8363) 2021-02-01 13:17:44 +00:00
genesis.go appcreator: Reuse encoding config instead of recreating it (#8250) 2021-01-06 15:20:12 +00:00
genesis_account.go x/auth: remove alias.go usage (#6440) 2020-06-17 14:42:27 -04:00
genesis_account_test.go Update tm pubkey references (#7102) 2020-08-28 16:02:38 +00:00
sim_bench_test.go simapp, types: fix benchmarks panics by honoring skip if set (#8763) 2021-03-03 03:54:14 -08:00
sim_test.go Remove IBC from the SDK (#8735) 2021-03-04 13:11:34 +00:00
state.go [Bank] Remove the unsafe balance changing API (#8473) 2021-02-17 18:20:33 +00:00
test_helpers.go Merge pull request from GHSA-2f3p-6gfj-jccq 2021-03-24 12:05:33 -04:00
types.go Add height in exported genesis (#7089) 2020-09-03 10:11:46 +00:00
utils.go Add height in exported genesis (#7089) 2020-09-03 10:11:46 +00:00
utils_test.go rename RegisterCodec to RegisterLegacyAminoCodec (#7243) 2020-09-07 14:47:12 +00:00

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.

  1. $ make build. This will build the simd binary and install it in your Cosmos SDK repo, inside a new build directory. The following instructions are run from inside that directory.

  2. If you've run simd before, you may need to reset your database before starting a new testnet: $ ./simd unsafe-reset-all

  3. $ ./simd init [moniker]. This will initialize a new working directory, by default at ~/.simapp. You need a provide a "moniker," but it doesn't matter what it is.

  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 add-genesis-account $(simd keys show [key_name] -a) [amount], where key_name is the same key name as before; and amount is something like 10000000000000000000000000stake.

  6. $ ./simd gentx [key_name] [amount] --chain-id [chain-id]. This will create the genesis transaction for your new chain.

  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 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. (It will be hex-encoded.) By 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.