github.com/badrootd/nibiru-cometbft@v0.37.5-0.20240307173500-2a75559eee9b/docs/guides/install.md (about)

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