rpc

package
v0.0.10-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPHandlerStack

func NewHTTPHandlerStack(srv http.Handler, cors []string, vhosts []string) http.Handler

NewHTTPHandlerStack returns wrapped http-related handlers

func RegisterApisFromWhitelist

func RegisterApisFromWhitelist(apis []rpc.API, modules []string, srv *rpc.Server, exposeAll bool) error

RegisterApisFromWhitelist checks the given modules' availability, generates a whitelist based on the allowed modules, and then registers all of the APIs exposed by the services.

Types

type Config

type Config struct {
	ConsensusInfoFeed iface.ConsensusInfoFeed
	ConsensusInfoDB   db.ReadOnlyDatabase
	// ipc config
	IPCPath string
	// http config
	HTTPEnable       bool
	HTTPHost         string
	HTTPPort         int
	HTTPCors         []string
	HTTPVirtualHosts []string
	HTTPModules      []string
	HTTPTimeouts     rpc.HTTPTimeouts
	HTTPPathPrefix   string
	// WebSocket config
	WSEnable     bool
	WSHost       string
	WSPort       int
	WSPathPrefix string
	WSOrigins    []string
}

Config

type Service

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

Service defining an RPC server for a orchestrator node.

func NewService

func NewService(ctx context.Context, cfg *Config) (*Service, error)

NewService instantiates a new RPC service instance that will be registered into a running orchestrator node.

func (*Service) APIs

func (s *Service) APIs() []rpc.API

func (*Service) Start

func (s *Service) Start()

Start a consensus info fetcher service's main event loop.

func (*Service) Status

func (s *Service) Status() error

Status

func (*Service) Stop

func (s *Service) Stop() error

Stop

func (*Service) Wait

func (s *Service) Wait()

Wait blocks until the node is closed.

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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