rpcserver

package
v0.0.0-...-1310602 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const Subsystem = "B12-RPCS"

Subsystem defines the logging code for this subsystem.

Variables

View Source
var ErrFeatureOverflow = errors.New("feature exceeds maximum value")

ErrFeatureOverflow is returned if a feature will overflow uint16.

View Source
var (
	// ErrShuttingDown is returned when an operation is aborted because
	// the server is shutting down.
	ErrShuttingDown = status.Errorf(codes.Aborted, "server shutting down")
)
View Source
var RPCServerPermissions = map[string][]bakery.Op{
	"/offersrpc.Offers/SendOnionMessage": {{
		Entity: "peers",
		Action: "write",
	}},
	"/offersrpc.Offers/DecodeOffer": {{
		Entity: "offchain",
		Action: "read",
	}},
	"/offersrpc.Offers/SubscribeOnionPayload": {{
		Entity: "offchain",
		Action: "read",
	}},
	"/offersrpc.Offers/GenerateBlindedRoute": {{
		Entity: "offchain",
		Action: "read",
	}},
}

RPCServerPermissions is the set of macaroon permissions needed for each api.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.

Types

type Server

type Server struct {
	offersrpc.UnimplementedOffersServer
	// contains filtered or unexported fields
}

Server implements our offersrpc server.

func NewServer

func NewServer(shutdown func(error)) (*Server, error)

NewServer creates an offers server.

func (*Server) DecodeOffer

DecodeOffer decodes and validates the offer string provided.

func (*Server) GenerateBlindedRoute

GenerateBlindedRoute generates a blinded route to our node.

func (*Server) SendOnionMessage

SendOnionMessage sends an onion message to the peer specified.

func (*Server) Start

func (s *Server) Start(lnd *lndclient.LndServices) error

Start starts the offers server.

func (*Server) Stop

func (s *Server) Stop() error

Stop shuts down the server.

func (*Server) SubscribeOnionPayload

SubscribeOnionPayload subscribes to onion message payloads

Jump to

Keyboard shortcuts

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