kvledger

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: Apache-2.0 Imports: 57 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockStorePath

func BlockStorePath(rootFSPath string) string

BlockStorePath returns the absolute path of block storage

func BookkeeperDBPath

func BookkeeperDBPath(rootFSPath string) string

BookkeeperDBPath return the absolute path of bookkeeper DB

func ClearPreResetHeight

func ClearPreResetHeight(rootFSPath string, ledgerIDs []string) error

ClearPreResetHeight removes the prereset height recorded in the file system for the specified ledgers.

func CompletedSnapshotsPath

func CompletedSnapshotsPath(snapshotRootDir string) string

CompletedSnapshotsPath returns the absolute path that is used for persisting the snapshots

func ConfigHistoryDBPath

func ConfigHistoryDBPath(rootFSPath string) string

ConfigHistoryDBPath returns the absolute path of configHistory DB

func HistoryDBPath

func HistoryDBPath(rootFSPath string) string

HistoryDBPath returns the absolute path of history DB

func LedgerProviderPath

func LedgerProviderPath(rootFSPath string) string

LedgerProviderPath returns the absolute path of ledgerprovider

func LoadPreResetHeight

func LoadPreResetHeight(rootFSPath string, ledgerIDs []string) (map[string]uint64, error)

LoadPreResetHeight returns the prereset height for the specified ledgers.

func PauseChannel

func PauseChannel(rootFSPath, ledgerID string) error

PauseChannel updates the channel status to inactive in ledgerProviders.

func PvtDataStorePath

func PvtDataStorePath(rootFSPath string) string

PvtDataStorePath returns the absolute path of pvtdata storage

func RebuildDBs

func RebuildDBs(config *ledger.Config) error

RebuildDBs drops existing ledger databases. Dropped database will be rebuilt upon server restart

func ResetAllKVLedgers

func ResetAllKVLedgers(rootFSPath string) error

ResetAllKVLedgers resets all ledger to the genesis block.

func ResumeChannel

func ResumeChannel(rootFSPath, ledgerID string) error

ResumeChannel updates the channel status to active in ledgerProviders

func RollbackKVLedger

func RollbackKVLedger(rootFSPath, ledgerID string, blockNum uint64) error

RollbackKVLedger rollbacks a ledger to a specified block number

func SnapshotDirForLedgerBlockNum

func SnapshotDirForLedgerBlockNum(snapshotRootDir, ledgerID string, blockNumber uint64) string

SnapshotDirForLedgerBlockNum returns the absolute path for a particular snapshot for a ledger

func SnapshotsDirForLedger

func SnapshotsDirForLedger(snapshotRootDir, ledgerID string) string

SnapshotsDirForLedger returns the absolute path of the dir for the snapshots for a specified ledger

func SnapshotsTempDirPath

func SnapshotsTempDirPath(snapshotRootDir string) string

SnapshotsTempDirPath returns the dir path that is used temporarily during the genration or import of the snapshots for a ledger

func StateDBPath

func StateDBPath(rootFSPath string) string

StateDBPath returns the absolute path of state level DB

func UpgradeDBs

func UpgradeDBs(config *ledger.Config) error

UpgradeDBs upgrades existing ledger databases to the latest formats. It checks the format of idStore and does not drop any databases if the format is already the latest version. Otherwise, it drops ledger databases and upgrades the idStore format.

func UpgradeIDStoreFormat

func UpgradeIDStoreFormat(t *testing.T, rootFSPath string)

UpgradeIDStoreFormat updates ledger idStore to current format

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) CreateFromGenesisBlock

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

CreateFromGenesisBlock implements the corresponding method from interface ledger.PeerLedgerProvider This function creates a new ledger and commits the genesis block. If a failure happens during this process, the partially created ledger is deleted

func (*Provider) CreateFromSnapshot

func (p *Provider) CreateFromSnapshot(snapshotDir string) (ledger.PeerLedger, string, error)

CreateFromSnapshot implements the corresponding method from interface ledger.PeerLedgerProvider This function creates a new ledger from the supplied snapshot. If a failure happens during this process, the partially created ledger is deleted

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
benchmark
Code generated by counterfeiter.
Code generated by counterfeiter.
fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
txmgmt
privacyenabledstate/mock
Code generated by counterfeiter.
Code generated by counterfeiter.
queryutil/mock
Code generated by counterfeiter.
Code generated by counterfeiter.
statedb/mock
Code generated by counterfeiter.
Code generated by counterfeiter.
validation/mock
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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