Load balancer / reverse proxy written in GoLang for blockchain nodes. It provides redundant interface for applications using Ethereum and acts as a reverse proxy sitting between ethereum client and nodes. It constantly checks the node availability and its latest block number and keeps the list of healthy web3 providers. If node goes offline or slows down the requests fall back to another node. Only Ethereum Web3 over HTTPs nodes are currently supported (see roadmap)
With docker
docker build . -t loadbalancer
Without docker
go get -u github.com/golang/dep/cmd/dep
dep ensure
go build
Example config file
port: 8000
check_interval: 30 # seconds
connection_timeout: 5 # seconds
nodes:
- https://mainnet.infura.io/token
- http://localhost:8545
block_treshold: 10
- port - listening port
- check_interval - nodes polling interval
- connection_timeout - nodes polling connection timeout
- nodes - list of polling nodes
- block_treshold - node switch block treshold
With docker
docker run -v config.yml:/config.yml loadbalancer
Without docker
LoadBalancer -c /path/to/config.yml
Each file included in this repository is licensed under the MIT license.