kvLedger provides an implementation of `ledger.PeerLedger`. This implementation provides a key-value based data model
| 49 | // kvLedger provides an implementation of `ledger.PeerLedger`. |
| 50 | // This implementation provides a key-value based data model |
| 51 | type kvLedger struct { |
| 52 | ledgerID string |
| 53 | bootSnapshotMetadata *SnapshotMetadata |
| 54 | blockStore *blkstorage.BlockStore |
| 55 | |
| 56 | pvtdataStoreLock sync.Mutex |
| 57 | pvtdataStore *pvtdatastorage.Store |
| 58 | |
| 59 | txmgr *txmgr.LockBasedTxMgr |
| 60 | historyDB *history.DB |
| 61 | configHistoryRetriever *collectionConfigHistoryRetriever |
| 62 | snapshotMgr *snapshotMgr |
| 63 | // this RWMutex provides atomicity to commit a block to the block-storage |
| 64 | // and to apply its effects on the state database |
| 65 | // |
| 66 | // for more details see https://github.com/hyperledger/fabric/pull/4694 |
| 67 | blockAPIsRWLock *sync.RWMutex |
| 68 | stats *ledgerStats |
| 69 | commitHash []byte |
| 70 | hashProvider ledger.HashProvider |
| 71 | config *ledger.Config |
| 72 | |
| 73 | // isPvtstoreAheadOfBlkstore is read during missing pvtData |
| 74 | // reconciliation and may be updated during a regular block commit. |
| 75 | // Hence, we use atomic value to ensure consistent read. |
| 76 | isPvtstoreAheadOfBlkstore atomic.Value |
| 77 | |
| 78 | commitNotifierLock sync.Mutex |
| 79 | commitNotifier *commitNotifier |
| 80 | } |
| 81 | |
| 82 | type lgrInitializer struct { |
| 83 | ledgerID string |
nothing calls this directly
no outgoing calls
no test coverage detected