We have built our own failover proxy, specifically catered to Chainlink nodes, that can handle connections between multiple ETH nodes. Now how does it work? The basics are very similar to a traditional load balancer; it connects you to a healthy target (as long as there's one available). Since we're using it specifically for communication between a Chainlink node and an ETH node, we have made it a bit “smarter”. It knows how long it's been since we last received a block header, and will switch the connection over if it's been abnormally long. And just to be sure we didn't miss out on any blocks, it will force the Chainlink node to reconnect and do a backfill.

How to use

Setup is super simple, and we made a Docker image so you just need to pull the image. In order to make sure the documentation is always up-to-date, you can find the exact steps in the Github repository. You can run it on the same instance as your Chainlink node, so you don't necessarily have any additional costs using this proxy.

To connect it to multiple nodes, you just define your endpoints as arguments when you run it:

$ docker run fiews/cl-eth-failover ws://localhost:8546/ wss://cl-ropsten.fiews.io/v1/myApiKey

Adding endpoint wss://cl-ropsten.fiews.io/v1/myApiKey to list

Adding endpoint ws://localhost:8546/ to list

Server is listening on port :4000

Now, just point your Chainlink node to ws://localhost:4000/ (or your Docker container's IP address: docker inspect -f ‘{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ CONTAINER_ID). And as soon as one of the endpoints goes down, it will switch you over!

Accepted incoming connection

Connected to endpoint ws://localhost:8546/

Lost connection to endpoint ws://localhost:8546/!

Disconnecting...

Accepted incoming connection

Connected to endpoint wss://cl-ropsten.fiews.io/v1/myApiKey

See how simple that was? You don't even have to point it to your own node, let's use the Fiews EaaS and Infura:

$ docker run fiews/cl-eth-failover wss://cl-ropsten.fiews.io/v1/myApiKey wss://ropsten.infura.io/ws/v3/myProject

Adding endpoint wss://cl-ropsten.fiews.io/v1/myApiKey to list

Adding endpoint wss://ropsten.infura.io/ws/v3/myProject to list

Server is listening on port :4000

The possibilities are endless, and more importantly; you no longer have a single point of failure!

While this tool was built by us, specifically for our EaaS customers, we welcome everyone to use this tool. Nothing is more important than making sure we have a healthy ecosystem of independent node operators with reliable ETH connectivity.

Though, if you are interested in our EaaS offering, head over to our website to learn more! Fiews.io