Documentation ¶
Index ¶
- Variables
- func ConvertAndMarshal(data interface{}) ([]byte, error)
- func DecodeQuaiRequest(reqMsg *QuaiRequestMessage) (uint32, interface{}, common.Location, interface{}, error)
- func DecodeQuaiResponse(respMsg *QuaiResponseMessage) (uint32, interface{}, error)
- func EncodeQuaiRequest(id uint32, location common.Location, reqData interface{}, ...) ([]byte, error)
- func EncodeQuaiResponse(id uint32, location common.Location, respDataType interface{}, ...) ([]byte, error)
- func UnmarshalAndConvert(data []byte, sourceLocation common.Location, dataPtr *interface{}, ...) error
- type GossipTransaction
- func (*GossipTransaction) Descriptor() ([]byte, []int)deprecated
- func (x *GossipTransaction) GetTransaction() *types.ProtoTransaction
- func (*GossipTransaction) ProtoMessage()
- func (x *GossipTransaction) ProtoReflect() protoreflect.Message
- func (x *GossipTransaction) Reset()
- func (x *GossipTransaction) String() string
- type GossipWorkObject
- func (*GossipWorkObject) Descriptor() ([]byte, []int)deprecated
- func (x *GossipWorkObject) GetWorkObject() *types.ProtoWorkObject
- func (*GossipWorkObject) ProtoMessage()
- func (x *GossipWorkObject) ProtoReflect() protoreflect.Message
- func (x *GossipWorkObject) Reset()
- func (x *GossipWorkObject) String() string
- type QuaiMessage
- func (*QuaiMessage) Descriptor() ([]byte, []int)deprecated
- func (m *QuaiMessage) GetPayload() isQuaiMessage_Payload
- func (x *QuaiMessage) GetRequest() *QuaiRequestMessage
- func (x *QuaiMessage) GetResponse() *QuaiResponseMessage
- func (*QuaiMessage) ProtoMessage()
- func (x *QuaiMessage) ProtoReflect() protoreflect.Message
- func (x *QuaiMessage) Reset()
- func (x *QuaiMessage) String() string
- type QuaiMessage_Request
- type QuaiMessage_Response
- type QuaiRequestMessage
- func (*QuaiRequestMessage) Descriptor() ([]byte, []int)deprecated
- func (x *QuaiRequestMessage) GetBlockHash() *common.ProtoHash
- func (m *QuaiRequestMessage) GetData() isQuaiRequestMessage_Data
- func (x *QuaiRequestMessage) GetHash() *common.ProtoHash
- func (x *QuaiRequestMessage) GetId() uint32
- func (x *QuaiRequestMessage) GetLocation() *common.ProtoLocation
- func (x *QuaiRequestMessage) GetNumber() []byte
- func (m *QuaiRequestMessage) GetRequest() isQuaiRequestMessage_Request
- func (x *QuaiRequestMessage) GetWorkObjectBlock() *types.ProtoWorkObjectBlockView
- func (x *QuaiRequestMessage) GetWorkObjectBlocks() *types.ProtoWorkObjectBlocksView
- func (x *QuaiRequestMessage) GetWorkObjectHeader() *types.ProtoWorkObjectHeaderView
- func (*QuaiRequestMessage) ProtoMessage()
- func (x *QuaiRequestMessage) ProtoReflect() protoreflect.Message
- func (x *QuaiRequestMessage) Reset()
- func (x *QuaiRequestMessage) String() string
- type QuaiRequestMessage_BlockHash
- type QuaiRequestMessage_Hash
- type QuaiRequestMessage_Number
- type QuaiRequestMessage_WorkObjectBlock
- type QuaiRequestMessage_WorkObjectBlocks
- type QuaiRequestMessage_WorkObjectHeader
- type QuaiResponseMessage
- func (*QuaiResponseMessage) Descriptor() ([]byte, []int)deprecated
- func (x *QuaiResponseMessage) GetBlockHash() *common.ProtoHash
- func (x *QuaiResponseMessage) GetId() uint32
- func (x *QuaiResponseMessage) GetLocation() *common.ProtoLocation
- func (m *QuaiResponseMessage) GetResponse() isQuaiResponseMessage_Response
- func (x *QuaiResponseMessage) GetWorkObjectBlockView() *types.ProtoWorkObjectBlockView
- func (x *QuaiResponseMessage) GetWorkObjectBlocksView() *types.ProtoWorkObjectBlocksView
- func (x *QuaiResponseMessage) GetWorkObjectHeaderView() *types.ProtoWorkObjectHeaderView
- func (*QuaiResponseMessage) ProtoMessage()
- func (x *QuaiResponseMessage) ProtoReflect() protoreflect.Message
- func (x *QuaiResponseMessage) Reset()
- func (x *QuaiResponseMessage) String() string
- type QuaiResponseMessage_BlockHash
- type QuaiResponseMessage_WorkObjectBlockView
- type QuaiResponseMessage_WorkObjectBlocksView
- type QuaiResponseMessage_WorkObjectHeaderView
Constants ¶
This section is empty.
Variables ¶
var EmptyResponse = errors.New("received empty reponse from peer")
var File_p2p_pb_quai_messages_proto protoreflect.FileDescriptor
Functions ¶
func ConvertAndMarshal ¶
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:
- The request ID
- The decoded type (i.e. *types.Header, *types.Block, etc)
- The location
- The request data
- An error
func DecodeQuaiResponse ¶
func DecodeQuaiResponse(respMsg *QuaiResponseMessage) (uint32, interface{}, error)
Unmarshals a serialized protobuf message into a Quai Response message. Returns:
- The request ID
- The decoded type (i.e. *types.Header, *types.Block, etc)
- 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.
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_WorkObjectBlocks // *QuaiRequestMessage_WorkObjectHeader // *QuaiRequestMessage_BlockHash 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) GetWorkObjectBlock ¶
func (x *QuaiRequestMessage) GetWorkObjectBlock() *types.ProtoWorkObjectBlockView
func (*QuaiRequestMessage) GetWorkObjectBlocks ¶ added in v0.31.0
func (x *QuaiRequestMessage) GetWorkObjectBlocks() *types.ProtoWorkObjectBlocksView
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_Hash ¶
type QuaiRequestMessage_Number ¶
type QuaiRequestMessage_Number struct {
Number []byte `protobuf:"bytes,4,opt,name=number,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_WorkObjectBlocks ¶ added in v0.31.0
type QuaiRequestMessage_WorkObjectBlocks struct {
WorkObjectBlocks *types.ProtoWorkObjectBlocksView `protobuf:"bytes,6,opt,name=work_object_blocks,json=workObjectBlocks,proto3,oneof"`
}
type QuaiRequestMessage_WorkObjectHeader ¶
type QuaiRequestMessage_WorkObjectHeader struct {
WorkObjectHeader *types.ProtoWorkObjectHeaderView `protobuf:"bytes,7,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_WorkObjectBlocksView // *QuaiResponseMessage_BlockHash 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) GetWorkObjectBlockView ¶
func (x *QuaiResponseMessage) GetWorkObjectBlockView() *types.ProtoWorkObjectBlockView
func (*QuaiResponseMessage) GetWorkObjectBlocksView ¶ added in v0.31.0
func (x *QuaiResponseMessage) GetWorkObjectBlocksView() *types.ProtoWorkObjectBlocksView
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_WorkObjectBlockView ¶
type QuaiResponseMessage_WorkObjectBlockView struct {
WorkObjectBlockView *types.ProtoWorkObjectBlockView `protobuf:"bytes,4,opt,name=work_object_block_view,json=workObjectBlockView,proto3,oneof"`
}
type QuaiResponseMessage_WorkObjectBlocksView ¶ added in v0.31.0
type QuaiResponseMessage_WorkObjectBlocksView struct {
WorkObjectBlocksView *types.ProtoWorkObjectBlocksView `protobuf:"bytes,5,opt,name=work_object_blocks_view,json=workObjectBlocksView,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"`
}