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.2 KiB

  1. # Local Cluster with Docker Compose
  2. DEPRECATED!
  3. See the [docs](https://tendermint.com/docs/networks/docker-compose.html).
  4. ## Requirements
  5. - [Install tendermint](/docs/install.md)
  6. - [Install docker](https://docs.docker.com/engine/installation/)
  7. - [Install docker-compose](https://docs.docker.com/compose/install/)
  8. ## Build
  9. Build the `tendermint` binary and the `tendermint/localnode` docker image.
  10. Note the binary will be mounted into the container so it can be updated without
  11. rebuilding the image.
  12. ```
  13. cd $GOPATH/src/github.com/tendermint/tendermint
  14. # Build the linux binary in ./build
  15. make build-linux
  16. # Build tendermint/localnode image
  17. make build-docker-localnode
  18. ```
  19. ## Run a testnet
  20. To start a 4 node testnet run:
  21. ```
  22. make localnet-start
  23. ```
  24. The nodes bind their RPC servers to ports 26657, 26660, 26662, and 26664 on the host.
  25. This file creates a 4-node network using the localnode image.
  26. The nodes of the network expose their P2P and RPC endpoints to the host machine on ports 26656-26657, 26659-26660, 26661-26662, and 26663-26664 respectively.
  27. To update the binary, just rebuild it and restart the nodes:
  28. ```
  29. make build-linux
  30. make localnet-stop
  31. make localnet-start
  32. ```
  33. ## Configuration
  34. The `make localnet-start` creates files for a 4-node testnet in `./build` by calling the `tendermint testnet` command.
  35. The `./build` directory is mounted to the `/tendermint` mount point to attach the binary and config files to the container.
  36. For instance, to create a single node testnet:
  37. ```
  38. cd $GOPATH/src/github.com/tendermint/tendermint
  39. # Clear the build folder
  40. rm -rf ./build
  41. # Build binary
  42. make build-linux
  43. # Create configuration
  44. docker run -e LOG="stdout" -v `pwd`/build:/tendermint tendermint/localnode testnet --o . --v 1
  45. #Run the node
  46. docker run -v `pwd`/build:/tendermint tendermint/localnode
  47. ```
  48. ## Logging
  49. Log is saved under the attached volume, in the `tendermint.log` file. If the `LOG` environment variable is set to `stdout` at start, the log is not saved, but printed on the screen.
  50. ## Special binaries
  51. If you have multiple binaries with different names, you can specify which one to run with the BINARY environment variable. The path of the binary is relative to the attached volume.