server

package
v0.0.0-...-50bfe8b Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterApis

func RegisterApis(apis []rpc.API, srv *rpc.Server) error

RegisterApis checks the given modules' availability, generates an allowlist based on the allowed modules, and then registers all of the APIs exposed by the services.

Types

type Config

type Config struct {
	Name string
	// HTTPHost is the host interface on which to start the HTTP RPC server. If this
	// field is empty, no HTTP API endpoint will be started.
	HTTPHost string

	// HTTPPort is the TCP port number on which to start the HTTP RPC server. The
	// default zero value is/ valid and will pick a port number randomly (useful
	// for ephemeral nodes).
	HTTPPort int `toml:",omitempty"`

	// HTTPPathPrefix specifies a path prefix on which http-rpc is to be served.
	HTTPPathPrefix string `toml:",omitempty"`

	// WSPathPrefix specifies a path prefix on which ws-rpc is to be served.
	WSPathPrefix string `toml:",omitempty"`

	// BatchRequestLimit is the maximum number of requests in a batch.
	BatchRequestLimit int `toml:",omitempty"`

	// BatchResponseMaxSize is the maximum number of bytes returned from a batched rpc call.
	BatchResponseMaxSize int `toml:",omitempty"`
}

Config represents a small collection of configuration values to fine tune the P2P network layer of a protocol stack. These values can be further extended by all registered services.

func DefaultConfig

func DefaultConfig(addr string) *Config

type EERPCServer

type EERPCServer struct {
	service.BaseService
	// contains filtered or unexported fields
}

func NewEeRPCServer

func NewEeRPCServer(conf *Config, apis []rpc.API, logger log.Logger) *EERPCServer

New creates a new server

func (*EERPCServer) Address

func (s *EERPCServer) Address() net.Addr

Address returns the address the server is listening on

Must be called after server.Start()

func (*EERPCServer) OnStart

func (s *EERPCServer) OnStart() error

func (*EERPCServer) OnStop

func (s *EERPCServer) OnStop()

func (*EERPCServer) ServiceName

func (s *EERPCServer) ServiceName() string

Directories

Path Synopsis
Implement the wrapping calls to the wrapped engines.
Implement the wrapping calls to the wrapped engines.

Jump to

Keyboard shortcuts

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