Load Balancer for fault-tolerant Ethereum and Bitcoin infrastructure (+ forks)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
img
vendor
.gitignore
Dockerfile
Gopkg.lock
Gopkg.toml
LICENSE
LoadBalancer
README.md
config.go
config.yml
logger.go
main.go
observer.go
proxy.go
rpc.go

README.md

OnGrid Systems Blockchain Applications DApps Development

GitHub last commit Ethereum grant status License

Blockchain Load Balancer

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)

Install

With docker

docker build . -t loadbalancer

Without docker

go get -u github.com/golang/dep/cmd/dep
dep ensure
go build

Configure

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

Run

With docker

docker run -v config.yml:/config.yml loadbalancer

Without docker

LoadBalancer -c /path/to/config.yml

License

Each file included in this repository is licensed under the MIT license.