fabric: github.com/hyperledger/fabric/core/ledger/ledgermgmt Index | Files

package ledgermgmt

import "github.com/hyperledger/fabric/core/ledger/ledgermgmt"

Index

Package Files

ledger_mgmt.go ledger_mgmt_test_exports.go

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

func CleanupTestEnv Uses

func CleanupTestEnv()

CleanupTestEnv closes the ledgermagmt and removes the store directory

func Close Uses

func Close()

Close closes all the opened ledgers and any resources held for ledger management

func CreateLedger Uses

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 Uses

func GetLedgerIDs() ([]string, error)

GetLedgerIDs returns the ids of the ledgers created

func Initialize Uses

func Initialize(initializer *Initializer)

Initialize initializes ledgermgmt

func InitializeExistingTestEnvWithInitializer Uses

func InitializeExistingTestEnvWithInitializer(initializer *Initializer)

InitializeExistingTestEnvWithInitializer 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

func InitializeTestEnv Uses

func InitializeTestEnv()

InitializeTestEnv initializes ledgermgmt for tests

func InitializeTestEnvWithInitializer Uses

func InitializeTestEnvWithInitializer(initializer *Initializer)

InitializeTestEnvWithInitializer initializes ledgermgmt for tests with the supplied Initializer

func OpenLedger Uses

func OpenLedger(id string) (ledger.PeerLedger, error)

OpenLedger returns a ledger for the given id

type Initializer Uses

type Initializer struct {
    CustomTxProcessors            customtx.Processors
    PlatformRegistry              *platforms.Registry
    DeployedChaincodeInfoProvider ledger.DeployedChaincodeInfoProvider
    MembershipInfoProvider        ledger.MembershipInfoProvider
    MetricsProvider               metrics.Provider
    HealthCheckRegistry           ledger.HealthCheckRegistry
}

Initializer encapsulates all the external dependencies for the ledger module

Package ledgermgmt imports 19 packages (graph) and is imported by 20 packages. Updated 2019-03-23. Refresh now. Tools for package owners.