api

package
v0.0.0-...-bfcd41d Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockStore

type BlockStore interface {
	PeerLedgerExtension
	AddBlock(block *common.Block) error
	GetBlockchainInfo() (*common.BlockchainInfo, error)
	RetrieveBlocks(startNum uint64) (ledger.ResultsIterator, error)
	RetrieveBlockByHash(blockHash []byte) (*common.Block, error)
	RetrieveBlockByNumber(blockNum uint64) (*common.Block, error) // blockNum of  math.MaxUint64 will return last block
	RetrieveTxByID(txID string) (*common.Envelope, error)
	RetrieveTxByBlockNumTranNum(blockNum uint64, tranNum uint64) (*common.Envelope, error)
	RetrieveBlockByTxID(txID string) (*common.Block, error)
	RetrieveTxValidationCodeByTxID(txID string) (peer.TxValidationCode, error)
	ExportTxIds(dir string, newHashFunc snapshot.NewHashFunc) (map[string][]byte, error)
	Shutdown()
}

BlockStore - an interface for persisting and retrieving blocks An implementation of this interface is expected to take an argument of type `IndexConfig` which configures the block store on what items should be indexed

type BlockStoreProvider

type BlockStoreProvider interface {
	Open(ledgerid string) (BlockStore, error)
	Close()
}

BlockStoreProvider provides an handle to a BlockStore

type PeerLedgerExtension

type PeerLedgerExtension interface {
	// CheckpointBlock updates checkpoint info of underlying blockstore with given block
	// and invokes the given notifier before the checkpoint is broadcast
	CheckpointBlock(block *common.Block, notify func()) error
}

PeerLedgerExtension is an extension to PeerLedger interface which can be used to extend existing peer ledger features.

type SnapshotInfo

type SnapshotInfo struct {
	LedgerID          string
	LastBlockNum      uint64
	LastBlockHash     []byte
	PreviousBlockHash []byte
}

SnapshotInfo captures some of the details about the snapshot

Jump to

Keyboard shortcuts

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