ledger

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QuerySystemChaincode = "qscc"

	GetBlockByNumber   string = "GetBlockByNumber"
	GetTransactionByID string = "GetTransactionByID"
	GetBlockByTxID     string = "GetBlockByTxID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	*common.Block
	TransactionManager driver.TransactionManager
}

Block wraps a Fabric block

func (*Block) DataAt

func (b *Block) DataAt(i int) []byte

DataAt returns the data stored at the passed index

func (*Block) ProcessedTransaction

func (b *Block) ProcessedTransaction(i int) (driver.ProcessedTransaction, error)

ProcessedTransaction returns the ProcessedTransaction at passed index

type Ledger

type Ledger struct {
	ChannelName        string
	ChaincodeManager   driver.ChaincodeManager
	LocalMembership    driver.LocalMembership
	ConfigService      driver.ConfigService
	TransactionManager driver.TransactionManager
}

func New

func New(
	channelName string,
	chaincodeManager driver.ChaincodeManager,
	localMembership driver.LocalMembership,
	configService driver.ConfigService,
	transactionManager driver.TransactionManager,
) *Ledger

func (*Ledger) GetBlockByNumber

func (c *Ledger) GetBlockByNumber(number uint64) (driver.Block, error)

GetBlockByNumber fetches a block by number

func (*Ledger) GetBlockNumberByTxID

func (c *Ledger) GetBlockNumberByTxID(txID string) (uint64, error)

func (*Ledger) GetTransactionByID

func (c *Ledger) GetTransactionByID(txID string) (driver.ProcessedTransaction, error)

Jump to

Keyboard shortcuts

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