Back to

Package jsonrpc

Latest Go to latest

The highest tagged major version is .

Published: Jan 28, 2020 | License: ISC | Module:


func UseLogger

func UseLogger(logger slog.Logger)

UseLogger sets the package-wide logger. Any calls to this function must be made before a server is created and used (it is not concurrent safe).

type Options

type Options struct {
	Username string
	Password string

	MaxPOSTClients      int64
	MaxWebsocketClients int64

	CSPPServer       string
	DialCSPPServer   func(ctx context.Context, network, addr string) (net.Conn, error)
	MixAccount       string
	MixBranch        uint32
	MixChangeAccount string

Options contains the required options for running the legacy RPC server.

type Server

type Server struct {
	// contains filtered or unexported fields

Server holds the items the RPC server may need to access (auth, config, shutdown, etc.)

func NewServer

func NewServer(opts *Options, activeNet *chaincfg.Params, walletLoader *loader.Loader, listeners []net.Listener) *Server

NewServer creates a new server for serving JSON-RPC client connections, both HTTP POST and websocket.

func (*Server) RequestProcessShutdown

func (s *Server) RequestProcessShutdown() <-chan struct{}

RequestProcessShutdown returns a channel that is sent to when an authorized client requests remote shutdown.

func (*Server) Stop

func (s *Server) Stop()

Stop gracefully shuts down the rpc server by stopping and disconnecting all clients. This blocks until shutdown completes.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier