Ethereum 2.0 — Multi Beacon Chain nodes client

Roman Behma
3 min readFeb 26, 2021

This article gonna be useful for guys who develop apps for Ethereum staking, i.e. validators, and for those who are interested in blockchain, and crypto.

There are the most popular Beacon Chain API providers for #Ethereum 2.0 like Prysm, Lighthouse, etc. but sometimes some of them work faster for some operations and vice versa. Also, there could be some cases when the node went down or stuck somewhy, and such a situation could be problematic because the validator gonna miss slots -> lose money which is not good for business!

One of the solutions could be setting up a load balancer and run multiple Beacon Chain nodes under the load balancer. Btw, don’t forget to add stickiness to the load balancer by some request header or other parameter because there could be some issues if the validator gets attestation data from node “A” but submits signed attestation to node “B”...

That would be nice if we can use kinda the same interface (API and transport) for all of the nodes so we can just pass addresses in the validator client’s config and choose the alive one. Also, it is important to get quick responses from the Beacon Chain node(s) because every small point affects the attestation effectiveness of the validator. Let’s assume that we have some mechanism that uses multiple different nodes and chooses the first and faster response from a node so the validator client knows there are multiple nodes and the response will come from the faster one.

For instance, we have 2 #Prysm nodes, 3 #Lighthouse nodes, and 1 #Teku node. Let’s assume we need to get attestation data to sign and then submit. Firstly, sending a request to get attestation data — 1 Prysm node returned response first so we return that. Requests to other nodes are sent as well but they gonna be ignored because we already have a response from the first Prysm node. Then all of the logic is done and needs to submit signed attestation. The mechanism sent a request for this to all of the nodes and waits for the responses from all of the nodes, and the logic says all is good if there is at least one successful response.

Based on the thoughts above I decided to create such a service that provides a simple RPC and HTTP API and can use multiple Beacon Chain nodes. Only needed to pull and run the docker container with this service and pass addresses of all running and synced Beacon Chain nodes that could be used.

It is in development, but the core functionality works well.

GitHub repository: https://github.com/begmaroman/beaconspot

DockerHub: https://hub.docker.com/r/begmaroman/beaconspot

It is always allowed to participate in the development and suggests some improvements to this service. Hopefully, that article was useful!

--

--

Roman Behma

Designing decentralized future | Software architect | Blockchain expert | Entrepreneur | Building a more connected and equitable world through innovation