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.

95 lines
3.5 KiB

  1. # Docker container description for Tendermint applications
  2. * Overview (#Overview)
  3. * Tendermint (#Tendermint)
  4. * Basecoin (#Basecoin)
  5. * Ethermint (#Ethermint)
  6. ## Overview
  7. This folder contains Docker container descriptions. Using this folder you can build your own Docker images with the tendermint application.
  8. It is assumed that you set up docker already.
  9. If you don't want to build the images yourself, you should be able to download them from Docker Hub.
  10. ## Tendermint
  11. Build the container:
  12. Copy the `tendermint` binary to the `tendermint` folder.
  13. ```
  14. docker build -t tendermint tendermint
  15. ```
  16. The application configuration will be stored at `/tendermint` in the container. The ports 46656 and 46657 will be open for ABCI applications to connect.
  17. Initialize tendermint configuration and keep it after the container is finished in a docker volume called `data`:
  18. ```
  19. docker run --rm -v data:/tendermint tendermint init
  20. ```
  21. If you want the docker volume to be a physical directory on your filesystem, you have to give an absolute path to docker and make sure the permissions allow the application to write it.
  22. Get the public key of tendermint:
  23. ```
  24. docker run --rm -v data:/tendermint tendermint show_validator
  25. ```
  26. Run the docker tendermint application with:
  27. ```
  28. docker run --rm -d -v data:/tendermint tendermint node
  29. ```
  30. ## Basecoin
  31. Build the container:
  32. Copy the `basecoin` binary to the `basecoin` folder.
  33. ```
  34. docker build -t basecoin basecoin
  35. ```
  36. The application configuration will be stored at `/basecoin`.
  37. Initialize basecoin configuration and keep it after the container is finished:
  38. ```
  39. docker run --rm -v basecoindata:/basecoin basecoin init deadbeef
  40. ```
  41. Use your own basecoin account instead of `deadbeef` in the `init` command.
  42. Get the public key of basecoin:
  43. We use a trick here: since the basecoin and the tendermint configuration folders are similar, the `tendermint` command can extract the public key for us if we feed the basecoin configuration folder to tendermint.
  44. ```
  45. docker run --rm -v basecoindata:/tendermint tendermint show_validator
  46. ```
  47. Run the docker tendermint application with:
  48. This is a two-step process:
  49. * Run the basecoin container.
  50. * Run the tendermint container and expose the ports that allow clients to connect. The --proxy_app should contain the basecoin application's IP address and port.
  51. ```
  52. docker run --rm -d -v basecoindata:/basecoin basecoin start --without-tendermint
  53. docker run --rm -d -v data:/tendermint -p 46656-46657:46656-46657 tendermint node --proxy_app tcp://172.17.0.2:46658
  54. ```
  55. ## Ethermint
  56. Build the container:
  57. Copy the `ethermint` binary and the setup folder to the `ethermint` folder.
  58. ```
  59. docker build -t ethermint ethermint
  60. ```
  61. The application configuration will be stored at `/ethermint`.
  62. The files required for initializing ethermint (the files in the source `setup` folder) are under `/setup`.
  63. Initialize ethermint configuration:
  64. ```
  65. docker run --rm -v ethermintdata:/ethermint ethermint init /setup/genesis.json
  66. ```
  67. Start ethermint as a validator node:
  68. This is a two-step process:
  69. * Run the ethermint container. You will have to define where tendermint runs as the ethermint binary connects to it explicitly.
  70. * Run the tendermint container and expose the ports that allow clients to connect. The --proxy_app should contain the ethermint application's IP address and port.
  71. ```
  72. docker run --rm -d -v ethermintdata:/ethermint ethermint --tendermint_addr tcp://172.17.0.3:46657
  73. docker run --rm -d -v data:/tendermint -p 46656-46657:46656-46657 tendermint node --proxy_app tcp://172.17.0.2:46658
  74. ```