rpc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec struct{}

Codec ...

func NewCodec

func NewCodec() *Codec

NewCodec ...

func (*Codec) NewRequest

func (c *Codec) NewRequest(req *http.Request) rpc.CodecRequest

NewRequest ...

type CodecRequest

type CodecRequest struct {
	*json2.CodecRequest
}

CodecRequest ...

func (*CodecRequest) Method

func (cr *CodecRequest) Method() (string, error)

Method ...

type Config

type Config struct {
	Ctx     context.Context
	Address string // "IP:port" to listen on
	Relayer *relayer.Relayer
}

Config is the RPC server configuration passed to NewServer

type RelayerService

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

RelayerService represents a relayer JSON-RPC service.

func NewRelayerService

func NewRelayerService(r *relayer.Relayer) (*RelayerService, error)

NewRelayerService returns a new RPC RelayerService.

func (*RelayerService) SubmitTransaction

SubmitTransaction submits a transaction to the relayer.

type Server

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

Server represents the JSON-RPC server

func NewServer

func NewServer(cfg *Config) (*Server, error)

NewServer creates but does not start the relayer RPC service. Pre-start configuration that can fail, including reserving the server port, is handled here.

func (*Server) HttpURL

func (s *Server) HttpURL() string

HttpURL returns the URL used for HTTP requests

func (*Server) Start

func (s *Server) Start() error

Start starts the JSON-RPC server.

func (*Server) Stop

func (s *Server) Stop() error

Stop shuts down the http server. If the context the server was created with is still valid, it will be a graceful shutdown where existing connections are serviced until finished. If the context is cancelled, the shutdown will be immediate.

Jump to

Keyboard shortcuts

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