github.com/KYVENetwork/cometbft/v38@v38.0.3/docs/guides/install.md (about)

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