github.com/okex/exchain@v1.8.0/libs/tendermint/docs/introduction/install.md (about)

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