You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
3.1 KiB

  1. # Deploy a Testnet
  2. Now that we've seen how ABCI works, and even played with a few
  3. applications on a single validator node, it's time to deploy a test
  4. network to four validator nodes.
  5. ## Manual Deployments
  6. It's relatively easy to setup a Tendermint cluster manually. The only
  7. requirements for a particular Tendermint node are a private key for the
  8. validator, stored as `priv_validator.json`, a node key, stored as
  9. `node_key.json` and a list of the public keys of all validators, stored
  10. as `genesis.json`. These files should be stored in
  11. `~/.tendermint/config`, or wherever the `$TMHOME` variable might be set
  12. to.
  13. Here are the steps to setting up a testnet manually:
  14. 1. Provision nodes on your cloud provider of choice
  15. 2. Install Tendermint and the application of interest on all nodes
  16. 3. Generate a private key and a node key for each validator using
  17. `tendermint init`
  18. 4. Compile a list of public keys for each validator into a
  19. `genesis.json` file and replace the existing file with it.
  20. 5. Run
  21. `tendermint node --proxy_app=kvstore --p2p.persistent_peers=< peer addresses >` on each node, where `< peer addresses >` is a comma separated
  22. list of the ID@IP:PORT combination for each node. The default port for
  23. Tendermint is `26656`. The ID of a node can be obtained by running
  24. `tendermint show_node_id` command. Thus, if the IP addresses of your nodes
  25. were `192.168.0.1, 192.168.0.2, 192.168.0.3, 192.168.0.4`, the command
  26. would look like:
  27. ```
  28. tendermint node --proxy_app=kvstore --p2p.persistent_peers=96663a3dd0d7b9d17d4c8211b191af259621c693@192.168.0.1:26656, 429fcf25974313b95673f58d77eacdd434402665@192.168.0.2:26656, 0491d373a8e0fcf1023aaf18c51d6a1d0d4f31bd@192.168.0.3:26656, f9baeaa15fedf5e1ef7448dd60f46c01f1a9e9c4@192.168.0.4:26656
  29. ```
  30. After a few seconds, all the nodes should connect to each other and
  31. start making blocks! For more information, see the Tendermint Networks
  32. section of [the guide to using Tendermint](./using-tendermint.md).
  33. But wait! Steps 3, 4 and 5 are quite manual. Instead, use the `tendermint testnet` command. By default, running `tendermint testnet` will create all the
  34. required files, but it won't populate the list of persistent peers. It will do
  35. it however if you provide the `--populate-persistent-peers` flag and optional
  36. `--starting-ip-address` flag. Run `tendermint testnet --help` for more details
  37. on the available flags.
  38. ```
  39. tendermint testnet --populate-persistent-peers --starting-ip-address 192.168.0.1
  40. ```
  41. This command will generate four folders, prefixed with "node" and put them into
  42. the "./mytestnet" directory by default.
  43. As you might imagine, this command is useful for manual or automated
  44. deployments.
  45. ## Automated Deployments
  46. The easiest and fastest way to get a testnet up in less than 5 minutes.
  47. ### Local
  48. With `docker` and `docker-compose` installed, run the command:
  49. ```
  50. make localnet-start
  51. ```
  52. from the root of the tendermint repository. This will spin up a 4-node
  53. local testnet. Review the target in the Makefile to debug any problems.
  54. ### Cloud
  55. See the [next section](./terraform-and-ansible.html) for details.