#load-balancing #ethereum #websocket #http #cli

app blutgang

Fast, minimalist load balancing with caching for Ethereum JSON-RPC calls. Full support for HTTP and WS.

11 releases

0.3.5 Apr 1, 2024
0.3.4 Mar 29, 2024
0.3.2 Feb 28, 2024
0.2.1 Nov 23, 2023
0.1.2 Oct 21, 2023

#36 in #load-balancing

Download history 7/week @ 2024-02-02 2/week @ 2024-02-09 11/week @ 2024-02-16 289/week @ 2024-02-23 64/week @ 2024-03-01 18/week @ 2024-03-08 8/week @ 2024-03-15 106/week @ 2024-03-22 300/week @ 2024-03-29 33/week @ 2024-04-05 1/week @ 2024-04-12

440 downloads per month

Custom license and maybe LGPL-2.1-or-later WITH GCC-exception-2.0

270KB
6.5K SLoC

Blutgang - the wd40 of ethereum load balancers

blutgang_gm

Join the discussion on our discord, telegram, or matrix!

Blutgang is a blazing fast, caching, minimalistic load balancer designed with Ethereum's JSON-RPC in mind. Historical RPC queries are cached in a local database, bypassing the need for slow, repeating calls to your node.

For more info about blutgang and how to use it, please check out the wiki.

How to run

For detailed instructions on how to use blutgang, please read the wiki.

Using cargo

To install blutgang via cargo, run the following command:

cargo install blutgang

Once done, grab the example_config.toml from this repository, modify it to your liking, and start blutgang with it.

From source

Clone the repository, and find the example_config.toml file. Edit it to your liking, and run cargo run --release -- -c example_config.toml.

If you want to use command line arguments instead, please run cargo run --release -- --help for more info. Keep in mind that the recommended way to run blutgang is via a config file.

Max performance

If you need the absolute maximum performance from blutgang, compile it using the command below:

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

Docker

The official docker image is available on dockerhub.
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

Nix

Using Flakes and the nix-community/ethereum.nix overlay:

nix run github:nix-community/ethereum.nix#blutgang -- --help

Benchmarks

Benchmarks were performed with a Ryzen 7 2700X, NVME SSD, and default Ubuntu 23.04 kernel. Same RPC endpoints were used

time sothis --source_rpc http://localhost:3000 --mode call_track --contract_address 0x1c479675ad559DC151F6Ec7ed3FbF8ceE79582B6 --origin_block 17885300 --terminal_block 17892269 --calldata 0x06f13056 --query_interval 20

Figure_1 Figure_2

Acknowledgements

Blutgang is standing on the shoulders of giants. Thank you to all the contributors of the projects above!

License

Blutgang is licensed under the FSL. Without permission, this means you are allowed to use Blutgang for everything except commercial use cases, such as selling RPC access, and building other load balancers. Internal evaluation and any non-commercial use case is explicitly allowed. Two years after release, that specific version becomes licensed under the Apache-2.0 license.

For commercial support, which includes deployment scripts, relicensing options, ansible playbooks and more, contact us for a commercial license!

Dependencies

~23–39MB
~690K SLoC