Documentation ¶
Index ¶
- Variables
- func CleanupTestEnv()
- func Close()
- func CreateLedger(genesisBlock *common.Block) (ledger.PeerLedger, error)
- func GetLedgerIDs() ([]string, error)
- func Initialize(customTxProcessors customtx.Processors)
- func InitializeTestEnv()
- func InitializeTestEnvWithCustomProcessors(customTxProcessors customtx.Processors)
- func OpenLedger(id string) (ledger.PeerLedger, error)
Constants ¶
This section is empty.
Variables ¶
var ErrLedgerAlreadyOpened = errors.New("Ledger already opened")
ErrLedgerAlreadyOpened is thrown by a CreateLedger call if a ledger with the given id is already opened
var ErrLedgerMgmtNotInitialized = errors.New("ledger mgmt should be initialized before using")
ErrLedgerMgmtNotInitialized is thrown when ledger mgmt is used before initializing this
Functions ¶
func CleanupTestEnv ¶
func CleanupTestEnv()
CleanupTestEnv closes the ledgermagmt and removes the store directory
func Close ¶
func Close()
Close closes all the opened ledgers and any resources held for ledger management
func CreateLedger ¶
func CreateLedger(genesisBlock *common.Block) (ledger.PeerLedger, error)
CreateLedger creates a new ledger with the given genesis block. This function guarantees that the creation of ledger and committing the genesis block would an atomic action The chain id retrieved from the genesis block is treated as a ledger id
func GetLedgerIDs ¶
GetLedgerIDs returns the ids of the ledgers created
func Initialize ¶
func Initialize(customTxProcessors customtx.Processors)
Initialize initializes ledgermgmt
func InitializeTestEnv ¶
func InitializeTestEnv()
InitializeTestEnv initializes ledgermgmt for tests
func InitializeTestEnvWithCustomProcessors ¶ added in v1.1.1
func InitializeTestEnvWithCustomProcessors(customTxProcessors customtx.Processors)
InitializeTestEnvWithCustomProcessors initializes ledgermgmt for tests with the supplied custom tx processors
func OpenLedger ¶
func OpenLedger(id string) (ledger.PeerLedger, error)
OpenLedger returns a ledger for the given id
Types ¶
This section is empty.