ledgermgmt

package
v1.4.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLedgerAlreadyOpened = errors.New("ledger already opened")

ErrLedgerAlreadyOpened is thrown by a CreateLedger call if a ledger with the given id is already opened

View Source
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 added in v1.0.0

func CleanupTestEnv()

CleanupTestEnv closes the ledgermagmt and removes the store directory

func Close added in v1.0.0

func Close()

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

func CreateLedger added in v1.0.0

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 added in v1.0.0

func GetLedgerIDs() ([]string, error)

GetLedgerIDs returns the ids of the ledgers created

func Initialize added in v1.0.0

func Initialize(initializer *Initializer)

Initialize initializes ledgermgmt

func InitializeExistingTestEnvWithInitializer added in v1.4.0

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 added in v1.0.0

func InitializeTestEnv()

InitializeTestEnv initializes ledgermgmt for tests

func InitializeTestEnvWithInitializer added in v1.4.0

func InitializeTestEnvWithInitializer(initializer *Initializer)

InitializeTestEnvWithInitializer initializes ledgermgmt for tests with the supplied Initializer

func OpenLedger added in v1.0.0

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

OpenLedger returns a ledger for the given id

Types

type Initializer

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL