node

package
v0.4.31 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: GPL-3.0 Imports: 43 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Node              nodeConfig               `yaml:"node"`
	NPP               npp.Config               `yaml:"npp"`
	Log               logging.Config           `yaml:"log"`
	Blockchain        *blockchain.Config       `yaml:"blockchain"`
	Eth               accounts.EthConfig       `yaml:"ethereum" required:"false"`
	DWH               dwh.YAMLConfig           `yaml:"dwh"`
	MetricsListenAddr string                   `yaml:"metrics_listen_addr" default:"127.0.0.1:14003"`
	Benchmarks        benchmarks.Config        `yaml:"benchmarks"`
	Matcher           *matcher.YAMLConfig      `yaml:"matcher"`
	Predictor         *optimus.PredictorConfig `yaml:"predictor"`
	Debug             *debug.Config            `yaml:"debug"`
	SSH               *ssh.ProxyServerConfig   `yaml:"ssh"`
}

func NewConfig

func NewConfig(path string) (*Config, error)

NewConfig loads localNode config from given .yaml file

type LocalEndpoints added in v0.4.5

type LocalEndpoints struct {
	GRPC []net.Addr
	QRPC []net.Addr
	REST []net.Addr
}

type Node

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

func New

func New(ctx context.Context, cfg *Config, options ...Option) (*Node, error)

New constructs a new Node instance.

The specified context should outlive the returned Node value, because it is used for certificate refreshing.

func (*Node) Serve

func (m *Node) Serve(ctx context.Context) error

type Option added in v0.4.5

type Option func(o *options)

func WithLog added in v0.4.5

func WithLog(log *zap.Logger) Option

type SSHServer added in v0.4.10

type SSHServer interface {
	Serve(ctx context.Context) error
}

type Server added in v0.4.5

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

Server is a server for LocalNode instance.

Its responsibility is to manage network part, i.e. creating TCP servers and exposing API provided outside.

func (*Server) LocalEndpoints added in v0.4.5

func (m *Server) LocalEndpoints() LocalEndpoints

func (*Server) Serve added in v0.4.5

func (m *Server) Serve(ctx context.Context) error

Serve starts serving current Node instance until either critical error occurs or the given context is canceled.

Warning: after this call the next callings of "Serve" will have no effect.

type ServerOption added in v0.4.5

type ServerOption func(o *serverOptions) error

func WithGRPCSecure added in v0.4.5

func WithGRPCSecure(credentials credentials.TransportCredentials, key *ecdsa.PrivateKey) ServerOption

func WithGRPCServer added in v0.4.5

func WithGRPCServer() ServerOption

func WithGRPCServerMetrics added in v0.4.5

func WithGRPCServerMetrics() ServerOption

func WithQUIC added in v0.4.17

func WithQUIC(cfg *tls.Config) ServerOption

func WithRESTSecure added in v0.4.5

func WithRESTSecure(key *ecdsa.PrivateKey) ServerOption

func WithRESTServer added in v0.4.5

func WithRESTServer() ServerOption

func WithSSH added in v0.4.10

func WithServerLog added in v0.4.5

func WithServerLog(log *zap.Logger) ServerOption

type Services added in v0.4.5

type Services interface {
	RegisterGRPC(server *grpc.Server) error
	RegisterREST(server *rest.Server) error
	Interceptor() grpc.UnaryServerInterceptor
	StreamInterceptor() grpc.StreamServerInterceptor
	Run(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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