Reputation: 263
If I understand correctly the orderer stores the transactions from the channels it belongs to. The problem that I see is that when there are many transactions per channel this may get a bit big, and to have N orderers storing all the records is expensive. Is there a way of making an orderer just to have the transactions, for example, of 1 year?
Can it be done with the peers too?
I have read in the documentation about the checkpoints, but I do not fully understand and I don't see anywhere how to implement it
Upvotes: 0
Views: 149
Reputation: 1624
Currently, there is no way to 'prune' or 'checkpoint' orderer ledgers.
Being able to delete ledger data after some period of time is a useful idea, and one that has been considered since Fabric's creation. However, because the peers build their state database by applying all transactions in the blockchain, if a new peer wished to join after the orderer deleted these blocks, it would be missing these early transactions and be unable to recreate the world state.
So as a first step to this problem, there is currently an RFC to allow creating snapshots of the peer statedb. Once this, or something like it is implemented, peers will be able to join a channel without pulling and apply all historical transactions. And, once a peer can join from a later config block, it should be relatively simple to prune the orderer's copy of blockchain.
In summary, this will very likely be possible at some point in the future, there is active work ongoing to support it, but it is not here yet.
Upvotes: 1