messages

package
v0.9.20 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MsgTypeError - an error
	MsgTypeError = "Error"

	// MsgTypeDeployContract - deploy a contract (NOT USED YET)
	MsgTypeDeployContract = "DeployContract"
	// MsgTypeSendTransaction - send a transaction
	MsgTypeSendTransaction = "SendTransaction"

	MsgTypeTransactionSuccess = "TransactionSuccess"
	MsgTypeTransactionFailure = "TransactionFailure"
	MsgTypeQuerySuccess       = "QuerySuccess"
	// RecordHeaderAccessToken - record header name for passing JWT token over messaging
	RecordHeaderAccessToken = "fly-accesstoken"
)

Types of messages that fabconnect internally posts to the message queue (kafka) as well as those that it sends back to the client

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncSentMsg

type AsyncSentMsg struct {
	Sent    bool   `json:"sent"`
	Request string `json:"id"`
	Msg     string `json:"msg,omitempty"`
}

AsyncSentMsg is a standard response for async requests

type CommonHeaders

type CommonHeaders struct {
	ID            string                 `json:"id,omitempty"`
	MsgType       string                 `json:"type,omitempty"`
	Signer        string                 `json:"signer,omitempty"`
	ChannelID     string                 `json:"channel,omitempty"`
	ChaincodeName string                 `json:"chaincode,omitempty"`
	PayloadSchema interface{}            `json:"payloadSchema,omitempty"` // can be stringified JSON or map for JSON
	Context       map[string]interface{} `json:"ctx,omitempty"`
}

CommonHeaders are common to all messages

type DeployChaincode

type DeployChaincode struct {
	RequestCommon
	Version     string `json:"version,omitempty"`
	Description string `json:"description,omitempty"`
}

DeployChaincode message instructs the bridge to install a contract

type ErrorReply

type ErrorReply struct {
	ReplyCommon
	ErrorMessage    string `json:"errorMessage,omitempty"`
	OriginalMessage string `json:"requestPayload,omitempty"`
	TXHash          string `json:"transactionHash,omitempty"`
}

func NewErrorReply

func NewErrorReply(err error, origMsg interface{}) *ErrorReply

NewErrorReply is a helper to construct an error message

type GetBlock added in v0.9.7

type GetBlock struct {
	RequestCommon
	BlockNumber uint64
	BlockHash   []byte
}

type GetBlockByTxID added in v0.9.18

type GetBlockByTxID struct {
	RequestCommon
	TxID string
}

type GetChainInfo added in v0.9.7

type GetChainInfo struct {
	RequestCommon
}

type GetTxByID added in v0.9.18

type GetTxByID struct {
	RequestCommon
	TxID string `json:"txId"`
}

type LedgerQueryResult added in v0.9.4

type LedgerQueryResult struct {
	ReplyCommon
	Result interface{} `json:"result"`
}

type QueryChaincode added in v0.9.4

type QueryChaincode struct {
	RequestCommon
	Function   string   `json:"func"`
	Args       []string `json:"args,omitempty"`
	StrongRead bool     `json:"strongread"`
}

QueryChaincode message instructs the bridge to install a contract

type QueryResult added in v0.9.4

type QueryResult struct {
	ReplyCommon
	Result interface{} `json:"result"`
}

type ReplyCommon

type ReplyCommon struct {
	Headers ReplyHeaders `json:"headers"`
}

ReplyCommon is a common interface to all replies

func (*ReplyCommon) ReplyHeaders

func (r *ReplyCommon) ReplyHeaders() *ReplyHeaders

ReplyHeaders returns the reply headers

type ReplyHeaders

type ReplyHeaders struct {
	CommonHeaders
	Received  string  `json:"timeReceived"`
	Elapsed   float64 `json:"timeElapsed"`
	ReqOffset string  `json:"requestOffset"`
	ReqID     string  `json:"requestId"`
}

ReplyHeaders are common to all replies

type ReplyWithHeaders

type ReplyWithHeaders interface {
	ReplyHeaders() *ReplyHeaders
}

ReplyWithHeaders gives common access the reply headers

type RequestCommon

type RequestCommon struct {
	Headers RequestHeaders `json:"headers"`
}

RequestCommon is a common interface to all requests

type RequestHeaders

type RequestHeaders struct {
	CommonHeaders
}

RequestHeaders are common to all requests

type SendTransaction

type SendTransaction struct {
	RequestCommon
	IsInit       bool              `json:"init"`
	Function     string            `json:"func"`
	Args         []string          `json:"args,omitempty"`
	TransientMap map[string]string `json:"transientMap,omitempty"`
}

SendTransaction message instructs the bridge to install a contract

type TransactionReceipt

type TransactionReceipt struct {
	ReplyCommon
	BlockNumber     uint64 `json:"blockNumber"`
	SignerMSP       string `json:"signerMSP"`
	Signer          string `json:"signer"`
	TransactionHash string `json:"transactionHash"`
	Status          string `json:"status"`
}

TransactionReceipt is sent when a transaction has been successfully mined. Must conform to the FireFly standard structure for a blockchain receipt (see BlockchainReceiptNotification{})

Jump to

Keyboard shortcuts

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