v2

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Overview

Package v2 is a generated GoMock package.

Package v2 is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var File_transport_v2_protocol_proto protoreflect.FileDescriptor
View Source
var Protocol_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v2.Protocol",
	HandlerType: (*ProtocolServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Stream",
			Handler:       _Protocol_Stream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "transport/v2/protocol.proto",
}

Protocol_ServiceDesc is the grpc.ServiceDesc for Protocol service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func New

func New(
	config Config,
	nodeDIDResolver transport.NodeDIDResolver,
	state dag.State,
	docResolver vdr.DocResolver,
	decrypter crypto.Decrypter,
) transport.Protocol

New creates an instance of the v2 protocol.

func RegisterProtocolServer

func RegisterProtocolServer(s grpc.ServiceRegistrar, srv ProtocolServer)

Types

type Config

type Config struct {
	// Datadir from core.Config
	Datadir string
	// PayloadRetryDelay initial delay before retrying payload retrieval. Will grow exponentially
	PayloadRetryDelay time.Duration
	// GossipInterval specifies how often (in milliseconds) the node should broadcast its gossip message,
	// so other nodes can compare and synchronize.
	GossipInterval int `koanf:"gossipinterval"`
}

Config specifies config for protocol v2

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default config for protocol v2

type Diagnostics

type Diagnostics struct {

	// uptime contains the uptime (time since the node started) in seconds.
	Uptime uint32 `protobuf:"varint,1,opt,name=uptime,proto3" json:"uptime,omitempty"`
	// peerID contains the ID of the node.
	PeerID string `protobuf:"bytes,2,opt,name=peerID,proto3" json:"peerID,omitempty"`
	// peers contains the peer IDs of the node's peers.
	Peers []string `protobuf:"bytes,3,rep,name=peers,proto3" json:"peers,omitempty"`
	// numberOfTransactions contains the total number of transactions on the node's DAG.
	NumberOfTransactions uint32 `protobuf:"varint,4,opt,name=numberOfTransactions,proto3" json:"numberOfTransactions,omitempty"`
	// softwareVersion contains an indication of the software version of the node. It's recommended to use a (Git) commit ID that uniquely resolves to a code revision, alternatively a semantic version could be used (e.g. 1.2.5).
	SoftwareVersion string `protobuf:"bytes,10,opt,name=softwareVersion,proto3" json:"softwareVersion,omitempty"`
	// softwareID contains an identification of the particular Nuts implementation of the node.
	// For open source implementations it's recommended to specify URL to the public, open source repository.
	// Proprietary implementations could specify the product or vendor's name.
	SoftwareID string `protobuf:"bytes,11,opt,name=softwareID,proto3" json:"softwareID,omitempty"`
	// contains filtered or unexported fields
}

Diagnostics is a msg to inform peers of the local node's state. All fields are optional.

func (*Diagnostics) Descriptor deprecated

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

Deprecated: Use Diagnostics.ProtoReflect.Descriptor instead.

func (*Diagnostics) GetNumberOfTransactions

func (x *Diagnostics) GetNumberOfTransactions() uint32

func (*Diagnostics) GetPeerID

func (x *Diagnostics) GetPeerID() string

func (*Diagnostics) GetPeers

func (x *Diagnostics) GetPeers() []string

func (*Diagnostics) GetSoftwareID

func (x *Diagnostics) GetSoftwareID() string

func (*Diagnostics) GetSoftwareVersion

func (x *Diagnostics) GetSoftwareVersion() string

func (*Diagnostics) GetUptime

func (x *Diagnostics) GetUptime() uint32

func (*Diagnostics) ProtoMessage

func (*Diagnostics) ProtoMessage()

func (*Diagnostics) ProtoReflect

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

func (*Diagnostics) Reset

func (x *Diagnostics) Reset()

func (*Diagnostics) String

func (x *Diagnostics) String() string

type Envelope

type Envelope struct {

	// Types that are assignable to Message:
	//	*Envelope_Gossip
	//	*Envelope_DiagnosticsBroadcast
	//	*Envelope_State
	//	*Envelope_TransactionListQuery
	//	*Envelope_TransactionRangeQuery
	//	*Envelope_TransactionPayloadQuery
	//	*Envelope_TransactionSet
	//	*Envelope_TransactionList
	//	*Envelope_TransactionPayload
	//	*Envelope_Hello
	Message isEnvelope_Message `protobuf_oneof:"Message"`
	// contains filtered or unexported fields
}

func (*Envelope) Descriptor deprecated

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

Deprecated: Use Envelope.ProtoReflect.Descriptor instead.

func (*Envelope) GetDiagnosticsBroadcast

func (x *Envelope) GetDiagnosticsBroadcast() *Diagnostics

func (*Envelope) GetGossip

func (x *Envelope) GetGossip() *Gossip

func (*Envelope) GetHello

func (x *Envelope) GetHello() *HelloMessage

func (*Envelope) GetMessage

func (m *Envelope) GetMessage() isEnvelope_Message

func (*Envelope) GetState

func (x *Envelope) GetState() *State

func (*Envelope) GetTransactionList

func (x *Envelope) GetTransactionList() *TransactionList

func (*Envelope) GetTransactionListQuery

func (x *Envelope) GetTransactionListQuery() *TransactionListQuery

func (*Envelope) GetTransactionPayload

func (x *Envelope) GetTransactionPayload() *TransactionPayload

func (*Envelope) GetTransactionPayloadQuery

func (x *Envelope) GetTransactionPayloadQuery() *TransactionPayloadQuery

func (*Envelope) GetTransactionRangeQuery

func (x *Envelope) GetTransactionRangeQuery() *TransactionRangeQuery

func (*Envelope) GetTransactionSet

func (x *Envelope) GetTransactionSet() *TransactionSet

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) ProtoReflect

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

func (*Envelope) Reset

func (x *Envelope) Reset()

func (*Envelope) String

func (x *Envelope) String() string

type Envelope_DiagnosticsBroadcast

type Envelope_DiagnosticsBroadcast struct {
	DiagnosticsBroadcast *Diagnostics `protobuf:"bytes,102,opt,name=diagnosticsBroadcast,proto3,oneof"`
}

type Envelope_Gossip

type Envelope_Gossip struct {
	// broadcast
	Gossip *Gossip `protobuf:"bytes,101,opt,name=gossip,proto3,oneof"`
}

type Envelope_Hello

type Envelope_Hello struct {
	Hello *HelloMessage `protobuf:"bytes,1000,opt,name=hello,proto3,oneof"`
}

type Envelope_State

type Envelope_State struct {
	// request, starts a conversation with a new ID
	State *State `protobuf:"bytes,201,opt,name=state,proto3,oneof"`
}

type Envelope_TransactionList

type Envelope_TransactionList struct {
	TransactionList *TransactionList `protobuf:"bytes,302,opt,name=transactionList,proto3,oneof"`
}

type Envelope_TransactionListQuery

type Envelope_TransactionListQuery struct {
	TransactionListQuery *TransactionListQuery `protobuf:"bytes,202,opt,name=transactionListQuery,proto3,oneof"`
}

type Envelope_TransactionPayload

type Envelope_TransactionPayload struct {
	TransactionPayload *TransactionPayload `protobuf:"bytes,304,opt,name=transactionPayload,proto3,oneof"`
}

type Envelope_TransactionPayloadQuery

type Envelope_TransactionPayloadQuery struct {
	TransactionPayloadQuery *TransactionPayloadQuery `protobuf:"bytes,204,opt,name=transactionPayloadQuery,proto3,oneof"`
}

type Envelope_TransactionRangeQuery

type Envelope_TransactionRangeQuery struct {
	TransactionRangeQuery *TransactionRangeQuery `protobuf:"bytes,203,opt,name=transactionRangeQuery,proto3,oneof"`
}

type Envelope_TransactionSet

type Envelope_TransactionSet struct {
	// response, contains conversationID from request
	TransactionSet *TransactionSet `protobuf:"bytes,301,opt,name=transactionSet,proto3,oneof"`
}

type Gossip

type Gossip struct {

	// XOR contains the XOR'ed value of all transaction references on the sender's DAG.
	XOR []byte `protobuf:"bytes,1,opt,name=XOR,proto3" json:"XOR,omitempty"`
	// LC contains the highest transaction Lamport Clock value of the sender.
	LC uint32 `protobuf:"varint,2,opt,name=LC,proto3" json:"LC,omitempty"`
	// transactions is a list of transactions recently added to the DAG
	Transactions [][]byte `protobuf:"bytes,3,rep,name=transactions,proto3" json:"transactions,omitempty"`
	// contains filtered or unexported fields
}

Gossip is a msg broadcast to inform peers of the node's DAG state and recent additions to it (if any). The msg has no response, but the peer may decide to follow up with State or TransactionListQuery.

func (*Gossip) Descriptor deprecated

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

Deprecated: Use Gossip.ProtoReflect.Descriptor instead.

func (*Gossip) GetLC

func (x *Gossip) GetLC() uint32

func (*Gossip) GetTransactions

func (x *Gossip) GetTransactions() [][]byte

func (*Gossip) GetXOR

func (x *Gossip) GetXOR() []byte

func (*Gossip) ProtoMessage

func (*Gossip) ProtoMessage()

func (*Gossip) ProtoReflect

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

func (*Gossip) Reset

func (x *Gossip) Reset()

func (*Gossip) String

func (x *Gossip) String() string

type HelloMessage

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

func (*HelloMessage) Descriptor deprecated

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

Deprecated: Use HelloMessage.ProtoReflect.Descriptor instead.

func (*HelloMessage) ProtoMessage

func (*HelloMessage) ProtoMessage()

func (*HelloMessage) ProtoReflect

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

func (*HelloMessage) Reset

func (x *HelloMessage) Reset()

func (*HelloMessage) String

func (x *HelloMessage) String() string

type MockProtocolClient

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

MockProtocolClient is a mock of ProtocolClient interface.

func NewMockProtocolClient

func NewMockProtocolClient(ctrl *gomock.Controller) *MockProtocolClient

NewMockProtocolClient creates a new mock instance.

func (*MockProtocolClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockProtocolClient) Stream

Stream mocks base method.

type MockProtocolClientMockRecorder

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

MockProtocolClientMockRecorder is the mock recorder for MockProtocolClient.

func (*MockProtocolClientMockRecorder) Stream

func (mr *MockProtocolClientMockRecorder) Stream(ctx interface{}, opts ...interface{}) *gomock.Call

Stream indicates an expected call of Stream.

type MockProtocolServer

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

MockProtocolServer is a mock of ProtocolServer interface.

func NewMockProtocolServer

func NewMockProtocolServer(ctrl *gomock.Controller) *MockProtocolServer

NewMockProtocolServer creates a new mock instance.

func (*MockProtocolServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockProtocolServer) Stream

Stream mocks base method.

type MockProtocolServerMockRecorder

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

MockProtocolServerMockRecorder is the mock recorder for MockProtocolServer.

func (*MockProtocolServerMockRecorder) Stream

func (mr *MockProtocolServerMockRecorder) Stream(arg0 interface{}) *gomock.Call

Stream indicates an expected call of Stream.

type MockProtocol_StreamClient

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

MockProtocol_StreamClient is a mock of Protocol_StreamClient interface.

func NewMockProtocol_StreamClient

func NewMockProtocol_StreamClient(ctrl *gomock.Controller) *MockProtocol_StreamClient

NewMockProtocol_StreamClient creates a new mock instance.

func (*MockProtocol_StreamClient) CloseSend

func (m *MockProtocol_StreamClient) CloseSend() error

CloseSend mocks base method.

func (*MockProtocol_StreamClient) Context

Context mocks base method.

func (*MockProtocol_StreamClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockProtocol_StreamClient) Header

func (m *MockProtocol_StreamClient) Header() (metadata.MD, error)

Header mocks base method.

func (*MockProtocol_StreamClient) Recv

Recv mocks base method.

func (*MockProtocol_StreamClient) RecvMsg

func (m_2 *MockProtocol_StreamClient) RecvMsg(m interface{}) error

RecvMsg mocks base method.

func (*MockProtocol_StreamClient) Send

func (m *MockProtocol_StreamClient) Send(arg0 *Envelope) error

Send mocks base method.

func (*MockProtocol_StreamClient) SendMsg

func (m_2 *MockProtocol_StreamClient) SendMsg(m interface{}) error

SendMsg mocks base method.

func (*MockProtocol_StreamClient) Trailer

func (m *MockProtocol_StreamClient) Trailer() metadata.MD

Trailer mocks base method.

type MockProtocol_StreamClientMockRecorder

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

MockProtocol_StreamClientMockRecorder is the mock recorder for MockProtocol_StreamClient.

func (*MockProtocol_StreamClientMockRecorder) CloseSend

CloseSend indicates an expected call of CloseSend.

func (*MockProtocol_StreamClientMockRecorder) Context

Context indicates an expected call of Context.

func (*MockProtocol_StreamClientMockRecorder) Header

Header indicates an expected call of Header.

func (*MockProtocol_StreamClientMockRecorder) Recv

Recv indicates an expected call of Recv.

func (*MockProtocol_StreamClientMockRecorder) RecvMsg

func (mr *MockProtocol_StreamClientMockRecorder) RecvMsg(m interface{}) *gomock.Call

RecvMsg indicates an expected call of RecvMsg.

func (*MockProtocol_StreamClientMockRecorder) Send

func (mr *MockProtocol_StreamClientMockRecorder) Send(arg0 interface{}) *gomock.Call

Send indicates an expected call of Send.

func (*MockProtocol_StreamClientMockRecorder) SendMsg

func (mr *MockProtocol_StreamClientMockRecorder) SendMsg(m interface{}) *gomock.Call

SendMsg indicates an expected call of SendMsg.

func (*MockProtocol_StreamClientMockRecorder) Trailer

Trailer indicates an expected call of Trailer.

type MockProtocol_StreamServer

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

MockProtocol_StreamServer is a mock of Protocol_StreamServer interface.

func NewMockProtocol_StreamServer

func NewMockProtocol_StreamServer(ctrl *gomock.Controller) *MockProtocol_StreamServer

NewMockProtocol_StreamServer creates a new mock instance.

func (*MockProtocol_StreamServer) Context

Context mocks base method.

func (*MockProtocol_StreamServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockProtocol_StreamServer) Recv

Recv mocks base method.

func (*MockProtocol_StreamServer) RecvMsg

func (m_2 *MockProtocol_StreamServer) RecvMsg(m interface{}) error

RecvMsg mocks base method.

func (*MockProtocol_StreamServer) Send

func (m *MockProtocol_StreamServer) Send(arg0 *Envelope) error

Send mocks base method.

func (*MockProtocol_StreamServer) SendHeader

func (m *MockProtocol_StreamServer) SendHeader(arg0 metadata.MD) error

SendHeader mocks base method.

func (*MockProtocol_StreamServer) SendMsg

func (m_2 *MockProtocol_StreamServer) SendMsg(m interface{}) error

SendMsg mocks base method.

func (*MockProtocol_StreamServer) SetHeader

func (m *MockProtocol_StreamServer) SetHeader(arg0 metadata.MD) error

SetHeader mocks base method.

func (*MockProtocol_StreamServer) SetTrailer

func (m *MockProtocol_StreamServer) SetTrailer(arg0 metadata.MD)

SetTrailer mocks base method.

type MockProtocol_StreamServerMockRecorder

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

MockProtocol_StreamServerMockRecorder is the mock recorder for MockProtocol_StreamServer.

func (*MockProtocol_StreamServerMockRecorder) Context

Context indicates an expected call of Context.

func (*MockProtocol_StreamServerMockRecorder) Recv

Recv indicates an expected call of Recv.

func (*MockProtocol_StreamServerMockRecorder) RecvMsg

func (mr *MockProtocol_StreamServerMockRecorder) RecvMsg(m interface{}) *gomock.Call

RecvMsg indicates an expected call of RecvMsg.

func (*MockProtocol_StreamServerMockRecorder) Send

func (mr *MockProtocol_StreamServerMockRecorder) Send(arg0 interface{}) *gomock.Call

Send indicates an expected call of Send.

func (*MockProtocol_StreamServerMockRecorder) SendHeader

func (mr *MockProtocol_StreamServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call

SendHeader indicates an expected call of SendHeader.

func (*MockProtocol_StreamServerMockRecorder) SendMsg

func (mr *MockProtocol_StreamServerMockRecorder) SendMsg(m interface{}) *gomock.Call

SendMsg indicates an expected call of SendMsg.

func (*MockProtocol_StreamServerMockRecorder) SetHeader

func (mr *MockProtocol_StreamServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call

SetHeader indicates an expected call of SetHeader.

func (*MockProtocol_StreamServerMockRecorder) SetTrailer

func (mr *MockProtocol_StreamServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call

SetTrailer indicates an expected call of SetTrailer.

type MockScheduler

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

MockScheduler is a mock of Scheduler interface.

func NewMockScheduler

func NewMockScheduler(ctrl *gomock.Controller) *MockScheduler

NewMockScheduler creates a new mock instance.

func (*MockScheduler) Close

func (m *MockScheduler) Close() error

Close mocks base method.

func (*MockScheduler) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockScheduler) Finished

func (m *MockScheduler) Finished(hash hash.SHA256Hash) error

Finished mocks base method.

func (*MockScheduler) GetFailedJobs

func (m *MockScheduler) GetFailedJobs() ([]hash.SHA256Hash, error)

GetFailedJobs mocks base method.

func (*MockScheduler) Run

func (m *MockScheduler) Run() error

Run mocks base method.

func (*MockScheduler) Schedule

func (m *MockScheduler) Schedule(hash hash.SHA256Hash) error

Schedule mocks base method.

type MockSchedulerMockRecorder

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

MockSchedulerMockRecorder is the mock recorder for MockScheduler.

func (*MockSchedulerMockRecorder) Close

func (mr *MockSchedulerMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockSchedulerMockRecorder) Finished

func (mr *MockSchedulerMockRecorder) Finished(hash interface{}) *gomock.Call

Finished indicates an expected call of Finished.

func (*MockSchedulerMockRecorder) GetFailedJobs

func (mr *MockSchedulerMockRecorder) GetFailedJobs() *gomock.Call

GetFailedJobs indicates an expected call of GetFailedJobs.

func (*MockSchedulerMockRecorder) Run

Run indicates an expected call of Run.

func (*MockSchedulerMockRecorder) Schedule

func (mr *MockSchedulerMockRecorder) Schedule(hash interface{}) *gomock.Call

Schedule indicates an expected call of Schedule.

type MockUnsafeProtocolServer

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

MockUnsafeProtocolServer is a mock of UnsafeProtocolServer interface.

func NewMockUnsafeProtocolServer

func NewMockUnsafeProtocolServer(ctrl *gomock.Controller) *MockUnsafeProtocolServer

NewMockUnsafeProtocolServer creates a new mock instance.

func (*MockUnsafeProtocolServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockUnsafeProtocolServerMockRecorder

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

MockUnsafeProtocolServerMockRecorder is the mock recorder for MockUnsafeProtocolServer.

type ProtocolClient

type ProtocolClient interface {
	Stream(ctx context.Context, opts ...grpc.CallOption) (Protocol_StreamClient, error)
}

ProtocolClient is the client API for Protocol service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewProtocolClient

func NewProtocolClient(cc grpc.ClientConnInterface) ProtocolClient

type ProtocolServer

type ProtocolServer interface {
	Stream(Protocol_StreamServer) error
}

ProtocolServer is the server API for Protocol service. All implementations should embed UnimplementedProtocolServer for forward compatibility

type Protocol_StreamClient

type Protocol_StreamClient interface {
	Send(*Envelope) error
	Recv() (*Envelope, error)
	grpc.ClientStream
}

type Protocol_StreamServer

type Protocol_StreamServer interface {
	Send(*Envelope) error
	Recv() (*Envelope, error)
	grpc.ServerStream
}

type Scheduler

type Scheduler interface {
	// Schedule a job that needs to be retried. It'll be passed to the channel immediately and at set intervals.
	// Returns nil if job already exists.
	// An error is returned if there's a problem with the underlying storage.
	Schedule(hash hash.SHA256Hash) error
	// Finished marks the job as finished and removes it from the scheduler
	// An error is returned if there's a problem with the underlying storage.
	Finished(hash hash.SHA256Hash) error
	// Run retrying existing jobs
	Run() error
	// GetFailedJobs retrieves the hashes of failed jobs
	GetFailedJobs() ([]hash.SHA256Hash, error)
	// Close cancels all jobs and closes the DB
	Close() error
}

Scheduler defines methods for a persistent retry mechanism

func NewPayloadScheduler

func NewPayloadScheduler(db *bbolt.DB, payloadRetryDelay time.Duration, callback jobCallBack) (Scheduler, error)

NewPayloadScheduler returns a Scheduler for payload fetches. The payload hashes as []byte should be added as job.

type State

type State struct {

	// conversationID contains the token used to identify the response
	ConversationID []byte `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID,omitempty"`
	// XOR contains the XOR'ed value of ALL transaction references on the sender's DAG.
	XOR []byte `protobuf:"bytes,2,opt,name=XOR,proto3" json:"XOR,omitempty"`
	// LC contains the Lamport Clock value (inclusive) for which the node requests an IBLT
	LC uint32 `protobuf:"varint,3,opt,name=LC,proto3" json:"LC,omitempty"`
	// contains filtered or unexported fields
}

State is a request for the peer's DAG state up to the given LC value

func (*State) Descriptor deprecated

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

Deprecated: Use State.ProtoReflect.Descriptor instead.

func (*State) GetConversationID

func (x *State) GetConversationID() []byte

func (*State) GetLC

func (x *State) GetLC() uint32

func (*State) GetXOR

func (x *State) GetXOR() []byte

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) ProtoReflect

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

func (*State) Reset

func (x *State) Reset()

func (*State) String

func (x *State) String() string

type Transaction

type Transaction struct {

	// hash contains the reference of the transaction, as specified by RFC004.
	Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	// data contains the data of the transaction, which is a JWS as specified by RFC004.
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// payload contains the payload when it may be attached but wasn't so in the transaction already
	Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3,oneof" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

Transaction represents a transaction on the DAG.

func (*Transaction) Descriptor deprecated

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

Deprecated: Use Transaction.ProtoReflect.Descriptor instead.

func (*Transaction) GetData

func (x *Transaction) GetData() []byte

func (*Transaction) GetHash

func (x *Transaction) GetHash() []byte

func (*Transaction) GetPayload

func (x *Transaction) GetPayload() []byte

func (*Transaction) ProtoMessage

func (*Transaction) ProtoMessage()

func (*Transaction) ProtoReflect

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

func (*Transaction) Reset

func (x *Transaction) Reset()

func (*Transaction) String

func (x *Transaction) String() string

type TransactionList

type TransactionList struct {

	// conversationID contains the token used to identify the response
	ConversationID []byte `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID,omitempty"`
	// transactions contains the list of requested transactions. Transactions MUST be sorted by LC value
	Transactions []*Transaction `protobuf:"bytes,2,rep,name=transactions,proto3" json:"transactions,omitempty"`
	// contains filtered or unexported fields
}

TransactionList contains a list of transactions requested in TransactionListQuery or TransactionRangeQuery

func (*TransactionList) Descriptor deprecated

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

Deprecated: Use TransactionList.ProtoReflect.Descriptor instead.

func (*TransactionList) GetConversationID

func (x *TransactionList) GetConversationID() []byte

func (*TransactionList) GetTransactions

func (x *TransactionList) GetTransactions() []*Transaction

func (*TransactionList) ProtoMessage

func (*TransactionList) ProtoMessage()

func (*TransactionList) ProtoReflect

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

func (*TransactionList) Reset

func (x *TransactionList) Reset()

func (*TransactionList) String

func (x *TransactionList) String() string

type TransactionListQuery

type TransactionListQuery struct {

	// conversationID contains the token used to identify the response
	ConversationID []byte `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID,omitempty"`
	// refs is the list of requested transactions by reference
	Refs [][]byte `protobuf:"bytes,2,rep,name=refs,proto3" json:"refs,omitempty"`
	// contains filtered or unexported fields
}

TransactionListQuery is a request for transactions by references

func (*TransactionListQuery) Descriptor deprecated

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

Deprecated: Use TransactionListQuery.ProtoReflect.Descriptor instead.

func (*TransactionListQuery) GetConversationID

func (x *TransactionListQuery) GetConversationID() []byte

func (*TransactionListQuery) GetRefs

func (x *TransactionListQuery) GetRefs() [][]byte

func (*TransactionListQuery) ProtoMessage

func (*TransactionListQuery) ProtoMessage()

func (*TransactionListQuery) ProtoReflect

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

func (*TransactionListQuery) Reset

func (x *TransactionListQuery) Reset()

func (*TransactionListQuery) String

func (x *TransactionListQuery) String() string

type TransactionPayload

type TransactionPayload struct {

	// conversationID contains the token used to identify the response
	ConversationID []byte `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID,omitempty"`
	// transactionRef contains the reference to the transaction which' payload was requested.
	TransactionRef []byte `protobuf:"bytes,2,opt,name=transactionRef,proto3" json:"transactionRef,omitempty"`
	// data contains the actual payload.
	Data []byte `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

TransactionPayload is the response msg for TransactionPayloadQuery

func (*TransactionPayload) Descriptor deprecated

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

Deprecated: Use TransactionPayload.ProtoReflect.Descriptor instead.

func (*TransactionPayload) GetConversationID

func (x *TransactionPayload) GetConversationID() []byte

func (*TransactionPayload) GetData

func (x *TransactionPayload) GetData() []byte

func (*TransactionPayload) GetTransactionRef

func (x *TransactionPayload) GetTransactionRef() []byte

func (*TransactionPayload) ProtoMessage

func (*TransactionPayload) ProtoMessage()

func (*TransactionPayload) ProtoReflect

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

func (*TransactionPayload) Reset

func (x *TransactionPayload) Reset()

func (*TransactionPayload) String

func (x *TransactionPayload) String() string

type TransactionPayloadQuery

type TransactionPayloadQuery struct {

	// conversationID contains the token used to identify the response
	ConversationID []byte `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID,omitempty"`
	// transactionRef contains the reference (hash) of the transaction, which payload the node would like to receive, as specified by RFC004.
	TransactionRef []byte `protobuf:"bytes,2,opt,name=transactionRef,proto3" json:"transactionRef,omitempty"`
	// contains filtered or unexported fields
}

TransactionPayloadQuery is a msg used to query the payload of a transaction.

func (*TransactionPayloadQuery) Descriptor deprecated

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

Deprecated: Use TransactionPayloadQuery.ProtoReflect.Descriptor instead.

func (*TransactionPayloadQuery) GetConversationID

func (x *TransactionPayloadQuery) GetConversationID() []byte

func (*TransactionPayloadQuery) GetTransactionRef

func (x *TransactionPayloadQuery) GetTransactionRef() []byte

func (*TransactionPayloadQuery) ProtoMessage

func (*TransactionPayloadQuery) ProtoMessage()

func (*TransactionPayloadQuery) ProtoReflect

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

func (*TransactionPayloadQuery) Reset

func (x *TransactionPayloadQuery) Reset()

func (*TransactionPayloadQuery) String

func (x *TransactionPayloadQuery) String() string

type TransactionRangeQuery

type TransactionRangeQuery struct {

	// conversationID contains the token used to identify the response
	ConversationID []byte `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID,omitempty"`
	// start indicates the start of the requested Lamport Clock range (inclusive)
	Start uint32 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"`
	// end indicates the end of the requested Lamport Clock range (exclusive)
	End uint32 `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"`
	// contains filtered or unexported fields
}

TransactionRangeQuery is a request for transactions by LC range

func (*TransactionRangeQuery) Descriptor deprecated

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

Deprecated: Use TransactionRangeQuery.ProtoReflect.Descriptor instead.

func (*TransactionRangeQuery) GetConversationID

func (x *TransactionRangeQuery) GetConversationID() []byte

func (*TransactionRangeQuery) GetEnd

func (x *TransactionRangeQuery) GetEnd() uint32

func (*TransactionRangeQuery) GetStart

func (x *TransactionRangeQuery) GetStart() uint32

func (*TransactionRangeQuery) ProtoMessage

func (*TransactionRangeQuery) ProtoMessage()

func (*TransactionRangeQuery) ProtoReflect

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

func (*TransactionRangeQuery) Reset

func (x *TransactionRangeQuery) Reset()

func (*TransactionRangeQuery) String

func (x *TransactionRangeQuery) String() string

type TransactionSet

type TransactionSet struct {

	// conversationID contains the token used to identify the response
	ConversationID []byte `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID,omitempty"`
	// LCReq contains the LC value that was sent in the State msg
	LCReq uint32 `protobuf:"varint,2,opt,name=LCReq,proto3" json:"LCReq,omitempty"`
	// LC contains the highest transaction Lamport Clock value from the sender of this msg.
	LC uint32 `protobuf:"varint,3,opt,name=LC,proto3" json:"LC,omitempty"`
	// IBLT contains the serialized IBLT. The first byte indicates the serialization format of the IBLT.
	IBLT []byte `protobuf:"bytes,4,opt,name=IBLT,proto3" json:"IBLT,omitempty"`
	// contains filtered or unexported fields
}

TransactionSet sends an IBLT in response to a State msg

func (*TransactionSet) Descriptor deprecated

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

Deprecated: Use TransactionSet.ProtoReflect.Descriptor instead.

func (*TransactionSet) GetConversationID

func (x *TransactionSet) GetConversationID() []byte

func (*TransactionSet) GetIBLT

func (x *TransactionSet) GetIBLT() []byte

func (*TransactionSet) GetLC

func (x *TransactionSet) GetLC() uint32

func (*TransactionSet) GetLCReq

func (x *TransactionSet) GetLCReq() uint32

func (*TransactionSet) ProtoMessage

func (*TransactionSet) ProtoMessage()

func (*TransactionSet) ProtoReflect

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

func (*TransactionSet) Reset

func (x *TransactionSet) Reset()

func (*TransactionSet) String

func (x *TransactionSet) String() string

type UnimplementedProtocolServer

type UnimplementedProtocolServer struct {
}

UnimplementedProtocolServer should be embedded to have forward compatible implementations.

func (UnimplementedProtocolServer) Stream

type UnsafeProtocolServer

type UnsafeProtocolServer interface {
	// contains filtered or unexported methods
}

UnsafeProtocolServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProtocolServer will result in compilation errors.

Directories

Path Synopsis
Package gossip is a generated GoMock package.
Package gossip is a generated GoMock package.

Jump to

Keyboard shortcuts

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