{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ledgermgmt\n\n## Variables\n\n```go\nvar ErrLedgerAlreadyOpened = errors.New(\"ledger already opened\")\n```\nErrLedgerAlreadyOpened is thrown by a CreateLedger call if a ledger with the given id is already opened\n\n```go\nvar ErrLedgerMgmtNotInitialized = errors.New(\"ledger mgmt should be initialized before using\")\n```\nErrLedgerMgmtNotInitialized is thrown when ledger mgmt is used before initializing this\n\n## Functions\n\n```go\nfunc CleanupTestEnv()\n```\nCleanupTestEnv closes the ledgermagmt and removes the store directory\n\n```go\nfunc Close()\n```\nClose closes all the opened ledgers and any resources held for ledger management\n\n```go\nfunc CreateLedger(genesisBlock *common.Block) (ledger.PeerLedger, error)\n```\nCreateLedger 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\n\n```go\nfunc GetLedgerIDs() ([]string, error)\n```\nGetLedgerIDs returns the ids of the ledgers created\n\n```go\nfunc Initialize(initializer *Initializer)\n```\nInitialize initializes ledgermgmt\n\n```go\nfunc InitializeExistingTestEnvWithInitializer(initializer *Initializer)\n```\nInitializeExistingTestEnvWithInitializer initializes ledgermgmt for tests with existing ledgers This function does not remove the existing ledgers and is used in upgrade tests TODO ledgermgmt should be reworked to move the package scoped functions to a struct\n\n```go\nfunc InitializeTestEnv()\n```\nInitializeTestEnv initializes ledgermgmt for tests\n\n```go\nfunc InitializeTestEnvWithInitializer(initializer *Initializer)\n```\nInitializeTestEnvWithInitializer initializes ledgermgmt for tests with the supplied Initializer\n\n```go\nfunc OpenLedger(id string) (ledger.PeerLedger, error)\n```\nOpenLedger returns a ledger for the given id\n\n## Types\n\n```go\ntype Initializer struct {\n\tCustomTxProcessors            customtx.Processors\n\tPlatformRegistry              *platforms.Registry\n\tDeployedChaincodeInfoProvider ledger.DeployedChaincodeInfoProvider\n\tMembershipInfoProvider        ledger.MembershipInfoProvider\n\tMetricsProvider               metrics.Provider\n\tHealthCheckRegistry           ledger.HealthCheckRegistry\n}\n```\nInitializer encapsulates all the external dependencies for the ledger module\n\n","path":"github.com/eric-erki/https-hyperledger.org/core/ledger/ledgermgmt","name":"ledgermgmt","synopsis":"","isRedistributable":true}
