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.

131 lines
2.5 KiB

6 years ago
  1. ---
  2. order: 3
  3. ---
  4. # Install Tendermint
  5. ## From Binary
  6. To download pre-built binaries, see the [releases page](https://github.com/tendermint/tendermint/releases).
  7. ## From Source
  8. You'll need `go` [installed](https://golang.org/doc/install) and the required
  9. environment variables set, which can be done with the following commands:
  10. ```bash
  11. echo export GOPATH=\"\$HOME/go\" >> ~/.bash_profile
  12. echo export PATH=\"\$PATH:\$GOPATH/bin\" >> ~/.bash_profile
  13. echo export GO111MODULE=on >> ~/.bash_profile
  14. ```
  15. ### Get Source Code
  16. ```
  17. mkdir -p $GOPATH/src/github.com/tendermint
  18. cd $GOPATH/src/github.com/tendermint
  19. git clone https://github.com/tendermint/tendermint.git
  20. cd tendermint
  21. ```
  22. ### Get Tools & Dependencies
  23. ```
  24. make tools
  25. ```
  26. ### Compile
  27. ```
  28. make install
  29. ```
  30. to put the binary in `$GOPATH/bin` or use:
  31. ```
  32. make build
  33. ```
  34. to put the binary in `./build`.
  35. _DISCLAIMER_ The binary of tendermint is build/installed without the DWARF
  36. symbol table. If you would like to build/install tendermint with the DWARF
  37. symbol and debug information, remove `-s -w` from `BUILD_FLAGS` in the make
  38. file.
  39. The latest tendermint is now installed. You can verify the installation by
  40. running:
  41. ```
  42. tendermint version
  43. ```
  44. ## Run
  45. To start a one-node blockchain with a simple in-process application:
  46. ```
  47. tendermint init
  48. tendermint node --proxy_app=kvstore
  49. ```
  50. ## Reinstall
  51. If you already have Tendermint installed, and you make updates, simply
  52. ```
  53. cd $GOPATH/src/github.com/tendermint/tendermint
  54. make install
  55. ```
  56. To upgrade, run
  57. ```
  58. cd $GOPATH/src/github.com/tendermint/tendermint
  59. git pull origin master
  60. make install
  61. ```
  62. ## Compile with CLevelDB support
  63. Install [LevelDB](https://github.com/google/leveldb) (minimum version is 1.7).
  64. Install LevelDB with snappy (optionally). Below are commands for Ubuntu:
  65. ```
  66. sudo apt-get update
  67. sudo apt install build-essential
  68. sudo apt-get install libsnappy-dev
  69. wget https://github.com/google/leveldb/archive/v1.20.tar.gz && \
  70. tar -zxvf v1.20.tar.gz && \
  71. cd leveldb-1.20/ && \
  72. make && \
  73. sudo cp -r out-static/lib* out-shared/lib* /usr/local/lib/ && \
  74. cd include/ && \
  75. sudo cp -r leveldb /usr/local/include/ && \
  76. sudo ldconfig && \
  77. rm -f v1.20.tar.gz
  78. ```
  79. Set a database backend to `cleveldb`:
  80. ```
  81. # config/config.toml
  82. db_backend = "cleveldb"
  83. ```
  84. To install Tendermint, run:
  85. ```
  86. CGO_LDFLAGS="-lsnappy" make install TENDERMINT_BUILD_OPTIONS=cleveldb
  87. ```
  88. or run:
  89. ```
  90. CGO_LDFLAGS="-lsnappy" make build TENDERMINT_BUILD_OPTIONS=cleveldb
  91. ```
  92. which puts the binary in `./build`.