4

While setting up Cardano Stake Pool, we need to have at least 2 nodes: one for Relay, another for Block Producing (BP).

This Relay node downloads the whole blockchain, and the BP Node will connect only to Relay node and it will sync the blockchain from the Relay node.

My question is, since both of these nodes are in same network, I feel like it's duplicate information downloaded twice. Is there any way by which we can share the same blockchain database for both of these nodes?

4

This is not possible, as both nodes are two different blockchain nodes and might have different views of the network in forks as in transactions in the mempool.

8
  • 1
    This does not answer the question asked. May 1 at 15:03
  • Can you please elaborate? The answer is that it is not possible and then I expand on why it is not possible. May 1 at 17:17
  • You have answered as if the question was asked about two nodes. The question relates to a node and a BP. The BP only ever sees it's own nodes, so saying that they have may have different views of the blockchain is incorrect, as the BP will have the view provided by the node. May 2 at 9:42
  • I disagree, it is not incorrect. It is possible and actually happens quite often, that the block producer is on a different fork than a specific relay, because in fact, they are two different blockchain nodes. In a multi relay setup, you often have differently forked chains coming from one relay (and not others) to the block producer and it takes time until these are resolved. Please note, by "view" I do not mean what the node sees as in network topology, but what the node sees as the blockchain (series of blocks and transactions inside these blocks) May 2 at 11:21
  • You have misunderstood the question. The question relates to a node and it's BP. May 3 at 12:08
3

You can't share the underlying data folder so will need a copy for each node. However, you can pre-seed them by syncing one, then duplicating its db folder into the others, so that when they start up they do not need to re-sync and validate the entire chain.

If you can get a copy of the db folder form a trusted source, you could potentially speed up the very first sync too (since downloading a compressed version of that will be much faster than syncing and validating the whole chain).

1
  • 2
    This answer is correct. Furthermore, first sync the node to the network, then stop the node and copy the db to the BP, before starting the BP. As in your (and most cases), the BP is on the same network as one node, and the BP only ever gets data from it's own nodes, the transfer of data from the node to the BP during normal operation is local, and therefore quick, and possibly free, depending on where it's hosted. May 1 at 15:08
2

It's impossible to share the same state directory. But if your concern is primarily disk space, you can use filesystem deduplication. For example I have a dedicated zfs volume with dedup setup I use to limit disk usage for multiple nodes ran on same machine for test networks. I wouldn't recommend doing this on mainnet though as running a bunch of nodes on the same host defeats the purpose.

1
  • Thanks for the info.
    – vs4vijay
    Apr 30 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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