Sync'ing genesis block and backing up blockchain data

+1 vote
Here's a break up of the question:

Set Up 1. Consider a brand new set up where in we start a set up of blockchain architecture consisting of n nodes and say after running this process for a month, the data is to be backed up. If I understand correctly, we could leverage --datadir option during the initialization of the blockchain server to back up the data on a continual basis. Is this a correct interpretation? Could you please correct if I may have gone wrong in understanding the usage of datadir? Else, is there any other way to back up block chain data and when done so, how is it stored?

Set Up 2. Now, say we stop the current blockchain, back up the data and start a completely new architectural set up wherein we have m nodes, where these nodes may or may not necessarily be the same as in the above situation. When the new blocks are created, presumably a new genesis block is created. Is it possible to sync the new genesis block such that the merkle tree consists of the transactions and associated trail in Set Up 1? What I am trying to achieve is a way to collapse all blockchain information in set up 1 into one block and use it as a precedent for a new genesis block.

Could you please suggest?
asked Jan 19, 2016 by skarred14

1 Answer

0 votes

Regarding 1: You can back up the blockchain directory (which by default is in ~/.multichain/[chain-name]/ if no datadir is specified) at any time, though it's recommended to temporarily stop the node first by issuing the stop command.

Regarding 2: It's not possible to collapse the state of one blockchain into the genesis block of another one - the blockchain's full state is determined by all the content in the chain.

answered Jan 20, 2016 by MultiChain
1. Got it. To assign a directory to a running node, I could use the multichaind <chain-name> -daemon command either during initialization or during the functioning process after issuing the stop command

2. Understood. Related question: If there are two nodes running separate private blockchains, it would mean that there are separate genesis blocks. In this case, how do both nodes stay in sync in terms of catching up to either block height?
1. Yes, but with the -datadir option if it's not the default location.

2. If you have two separate blockchains, there's no meaningful sense in which those two blockchains can catch up with each other - they are completely separate worlds. But it's possible to have multiple nodes/blockchains running on a single server, i.e. each could connect to the chain started by the other.
...