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:
- Use a fast and reliable network connection between the two nodes.
- Use SSDs or NVMe storage for the two nodes.
- Configure the two nodes to use the same amount of memory.
- Configure the two nodes to use the same number of CPU cores.
- Monitor the performance of the two nodes and make adjustments as needed.