interconnect

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: BSD-2-Clause Imports: 17 Imported by: 1

Documentation

Overview

Package interconnect contains logic for cross communication between the cMix servers and xxNetwork's consensus

Index

Constants

This section is empty.

Variables

View Source
var File_interconnect_proto protoreflect.FileDescriptor
View Source
var Interconnect_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "interconnect.Interconnect",
	HandlerType: (*InterconnectServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetNDF",
			Handler:    _Interconnect_GetNDF_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "interconnect.proto",
}

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

Functions

func RegisterInterconnectServer

func RegisterInterconnectServer(s grpc.ServiceRegistrar, srv InterconnectServer)

Types

type CMixClient

type CMixClient struct {
	*connect.ProtoComms
	// contains filtered or unexported fields
}

CMixServer object used to implement endpoints and top-level comms functionality

type CMixServer

type CMixServer struct {
	*connect.ProtoComms

	*UnimplementedInterconnectServer
	// contains filtered or unexported fields
}

CMixServer object used to implement endpoints and top-level comms functionality

func StartCMixInterconnect

func StartCMixInterconnect(id *id.ID, port string, handler ServerHandler,
	certPEMblock, keyPEMblock []byte) (*CMixServer, closeListener)

Starts a new server on the localHost:port specified by port and a callback interface for interconnect operations with given path to public and private key for TLS connection

func (*CMixServer) GetNDF

func (c *CMixServer) GetNDF(ctx context.Context, ping *messages.Ping) (*NDF, error)

func (*CMixServer) GetNdf

func (c *CMixServer) GetNdf(host *connect.Host,
	message *messages.Ping) (*NDF, error)

CMixServer -> consensus node Send Function

type ClientHandler

type ClientHandler interface {
}

Handler for consensus -> CMix

type Implementation

type Implementation struct {
	Functions implementationFunctions
}

Implementation allows users of the client library to set the functions that implement the node functions

func NewImplementation

func NewImplementation() *Implementation

NewImplementation returns a Implementation struct with all of the function pointers returning nothing and printing an error.

func (*Implementation) GetNDF

func (s *Implementation) GetNDF() (*NDF, error)

Interconnect Interface for getting an NDF

type InterconnectClient

type InterconnectClient interface {
	GetNDF(ctx context.Context, in *messages.Ping, opts ...grpc.CallOption) (*NDF, error)
}

InterconnectClient is the client API for Interconnect 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.

type InterconnectServer

type InterconnectServer interface {
	GetNDF(context.Context, *messages.Ping) (*NDF, error)
	// contains filtered or unexported methods
}

InterconnectServer is the server API for Interconnect service. All implementations must embed UnimplementedInterconnectServer for forward compatibility

type NDF

type NDF struct {
	Ndf []byte `protobuf:"bytes,1,opt,name=Ndf,proto3" json:"Ndf,omitempty"`
	// contains filtered or unexported fields
}

The Network Definition File is defined as a JSON structure in primitives/ndf.

func (*NDF) Descriptor deprecated

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

Deprecated: Use NDF.ProtoReflect.Descriptor instead.

func (*NDF) GetNdf

func (x *NDF) GetNdf() []byte

func (*NDF) ProtoMessage

func (*NDF) ProtoMessage()

func (*NDF) ProtoReflect

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

func (*NDF) Reset

func (x *NDF) Reset()

func (*NDF) String

func (x *NDF) String() string

type ServerHandler

type ServerHandler interface {
	// Interconnect interface for getting the NDF
	GetNDF() (*NDF, error)
}

Handler for CMix -> consensus

type UnimplementedInterconnectServer

type UnimplementedInterconnectServer struct {
}

UnimplementedInterconnectServer must be embedded to have forward compatible implementations.

func (UnimplementedInterconnectServer) GetNDF

type UnsafeInterconnectServer

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

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

Jump to

Keyboard shortcuts

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