pb

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_p2p_pb_quai_messages_proto protoreflect.FileDescriptor

Functions

func ConvertAndMarshal

func ConvertAndMarshal(data interface{}) ([]byte, error)

Converts a custom go type to a proto type and marhsals it into a protobuf message

func DecodeQuaiRequest

func DecodeQuaiRequest(reqMsg *QuaiRequestMessage) (uint32, interface{}, common.Location, interface{}, error)

DecodeRequestMessage unmarshals a protobuf message into a Quai Request. Returns:

  1. The request ID
  2. The decoded type (i.e. *types.Header, *types.Block, etc)
  3. The location
  4. The request data
  5. An error

func DecodeQuaiResponse

func DecodeQuaiResponse(respMsg *QuaiResponseMessage) (uint32, interface{}, error)

Unmarshals a serialized protobuf message into a Quai Response message. Returns:

  1. The request ID
  2. The decoded type (i.e. *types.Header, *types.Block, etc)
  3. An error

func EncodeQuaiRequest

func EncodeQuaiRequest(id uint32, location common.Location, reqData interface{}, respDataType interface{}) ([]byte, error)

EncodeRequestMessage creates a marshaled protobuf message for a Quai Request. Returns the serialized protobuf message.

func EncodeQuaiResponse

func EncodeQuaiResponse(id uint32, location common.Location, data interface{}) ([]byte, error)

EncodeResponse creates a marshaled protobuf message for a Quai Response. Returns the serialized protobuf message.

func UnmarshalAndConvert

func UnmarshalAndConvert(data []byte, sourceLocation common.Location, dataPtr *interface{}, datatype interface{}) error

Unmarshals a protobuf message into a proto type and converts it to a custom go type

Types

type GossipTransaction

type GossipTransaction struct {
	Transaction *types.ProtoTransaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"`
	// contains filtered or unexported fields
}

func (*GossipTransaction) Descriptor deprecated

func (*GossipTransaction) Descriptor() ([]byte, []int)

Deprecated: Use GossipTransaction.ProtoReflect.Descriptor instead.

func (*GossipTransaction) GetTransaction

func (x *GossipTransaction) GetTransaction() *types.ProtoTransaction

func (*GossipTransaction) ProtoMessage

func (*GossipTransaction) ProtoMessage()

func (*GossipTransaction) ProtoReflect

func (x *GossipTransaction) ProtoReflect() protoreflect.Message

func (*GossipTransaction) Reset

func (x *GossipTransaction) Reset()

func (*GossipTransaction) String

func (x *GossipTransaction) String() string

type GossipWorkObject

type GossipWorkObject struct {
	WorkObject *types.ProtoWorkObject `protobuf:"bytes,1,opt,name=work_object,json=workObject,proto3" json:"work_object,omitempty"`
	// contains filtered or unexported fields
}

GossipSub messages for broadcasting blocks and transactions

func (*GossipWorkObject) Descriptor deprecated

func (*GossipWorkObject) Descriptor() ([]byte, []int)

Deprecated: Use GossipWorkObject.ProtoReflect.Descriptor instead.

func (*GossipWorkObject) GetWorkObject

func (x *GossipWorkObject) GetWorkObject() *types.ProtoWorkObject

func (*GossipWorkObject) ProtoMessage

func (*GossipWorkObject) ProtoMessage()

func (*GossipWorkObject) ProtoReflect

func (x *GossipWorkObject) ProtoReflect() protoreflect.Message

func (*GossipWorkObject) Reset

func (x *GossipWorkObject) Reset()

func (*GossipWorkObject) String

func (x *GossipWorkObject) String() string

type QuaiMessage

type QuaiMessage struct {

	// Types that are assignable to Payload:
	//
	//	*QuaiMessage_Request
	//	*QuaiMessage_Response
	Payload isQuaiMessage_Payload `protobuf_oneof:"payload"`
	// contains filtered or unexported fields
}

func DecodeQuaiMessage

func DecodeQuaiMessage(data []byte) (*QuaiMessage, error)

func (*QuaiMessage) Descriptor deprecated

func (*QuaiMessage) Descriptor() ([]byte, []int)

Deprecated: Use QuaiMessage.ProtoReflect.Descriptor instead.

func (*QuaiMessage) GetPayload

func (m *QuaiMessage) GetPayload() isQuaiMessage_Payload

func (*QuaiMessage) GetRequest

func (x *QuaiMessage) GetRequest() *QuaiRequestMessage

func (*QuaiMessage) GetResponse

func (x *QuaiMessage) GetResponse() *QuaiResponseMessage

func (*QuaiMessage) ProtoMessage

func (*QuaiMessage) ProtoMessage()

func (*QuaiMessage) ProtoReflect

func (x *QuaiMessage) ProtoReflect() protoreflect.Message

func (*QuaiMessage) Reset

func (x *QuaiMessage) Reset()

func (*QuaiMessage) String

func (x *QuaiMessage) String() string

type QuaiMessage_Request

type QuaiMessage_Request struct {
	Request *QuaiRequestMessage `protobuf:"bytes,1,opt,name=request,proto3,oneof"`
}

type QuaiMessage_Response

type QuaiMessage_Response struct {
	Response *QuaiResponseMessage `protobuf:"bytes,2,opt,name=response,proto3,oneof"`
}

type QuaiRequestMessage

type QuaiRequestMessage struct {
	Id       uint32                `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Location *common.ProtoLocation `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"`
	// Types that are assignable to Data:
	//
	//	*QuaiRequestMessage_Hash
	//	*QuaiRequestMessage_Number
	Data isQuaiRequestMessage_Data `protobuf_oneof:"data"`
	// Types that are assignable to Request:
	//
	//	*QuaiRequestMessage_WorkObjectBlock
	//	*QuaiRequestMessage_WorkObjectHeader
	//	*QuaiRequestMessage_Transaction
	//	*QuaiRequestMessage_BlockHash
	//	*QuaiRequestMessage_TrieNode
	Request isQuaiRequestMessage_Request `protobuf_oneof:"request"`
	// contains filtered or unexported fields
}

QuaiRequestMessage is the main 'envelope' for QuaiProtocol request messages

func (*QuaiRequestMessage) Descriptor deprecated

func (*QuaiRequestMessage) Descriptor() ([]byte, []int)

Deprecated: Use QuaiRequestMessage.ProtoReflect.Descriptor instead.

func (*QuaiRequestMessage) GetBlockHash

func (x *QuaiRequestMessage) GetBlockHash() *common.ProtoHash

func (*QuaiRequestMessage) GetData

func (m *QuaiRequestMessage) GetData() isQuaiRequestMessage_Data

func (*QuaiRequestMessage) GetHash

func (x *QuaiRequestMessage) GetHash() *common.ProtoHash

func (*QuaiRequestMessage) GetId

func (x *QuaiRequestMessage) GetId() uint32

func (*QuaiRequestMessage) GetLocation

func (x *QuaiRequestMessage) GetLocation() *common.ProtoLocation

func (*QuaiRequestMessage) GetNumber

func (x *QuaiRequestMessage) GetNumber() []byte

func (*QuaiRequestMessage) GetRequest

func (m *QuaiRequestMessage) GetRequest() isQuaiRequestMessage_Request

func (*QuaiRequestMessage) GetTransaction

func (x *QuaiRequestMessage) GetTransaction() *types.ProtoTransaction

func (*QuaiRequestMessage) GetTrieNode

func (x *QuaiRequestMessage) GetTrieNode() *trie.ProtoTrieNode

func (*QuaiRequestMessage) GetWorkObjectBlock

func (x *QuaiRequestMessage) GetWorkObjectBlock() *types.ProtoWorkObjectBlockView

func (*QuaiRequestMessage) GetWorkObjectHeader

func (x *QuaiRequestMessage) GetWorkObjectHeader() *types.ProtoWorkObjectHeaderView

func (*QuaiRequestMessage) ProtoMessage

func (*QuaiRequestMessage) ProtoMessage()

func (*QuaiRequestMessage) ProtoReflect

func (x *QuaiRequestMessage) ProtoReflect() protoreflect.Message

func (*QuaiRequestMessage) Reset

func (x *QuaiRequestMessage) Reset()

func (*QuaiRequestMessage) String

func (x *QuaiRequestMessage) String() string

type QuaiRequestMessage_BlockHash

type QuaiRequestMessage_BlockHash struct {
	BlockHash *common.ProtoHash `protobuf:"bytes,8,opt,name=block_hash,json=blockHash,proto3,oneof"`
}

type QuaiRequestMessage_Hash

type QuaiRequestMessage_Hash struct {
	Hash *common.ProtoHash `protobuf:"bytes,3,opt,name=hash,proto3,oneof"`
}

type QuaiRequestMessage_Number

type QuaiRequestMessage_Number struct {
	Number []byte `protobuf:"bytes,4,opt,name=number,proto3,oneof"`
}

type QuaiRequestMessage_Transaction

type QuaiRequestMessage_Transaction struct {
	Transaction *types.ProtoTransaction `protobuf:"bytes,7,opt,name=transaction,proto3,oneof"`
}

type QuaiRequestMessage_TrieNode

type QuaiRequestMessage_TrieNode struct {
	TrieNode *trie.ProtoTrieNode `protobuf:"bytes,9,opt,name=trie_node,json=trieNode,proto3,oneof"`
}

type QuaiRequestMessage_WorkObjectBlock

type QuaiRequestMessage_WorkObjectBlock struct {
	WorkObjectBlock *types.ProtoWorkObjectBlockView `protobuf:"bytes,5,opt,name=work_object_block,json=workObjectBlock,proto3,oneof"`
}

type QuaiRequestMessage_WorkObjectHeader

type QuaiRequestMessage_WorkObjectHeader struct {
	WorkObjectHeader *types.ProtoWorkObjectHeaderView `protobuf:"bytes,6,opt,name=work_object_header,json=workObjectHeader,proto3,oneof"`
}

type QuaiResponseMessage

type QuaiResponseMessage struct {
	Id       uint32                `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Location *common.ProtoLocation `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"`
	// Types that are assignable to Response:
	//
	//	*QuaiResponseMessage_WorkObjectHeaderView
	//	*QuaiResponseMessage_WorkObjectBlockView
	//	*QuaiResponseMessage_Transaction
	//	*QuaiResponseMessage_BlockHash
	//	*QuaiResponseMessage_TrieNode
	Response isQuaiResponseMessage_Response `protobuf_oneof:"response"`
	// contains filtered or unexported fields
}

QuaiResponseMessage is the main 'envelope' for QuaiProtocol response messages

func (*QuaiResponseMessage) Descriptor deprecated

func (*QuaiResponseMessage) Descriptor() ([]byte, []int)

Deprecated: Use QuaiResponseMessage.ProtoReflect.Descriptor instead.

func (*QuaiResponseMessage) GetBlockHash

func (x *QuaiResponseMessage) GetBlockHash() *common.ProtoHash

func (*QuaiResponseMessage) GetId

func (x *QuaiResponseMessage) GetId() uint32

func (*QuaiResponseMessage) GetLocation

func (x *QuaiResponseMessage) GetLocation() *common.ProtoLocation

func (*QuaiResponseMessage) GetResponse

func (m *QuaiResponseMessage) GetResponse() isQuaiResponseMessage_Response

func (*QuaiResponseMessage) GetTransaction

func (x *QuaiResponseMessage) GetTransaction() *types.ProtoTransaction

func (*QuaiResponseMessage) GetTrieNode

func (x *QuaiResponseMessage) GetTrieNode() *trie.ProtoTrieNode

func (*QuaiResponseMessage) GetWorkObjectBlockView

func (x *QuaiResponseMessage) GetWorkObjectBlockView() *types.ProtoWorkObjectBlockView

func (*QuaiResponseMessage) GetWorkObjectHeaderView

func (x *QuaiResponseMessage) GetWorkObjectHeaderView() *types.ProtoWorkObjectHeaderView

func (*QuaiResponseMessage) ProtoMessage

func (*QuaiResponseMessage) ProtoMessage()

func (*QuaiResponseMessage) ProtoReflect

func (x *QuaiResponseMessage) ProtoReflect() protoreflect.Message

func (*QuaiResponseMessage) Reset

func (x *QuaiResponseMessage) Reset()

func (*QuaiResponseMessage) String

func (x *QuaiResponseMessage) String() string

type QuaiResponseMessage_BlockHash

type QuaiResponseMessage_BlockHash struct {
	BlockHash *common.ProtoHash `protobuf:"bytes,6,opt,name=block_hash,json=blockHash,proto3,oneof"`
}

type QuaiResponseMessage_Transaction

type QuaiResponseMessage_Transaction struct {
	Transaction *types.ProtoTransaction `protobuf:"bytes,5,opt,name=transaction,proto3,oneof"`
}

type QuaiResponseMessage_TrieNode

type QuaiResponseMessage_TrieNode struct {
	TrieNode *trie.ProtoTrieNode `protobuf:"bytes,7,opt,name=trie_node,json=trieNode,proto3,oneof"`
}

type QuaiResponseMessage_WorkObjectBlockView

type QuaiResponseMessage_WorkObjectBlockView struct {
	WorkObjectBlockView *types.ProtoWorkObjectBlockView `protobuf:"bytes,4,opt,name=work_object_block_view,json=workObjectBlockView,proto3,oneof"`
}

type QuaiResponseMessage_WorkObjectHeaderView

type QuaiResponseMessage_WorkObjectHeaderView struct {
	WorkObjectHeaderView *types.ProtoWorkObjectHeaderView `protobuf:"bytes,3,opt,name=work_object_header_view,json=workObjectHeaderView,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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