<p>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.</p>

CC BY-SA 4.0
2021-04-30T06:03:30.383Z
Thanks for the info.
vs4vijay
CC BY-SA 4.0
2021-04-30T02:46:03.170Z
2021-04-30T02:46:03.170Z
Samuel Leathers
<p>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.</p>

CC BY-SA 4.0
2021-05-01T15:03:54.213Z
This does not answer the question asked.
Cobra66 - TLP
CC BY-SA 4.0
2021-05-01T17:17:26.840Z
Can you please elaborate? The answer is that it is not possible and then I expand on why it is not possible.
Marek Mahut - StakeNuts
CC BY-SA 4.0
2021-05-02T09:42:51.267Z
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.
Cobra66 - TLP
CC BY-SA 4.0
2021-05-02T11:21:07.907Z
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)
Marek Mahut - StakeNuts
CC BY-SA 4.0
2021-05-03T12:08:27.040Z
You have misunderstood the question. The question relates to a node and it's BP.
Cobra66 - TLP
CC BY-SA 4.0
2021-05-03T15:21:01.423Z
Can you please elaborate on your comment to point out the misunderstanding? The question is about a staking pool (block producer) and its relay. Both which are block chain nodes.
Marek Mahut - StakeNuts
CC BY-SA 4.0
2021-05-05T07:15:03.200Z
You stated "... as both nodes are two different blockchain nodes and might have different views of the network ...".
This is incorrect. Why? The BP is only ever connected to it's relays and nothing else, ever. When you have one relay, the BP view of the network is the view of it's relay.
Cobra66 - TLP
CC BY-SA 4.0
2021-05-05T21:32:52.210Z
When a new block reaches a relay and within a very short period of time another for the same slot, the relay might be on a fork for a short time that is never seen by the BP ever. This happens often.
Marek Mahut - StakeNuts
CC BY-SA 4.0
2021-04-27T19:46:15.793Z
2021-04-27T19:46:15.793Z
Marek Mahut - StakeNuts
<p>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 <code>db</code> folder into the others, so that when they start up they do not need to re-sync and validate the entire chain.</p>
<p>If you can get a copy of the <code>db</code> 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).</p>

CC BY-SA 4.0
2021-05-01T15:08:24.253Z
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.
Cobra66 - TLP
CC BY-SA 4.0
2021-05-01T11:27:52.080Z
2021-05-01T11:27:52.080Z
Danny Tuppeny - CODER
<p>While setting up Cardano Stake Pool, we need to have at least 2 nodes: one for Relay, another for Block Producing (BP).</p>
<p>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.</p>
<p>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?</p>

<staking><pool><blockchain><operator>
Is it possible to reuse the blockchain for both relay and block producing nodes?
# Is it possible to reuse the blockchain for both relay and block producing nodes?

(Asked by: username_0 on 2021-04-27)

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?

**Tags:** staking, pool, blockchain, operator

---

## 3 answers

### Answer by username_4 on 2021-05-01. Score: 5

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).

> **Comments:**
> **username_3**: 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.  

---

### Answer by username_2 on 2021-04-27. Score: 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.

> **Comments:**
> **username_3**: This does not answer the question asked.  
> **username_2**: Can you please elaborate? The answer is that it is not possible and then I expand on why it is not possible.  
> **username_3**: 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.  
> **username_2**: 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)  
> **username_3**: You have misunderstood the question. The question relates to a node and it's BP.  
> **username_2**: Can you please elaborate on your comment to point out the misunderstanding? The question is about a staking pool (block producer) and its relay. Both which are block chain nodes.  
> **username_3**: You stated "... as both nodes are two different blockchain nodes and might have different views of the network ...". This is incorrect. Why? The BP is only ever connected to it's relays and nothing else, ever. When you have one relay, the BP view of the network is the view of it's relay.  
> **username_2**: When a new block reaches a relay and within a very short period of time another for the same slot, the relay might be on a fork for a short time that is never seen by the BP ever. This happens often.  

---

### Answer by username_1 on 2021-04-30. Score: 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.

> **Comments:**
> **username_0**: Thanks for the info.  

---

