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.

83 lines
2.8 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. # Deploy a Testnet
  2. DEPRECATED DOCS!
  3. See [Networks](../networks).
  4. ## Manual Deployments
  5. It's relatively easy to setup a Tendermint cluster manually. The only
  6. requirements for a particular Tendermint node are a private key for the
  7. validator, stored as `priv_validator.json`, a node key, stored as
  8. `node_key.json` and a list of the public keys of all validators, stored
  9. as `genesis.json`. These files should be stored in
  10. `~/.tendermint/config`, or wherever the `$TMHOME` variable might be set
  11. to.
  12. Here are the steps to setting up a testnet manually:
  13. 1. Provision nodes on your cloud provider of choice
  14. 2. Install Tendermint and the application of interest on all nodes
  15. 3. Generate a private key and a node key for each validator using
  16. `tendermint init`
  17. 4. Compile a list of public keys for each validator into a
  18. new `genesis.json` file and replace the existing file with it.
  19. 5. Get the node IDs of any peers you want other peers to connect to by
  20. running `tendermint show_node_id` on the relevant machine
  21. 6. Set the `p2p.persistent_peers` in the config for all nodes to the comma
  22. separated list of `ID@IP:PORT` for all nodes. Default port is 26656.
  23. Then start the node
  24. ```
  25. tendermint node --proxy_app=kvstore
  26. ```
  27. After a few seconds, all the nodes should connect to each other and
  28. start making blocks! For more information, see the Tendermint Networks
  29. section of [the guide to using Tendermint](../tendermint-core/using-tendermint.md).
  30. 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
  31. required files, but it won't populate the list of persistent peers. It will do
  32. it however if you provide the `--populate-persistent-peers` flag and optional
  33. `--starting-ip-address` flag. Run `tendermint testnet --help` for more details
  34. on the available flags.
  35. ```
  36. tendermint testnet --populate-persistent-peers --starting-ip-address 192.168.0.1
  37. ```
  38. This command will generate four folders, prefixed with "node" and put them into
  39. the "./mytestnet" directory by default.
  40. As you might imagine, this command is useful for manual or automated
  41. deployments.
  42. ## Automated Deployments
  43. The easiest and fastest way to get a testnet up in less than 5 minutes.
  44. ### Local
  45. With `docker` and `docker-compose` installed, run the command:
  46. ```
  47. make localnet-start
  48. ```
  49. from the root of the tendermint repository. This will spin up a 4-node
  50. local testnet. Note that this command expects a linux binary in the build directory.
  51. If you built the binary using a non-linux OS, you may see
  52. the error `Binary needs to be OS linux, ARCH amd64`, in which case you can
  53. run:
  54. ```
  55. make build-linux
  56. make localnet-start
  57. ```
  58. Review the target in the Makefile to debug any problems.
  59. ### Cloud
  60. See the [next section](./terraform-and-ansible.md) for details.