Skip to content

Getting started

makemake-kbo edited this page Oct 2, 2023 · 6 revisions

Installation

Cargo

In order to install Blutgang via cargo, you must have Rust installed.
To get the latest stable version of Blutgang via cargo run the following command:

cargo install blutgang

Docker

Using docker with blutgang will impact performance by ~2-10%. Because of this we don't recommend docker where performance is critical.

For the latest stable version, pull the latest tag:

docker pull makemake1337/blutgang:latest

Tags for individual versions are also available. For version 0.1.0:

docker pull makemake1337/blutgang:0.1.0

You must provide a config file to the docker container, as well as expose the port specified. Example:

docker run -v /full/path/to/config.toml:/app/config.toml --network host makemake1337/blutgang

Prebuilt binaries

Prebuilt binaries are available on the release page.

From source

git clone https://github.com/rainshowerLabs/blutgang.git
cd blutgang
cargo build --release

maxperf builds

If you are optimizing for maximum performance, we recommend installing/compiling with the options below. Compile times will increase, but performance will be more consistent:

RUSTFLAGS='-C target-cpu=native' cargo build --profile maxperf
RUSTFLAGS='-C target-cpu=native' cargo install blutgang --profile maxperf

Post-install first steps

To check if blutgang was installed properly, run blutgang --help. If you see something like:

Usage: blutgang [OPTIONS]

Options:
  -r, --rpc_list <rpc_list>...
          CSV list of rpcs [default: ]
  -c, --config <config>...
          TOML config file for blutgang [default: config.toml]
  -p, --port <port>...
          port to listen to [default: 3000]
  -a, --address <address>...
          port to listen to [default: 127.0.0.1]
      --ma_length <ma_length>...
          Latency moving average length [default: 15]
  -d, --db <db>...
          Database path [default: blutgang-cache]
      --cache_capacity <cache_capacity>...
          Capacity of the cache stored in memory in bytes [default: 1000000000]
      --print_profile [<print_profile>...]
          Print DB profile on drop
      --compression [<compression>...]
          Use zstd compression
      --flush_every_ms <flush_every_ms>...
          Time in ms to flush the DB [default: 1000]
      --clear [<clear>...]
          Clear cache
      --health_check [<>...]
          Enable health checking
      --ttl <ttl>...
          Time for the RPC to respond before we remove it from the active queue [default: 300]
      --health_check_ttl <health_check_ttl>...
          How often to perform the health check [default: 2000]
  -h, --help
          Print help
  -V, --version
          Print version

Congrats! You have Blutgang installed properly!

To learn how to configure Blutgang, check out the next section.

Clone this wiki locally