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.

130 lines
2.5 KiB

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