kvledger

package
v0.0.0-...-c74ab33 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrLedgerIDExists is thrown by a CreateLedger call if a ledger with the given id already exists
	ErrLedgerIDExists = errors.New("LedgerID already exists")
	// ErrNonExistingLedgerID is thrown by an OpenLedger call if a ledger with the given id does not exist
	ErrNonExistingLedgerID = errors.New("LedgerID does not exist")
	// ErrLedgerNotOpened is thrown by a CloseLedger call if a ledger with the given id has not been opened
	ErrLedgerNotOpened = errors.New("ledger is not opened yet")
	// ErrInactiveLedger is thrown by an OpenLedger call if a ledger with the given id is not active
	ErrInactiveLedger = errors.New("Ledger is not active")
)

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements interface ledger.PeerLedgerProvider

func NewProvider

func NewProvider(initializer *ledger.Initializer) (pr *Provider, e error)

NewProvider instantiates a new Provider. This is not thread-safe and assumed to be synchronized by the caller

func (*Provider) Close

func (p *Provider) Close()

Close implements the corresponding method from interface ledger.PeerLedgerProvider

func (*Provider) Create

func (p *Provider) Create(genesisBlock *common.Block) (ledger.PeerLedger, error)

Create implements the corresponding method from interface ledger.PeerLedgerProvider This functions sets a under construction flag before doing any thing related to ledger creation and upon a successful ledger creation with the committed genesis block, removes the flag and add entry into created ledgers list (atomically). If a crash happens in between, the 'recoverUnderConstructionLedger' function is invoked before declaring the provider to be usable

func (*Provider) Exists

func (p *Provider) Exists(ledgerID string) (bool, error)

Exists implements the corresponding method from interface ledger.PeerLedgerProvider

func (*Provider) List

func (p *Provider) List() ([]string, error)

List implements the corresponding method from interface ledger.PeerLedgerProvider

func (*Provider) Open

func (p *Provider) Open(ledgerID string) (ledger.PeerLedger, error)

Open implements the corresponding method from interface ledger.PeerLedgerProvider

Directories

Path Synopsis
txmgmt

Jump to

Keyboard shortcuts

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