github.com/Finschia/finschia-sdk@v0.48.1/simapp/README.md (about) 1 --- 2 order: false 3 --- 4 5 # simapp 6 7 simapp is an application built using the Cosmos SDK for testing and educational purposes. 8 9 ## Running testnets with `simd` 10 11 If you want to spin up a quick testnet with your friends, you can follow these steps. 12 Unless otherwise noted, every step must be done by everyone who wants to participate 13 in this testnet. 14 15 1. From the root directory of the Cosmos SDK repository, run `$ make build`. This will build the 16 `simd` binary inside a new `build` directory. The following instructions are run from inside 17 the `build` directory. 18 2. If you've run `simd` before, you may need to reset your database before starting a new 19 testnet. You can reset your database with the following command: `$ ./simd tendermint unsafe-reset-all`. 20 3. `$ ./simd init [moniker] --chain-id [chain-id]`. This will initialize a new working directory 21 at the default location `~/.simapp`. You need to provide a "moniker" and a "chain id". These 22 two names can be anything, but you will need to use the same "chain id" in the following steps. 23 4. `$ ./simd keys add [key_name]`. This will create a new key, with a name of your choosing. 24 Save the output of this command somewhere; you'll need the address generated here later. 25 5. `$ ./simd add-genesis-account [key_name] [amount]`, where `key_name` is the same key name as 26 before; and `amount` is something like `10000000000000000000000000stake`. 27 6. `$ ./simd gentx [key_name] [amount] --chain-id [chain-id]`. This will create the genesis 28 transaction for your new chain. Here `amount` should be at least `1000000000stake`. If you 29 provide too much or too little, you will encounter an error when starting your node. 30 7. Now, one person needs to create the genesis file `genesis.json` using the genesis transactions 31 from every participant, by gathering all the genesis transactions under `config/gentx` and then 32 calling `$ ./simd collect-gentxs`. This will create a new `genesis.json` file that includes data 33 from all the validators (we sometimes call it the "super genesis file" to distinguish it from 34 single-validator genesis files). 35 8. Once you've received the super genesis file, overwrite your original `genesis.json` file with 36 the new super `genesis.json`. 37 9. Modify your `config/config.toml` (in the simapp working directory) to include the other participants as 38 persistent peers: 39 40 ``` 41 # Comma separated list of nodes to keep persistent connections to 42 persistent_peers = "[validator_address]@[ip_address]:[port],[validator_address]@[ip_address]:[port]" 43 ``` 44 45 You can find `validator_address` by running `$ ./simd tendermint show-node-id`. The output will 46 be the hex-encoded `validator_address`. The default `port` is 26656. 47 10. Now you can start your nodes: `$ ./simd start`. 48 49 Now you have a small testnet that you can use to try out changes to the Cosmos SDK or Tendermint! 50 51 NOTE: Sometimes creating the network through the `collect-gentxs` will fail, and validators will start 52 in a funny state (and then panic). If this happens, you can try to create and start the network first 53 with a single validator and then add additional validators using a `create-validator` transaction.