block

package
v0.0.0-...-a22436f Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetActionFromEnvelopeMsg

func GetActionFromEnvelopeMsg(env *common.Envelope) (*peer.ChaincodeAction, error)

func GetChannelIDFromBlock

func GetChannelIDFromBlock(block *common.Block) (string, error)

GetChannelIDFromBlock returns channel ID in the block

func GetEnvelopeFromBlock

func GetEnvelopeFromBlock(data []byte) (*common.Envelope, error)

func GetPayloads

GetPayloads gets the underlying payload objects in a TransactionAction

func UnmarshalChaincodeAction

func UnmarshalChaincodeAction(caBytes []byte) (*peer.ChaincodeAction, error)

func UnmarshalChaincodeActionPayload

func UnmarshalChaincodeActionPayload(capBytes []byte) (*peer.ChaincodeActionPayload, error)

func UnmarshalChaincodeEvents

func UnmarshalChaincodeEvents(eBytes []byte) (*peer.ChaincodeEvent, error)

func UnmarshalChannelHeader

func UnmarshalChannelHeader(bytes []byte) (*common.ChannelHeader, error)

func UnmarshalPayload

func UnmarshalPayload(encoded []byte) (*common.Payload, error)

func UnmarshalProposalResponsePayload

func UnmarshalProposalResponsePayload(prpBytes []byte) (*peer.ProposalResponsePayload, error)

func UnmarshalTransaction

func UnmarshalTransaction(txBytes []byte) (*peer.Transaction, error)

Types

type Block

type Block struct {
	Number       int
	DataHash     string
	Transactions []*Transaction
	CreatedAt    *time.Time
}

func GetBlock

func GetBlock(ledgerClient *ledger.Client, blockNumber int) (*Block, error)

func GetBlockByTXID

func GetBlockByTXID(ledgerClient *ledger.Client, txID string) (*Block, error)

type Transaction

type Transaction struct {
	ID          string
	Type        TxType
	ChannelID   string
	CreatedAt   time.Time
	ChaincodeID string
	Version     string
	Path        string
	Response    []byte
	Request     []byte
	Event       TransactionEvent
	Writes      []*TransactionWrite
	Reads       []*TransactionRead
}

type TransactionEvent

type TransactionEvent struct {
	Name  string
	Value string
}

type TransactionRead

type TransactionRead struct {
	ChaincodeID     string
	Key             string
	BlockNumVersion int
	TxNumVersion    int
}

type TransactionWrite

type TransactionWrite struct {
	ChaincodeID string
	Deleted     bool
	Key         string
	Value       string
}

type TxType

type TxType string
const (
	MESSAGE              TxType = "MESSAGE"
	CONFIG               TxType = "CONFIG"
	CONFIG_UPDATE        TxType = "CONFIG_UPDATE"
	ENDORSER_TRANSACTION TxType = "ENDORSER_TRANSACTION"
	ORDERER_TRANSACTION  TxType = "ORDERER_TRANSACTION"
	DELIVER_SEEK_INFO    TxType = "DELIVER_SEEK_INFO"
	CHAINCODE_PACKAGE    TxType = "CHAINCODE_PACKAGE"
)

Jump to

Keyboard shortcuts

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