2

I plan to run 2 RPC nodes (1.13 + 1.14) on an Epyc server with adequate NVMe. What's the recommended way of linking the nodes together or maybe to force to connect to eachother, so I can get at least part of the data not from the network but from the other node hosted locally?

I want the connection to always be re-activated even when single node crashes and gets re-started later.

Additionally it'd be great if the initial snapshot could be obtained from the locally run node (when starting the second one it's just getting the data from remote source while the already running local node should probably have all needed to bootstrap).

1 Answer 1

1

Here is a recommended way to link two RPC nodes (1.13 + 1.14) on an Epyc server with adequate NVMe so that you can get at least part of the data not from the network but from the other node hosted locally, and the connection is always re-activated even when a single node crashes and gets re-started later, and the initial snapshot can be obtained from the locally run node:

Configure the two nodes to connect to each other.

In the geth configuration file for each node, add the following lines:

[bootnodes]
add = "enode://<enode_url_of_other_node>"
* Replace `<enode_url_of_other_node>` with the enode URL of the other node. You can find the enode URL by running the following command on each node:
geth attach ipc:<datadir>/geth.ipc --exec "admin.nodeInfo.enode"

Start the two nodes.

Configure the second node to get its initial snapshot from the locally run node.

In the geth configuration file for the second node, add the following lines:

[sync]
fullhistory = true
  • Start the second node again. Once the second node has finished syncing its initial snapshot from the locally run node, the two nodes will be connected to each other and will be able to share data.

To ensure that the connection is always re-activated even when a single node crashes and gets re-started later, you can use a service like Consul to manage the connection between the two nodes. Consul is a service discovery and configuration management system that can help to ensure that your applications are always able to connect to the services they need.

To use Consul to manage the connection between the two nodes, you would need to:

Install Consul on both nodes. Register the two nodes with Consul. Configure the two nodes to use Consul to discover each other. Once you have configured Consul to manage the connection between the two nodes, Consul will automatically re-activate the connection when a single node crashes and gets re-started later.

To get the most out of this setup, you should also consider using a load balancer to distribute traffic between the two nodes. This will help to improve the performance and reliability of your RPC nodes.

Here are some additional tips for optimizing your setup:

  1. Use a fast and reliable network connection between the two nodes.
  2. Use SSDs or NVMe storage for the two nodes.
  3. Configure the two nodes to use the same amount of memory.
  4. Configure the two nodes to use the same number of CPU cores.
  5. Monitor the performance of the two nodes and make adjustments as needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.