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.

129 lines
2.9 KiB

6 years ago
  1. ---
  2. order: 3
  3. ---
  4. # Install Tendermint
  5. The fastest and easiest way to install the `tendermint` binary
  6. is to run [this script](https://github.com/tendermint/tendermint/blob/master/scripts/install/install_tendermint_ubuntu.sh) on
  7. a fresh Ubuntu instance,
  8. or [this script](https://github.com/tendermint/tendermint/blob/master/scripts/install/install_tendermint_bsd.sh)
  9. on a fresh FreeBSD instance. Read the comments / instructions carefully (i.e., reset your terminal after running the script,
  10. make sure you are okay with the network connections being made).
  11. ## From Binary
  12. To download pre-built binaries, see the [releases page](https://github.com/tendermint/tendermint/releases).
  13. ## From Source
  14. You'll need `go` [installed](https://golang.org/doc/install) and the required
  15. environment variables set, which can be done with the following commands:
  16. ```bash
  17. echo export GOPATH=\"\$HOME/go\" >> ~/.bash_profile
  18. echo export PATH=\"\$PATH:\$GOPATH/bin\" >> ~/.bash_profile
  19. echo export GO111MODULE=on >> ~/.bash_profile
  20. ```
  21. ### Get Source Code
  22. ```
  23. mkdir -p $GOPATH/src/github.com/tendermint
  24. cd $GOPATH/src/github.com/tendermint
  25. git clone https://github.com/tendermint/tendermint.git
  26. cd tendermint
  27. ```
  28. ### Get Tools & Dependencies
  29. ```
  30. make tools
  31. ```
  32. ### Compile
  33. ```
  34. make install
  35. ```
  36. to put the binary in `$GOPATH/bin` or use:
  37. ```
  38. make build
  39. ```
  40. to put the binary in `./build`.
  41. _DISCLAIMER_ The binary of tendermint is build/installed without the DWARF symbol table. If you would like to build/install tendermint with the DWARF symbol and debug information, remove `-s -w` from `BUILD_FLAGS` in the make file.
  42. The latest `tendermint version` is now installed.
  43. ## Run
  44. To start a one-node blockchain with a simple in-process application:
  45. ```
  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. ```
  52. cd $GOPATH/src/github.com/tendermint/tendermint
  53. make install
  54. ```
  55. To upgrade, run
  56. ```
  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. ```
  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. ```
  80. # config/config.toml
  81. db_backend = "cleveldb"
  82. ```
  83. To install Tendermint, run:
  84. ```
  85. CGO_LDFLAGS="-lsnappy" make install_c
  86. ```
  87. or run:
  88. ```
  89. CGO_LDFLAGS="-lsnappy" make build_c
  90. ```
  91. which puts the binary in `./build`.