fmprotocol

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: 14 Imported by: 0

Documentation

Overview

Copyright Xilinx Inc. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const ANNOTATION_DATA_TYPE_BLOCKHEADER byte = 0x10

annotations for block header message

View Source
const ANNOTATION_DATA_TYPE_BLOCKMETADATA byte = 0x12
View Source
const ANNOTATION_DATA_TYPE_BLOCK_ID byte = 0x13
View Source
const ANNOTATION_DATA_TYPE_CACHE_CA byte = 0x03
View Source
const ANNOTATION_DATA_TYPE_CACHE_DATA byte = 0x01

annotations for cache update message

View Source
const ANNOTATION_DATA_TYPE_CACHE_NAME byte = 0x02
View Source
const ANNOTATION_DATA_TYPE_CHAINCODE_NAME byte = 0x23
View Source
const ANNOTATION_DATA_TYPE_CHANNEL_NAME byte = 0x21
View Source
const ANNOTATION_DATA_TYPE_CONTRACT_INPUT byte = 0x28
View Source
const ANNOTATION_DATA_TYPE_CONTRACT_NAME byte = 0x27
View Source
const ANNOTATION_DATA_TYPE_CREATER_CA byte = 0x24
View Source
const ANNOTATION_DATA_TYPE_ENDORSER byte = 0x2b
View Source
const ANNOTATION_DATA_TYPE_ENDORSER_ACTION byte = 0x29
View Source
const ANNOTATION_DATA_TYPE_ENDORSER_CA byte = 0x2c
View Source
const ANNOTATION_DATA_TYPE_ENDORSER_SIG byte = 0x2d
View Source
const ANNOTATION_DATA_TYPE_MASK byte = 0x7F
View Source
const ANNOTATION_DATA_TYPE_ORDERER_CA byte = 0x40

annotations for block metata

View Source
const ANNOTATION_DATA_TYPE_ORDERER_SIG byte = 0x41
View Source
const ANNOTATION_DATA_TYPE_RW_SET byte = 0x2a
View Source
const ANNOTATION_DATA_TYPE_TRANSACTION byte = 0x11
View Source
const ANNOTATION_DATA_TYPE_TX_ACTION byte = 0x25
View Source
const ANNOTATION_DATA_TYPE_TX_CA byte = 0x26
View Source
const ANNOTATION_DATA_TYPE_TX_ID byte = 0x22
View Source
const ANNOTATION_DATA_TYPE_TX_SIG byte = 0x2e
View Source
const ANNOTATION_DATA_TYPE_TX_START byte = 0x20

annotations for transaction

View Source
const ANNOTATION_TYPE_LOCATOR byte = 0x80
View Source
const ANNOTATION_TYPE_MASK byte = 0x80

annotation mask

View Source
const ANNOTATION_TYPE_POINTER byte = 0x00

annotation type

View Source
const MAX_ENDORSER_NUM int = 8

Variables

View Source
var BcmSessionMap map[string]BcmSession

BcmSessionMap records IP to blockchain machine protocol session relation

View Source
var BlockHeaderAnnotationNumber int = len(blockHeaderAnnotationInfoList)
View Source
var BlockMetadataAnnotationNumber int = len(blockMetadataAnnotationInfoList)
View Source
var BlockTransactionAnnotationNumber int = len(blockTransactionAnnotationInfoList) - 1 + MAX_ENDORSER_NUM
View Source
var CacheUpdateAnnotationNumber int = len(blockCacheUpdateAnnotationInfoList)
View Source
var CertificateCache map[string]CertificateInfo
View Source
var CertificateIdCache map[int]CertificateInfo

Functions

func CheckMessageData

func CheckMessageData(block *cb.Block) (ret bool)

CheckMessageData checks block message format, return false if the block is not supported

func CheckPeerStructure

func CheckPeerStructure(addr string) (ret bool)

CheckPeerStructure checks if peer is a hardware based peer

func ExtractEnvelope

func ExtractEnvelope(block *cb.Block, index int) (*cb.Envelope, error)

ExtractEnvelope retrieves the requested envelope from a given block and unmarshals it hyperledger/fabric@v2.0/protoutil/commonutils.go

func GetEnvelopeFromBlock

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

GetEnvelopeFromBlock gets an envelope from a block's Data field. hyperledger/fabric@v2.0/protoutil/txutils.go

func IsConfigBlock

func IsConfigBlock(block *cb.Block) bool

IsConfigBlock validates whenever given block contains configuration update transaction hyperledger/fabric@v2.0/protoutil/commonutils.go

func SendBlock

func SendBlock(addr string, block *cb.Block)

SendBlock sends a block to target hardware peer via blockchain machine protocol

func SendBlockHeader

func SendBlockHeader(addr string, data []byte, pos int, length int, transactionLen []int)

SendBlockHeader prepares packet data based on block header and transaction information then send to target addres

func SendBlockMeta

func SendBlockMeta(addr string, data []byte, pos int, length int)

SendBlockMeta prepares packet data based on block metadata and send to target addres

func SendToHardware

func SendToHardware(ctx context.Context, block *cb.Block)

SendToHardware broadcasts a raw block message to hardware based peers

func SendTransaction

func SendTransaction(addr string, data []byte, pos int, length int)

SendTransaction prepares packet data based on transaction and send to target addres

func UnmarshalChaincodeHeaderExtension

func UnmarshalChaincodeHeaderExtension(hdrExtension []byte) (*peer.ChaincodeHeaderExtension, error)

UnmarshalChaincodeHeaderExtension unmarshals bytes to a ChaincodeHeaderExtension hyperledger/fabric@v2.0/protoutil/unmarshalers.go

func UnmarshalChaincodeID

func UnmarshalChaincodeID(bytes []byte) (*peer.ChaincodeID, error)

UnmarshalChaincodeID unmarshals bytes to a ChaincodeID hyperledger/fabric@v2.0/protoutil/unmarshalers.go

func UnmarshalChannelHeader

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

UnmarshalChannelHeader unmarshals bytes to a ChannelHeader hyperledger/fabric@v2.0/protoutil/unmarshalers.go

func UnmarshalPayload

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

UnmarshalPayload unmarshals bytes to a Payload hyperledger/fabric@v2.0/protoutil/unmarshalers.go

Types

type Annotation

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

type AnnotationInfo

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

type AnnotationLocator

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

type AnnotationPointer

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

type BcmSession

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

BcmSession keeps blockchain machine protocol session information

type BcmTransportHeader

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

type CertificateInfo

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

type HardwarePeer

type HardwarePeer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Keeps hardware peer related information.

type Organization

type Organization struct {
	Name  string
	Certs []struct {
		Role string
		Cert string
	}
}

Orgnization in config file

Jump to

Keyboard shortcuts

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