{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package transientstore\n\n## Variables\n\n```go\nvar ErrStoreEmpty = errors.New(\"Transient store is empty\")\n```\nErrStoreEmpty is used to indicate that there are no entries in transient store\n\n## Functions\n\n```go\nfunc GetTransientStorePath() string\n```\nGetTransientStorePath returns the filesystem path for temporarily storing the private rwset\n\n## Types\n\n```go\ntype EndorserPvtSimulationResults struct {\n\tReceivedAtBlockHeight uint64\n\tPvtSimulationResults  *rwset.TxPvtReadWriteSet\n}\n```\nEndorserPvtSimulationResults captures the details of the simulation results specific to an endorser TODO: Once the related gossip changes are made as per FAB-5096, remove this struct\n\n```go\ntype EndorserPvtSimulationResultsWithConfig struct {\n\tReceivedAtBlockHeight          uint64\n\tPvtSimulationResultsWithConfig *transientstore.TxPvtReadWriteSetWithConfigInfo\n}\n```\nEndorserPvtSimulationResultsWithConfig captures the details of the simulation results specific to an endorser\n\n```go\ntype RWSetScanner interface {\n\t// Next returns the next EndorserPvtSimulationResults from the RWSetScanner.\n\t// It may return nil, nil when it has no further data, and also may return an error\n\t// on failure\n\tNext() (*EndorserPvtSimulationResults, error)\n\t// NextWithConfig returns the next EndorserPvtSimulationResultsWithConfig from the RWSetScanner.\n\t// It may return nil, nil when it has no further data, and also may return an error\n\t// on failure\n\t// TODO: Once the related gossip changes are made as per FAB-5096, remove the above function\n\t// and rename the below function to Next form NextWithConfig.\n\tNextWithConfig() (*EndorserPvtSimulationResultsWithConfig, error)\n\t// Close frees the resources associated with this RWSetScanner\n\tClose()\n}\n```\nRWSetScanner provides an iterator for EndorserPvtSimulationResults\n\n```go\ntype RwsetScanner struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (scanner *RwsetScanner) Close()\n```\nClose releases resource held by the iterator\n\n```go\nfunc (scanner *RwsetScanner) Next() (*EndorserPvtSimulationResults, error)\n```\nNext moves the iterator to the next key/value pair. It returns whether the iterator is exhausted. TODO: Once the related gossip changes are made as per FAB-5096, remove this function\n\n```go\nfunc (scanner *RwsetScanner) NextWithConfig() (*EndorserPvtSimulationResultsWithConfig, error)\n```\nNext moves the iterator to the next key/value pair. It returns whether the iterator is exhausted. TODO: Once the related gossip changes are made as per FAB-5096, rename this function to Next\n\n```go\ntype Store interface {\n\t// Persist stores the private write set of a transaction in the transient store\n\t// based on txid and the block height the private data was received at\n\tPersist(txid string, blockHeight uint64, privateSimulationResults *rwset.TxPvtReadWriteSet) error\n\t// TODO: Once the related gossip changes are made as per FAB-5096, remove the above function\n\t// and rename the below function to Persist form PersistWithConfig.\n\t// PersistWithConfig stores the private write set of a transaction along with the collection config\n\t// in the transient store based on txid and the block height the private data was received at\n\tPersistWithConfig(txid string, blockHeight uint64, privateSimulationResultsWithConfig *transientstore.TxPvtReadWriteSetWithConfigInfo) error\n\t// GetTxPvtRWSetByTxid returns an iterator due to the fact that the txid may have multiple private\n\t// write sets persisted from different endorsers (via Gossip)\n\tGetTxPvtRWSetByTxid(txid string, filter ledger.PvtNsCollFilter) (RWSetScanner, error)\n\t// PurgeByTxids removes private write sets of a given set of transactions from the\n\t// transient store\n\tPurgeByTxids(txids []string) error\n\t// PurgeByHeight removes private write sets at block height lesser than\n\t// a given maxBlockNumToRetain. In other words, Purge only retains private write sets\n\t// that were persisted at block height of maxBlockNumToRetain or higher. Though the private\n\t// write sets stored in transient store is removed by coordinator using PurgebyTxids()\n\t// after successful block commit, PurgeByHeight() is still required to remove orphan entries (as\n\t// transaction that gets endorsed may not be submitted by the client for commit)\n\tPurgeByHeight(maxBlockNumToRetain uint64) error\n\t// GetMinTransientBlkHt returns the lowest block height remaining in transient store\n\tGetMinTransientBlkHt() (uint64, error)\n\tShutdown()\n}\n```\nStore manages the storage of private write sets for a ledgerId. Ideally, a ledger can remove the data from this storage when it is committed to the permanent storage or the pruning of some data items is enforced by the policy\n\n```go\ntype StoreEnv struct {\n\tTestStoreProvider StoreProvider\n\tTestStore         Store\n\t// contains filtered or unexported fields\n}\n```\nStoreEnv provides the  store env for testing\n\n```go\nfunc NewTestStoreEnv(t *testing.T) *StoreEnv\n```\nNewTestStoreEnv construct a StoreEnv for testing\n\n```go\nfunc (env *StoreEnv) Cleanup()\n```\nCleanup cleansup the  store env after testing\n\n```go\ntype StoreProvider interface {\n\tOpenStore(ledgerID string) (Store, error)\n\tClose()\n}\n```\nStoreProvider provides an instance of a TransientStore\n\n```go\nfunc NewStoreProvider() StoreProvider\n```\nNewStoreProvider instantiates TransientStoreProvider\n\n","path":"github.com/eric-erki/https-hyperledger.org/core/transientstore","name":"transientstore","synopsis":"","isRedistributable":true}
