cln_plugin

package
v0.0.0-...-9a3af51 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubscriberTimeoutOption = "lsp-subscribertimeout"
	ListenAddressOption     = "lsp-listen"
)
View Source
const (
	SpecVersion    = "2.0"
	ParseError     = -32700
	InvalidRequest = -32600
	MethodNotFound = -32601
	InvalidParams  = -32603
	InternalErr    = -32603
)
View Source
const (
	MaxIntakeBuffer = 500 * 1024 * 1023
)

Variables

View Source
var (
	DefaultSubscriberTimeout     = "1m"
	DefaultChannelAcceptorScript = ""
	LspsFeatureBit               = "" /* 184-byte string literal not displayed */
)
View Source
var (
	TwoNewLines = []byte("\n\n")
)

Functions

func NewServer

func NewServer(listenAddress string, subscriberTimeout time.Duration) *server

Creates a new grpc server

Types

type ClnPlugin

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

func NewClnPlugin

func NewClnPlugin(in, out *os.File) *ClnPlugin

func (*ClnPlugin) Start

func (c *ClnPlugin) Start()

Starts the cln plugin. NOTE: The grpc server is started in the handleInit function.

func (*ClnPlugin) Stop

func (c *ClnPlugin) Stop()

Stops the cln plugin. Drops any remaining work immediately. Pending htlcs will be replayed when cln starts again.

type CustomMessageRequest

type CustomMessageRequest struct {
	PeerId  string `json:"peer_id"`
	Payload string `json:"payload"`
}

type FeatureBits

type FeatureBits struct {
	Node    *string `json:"node,omitempty"`
	Init    *string `json:"init,omitempty"`
	Channel *string `json:"channel,omitempty"`
	Invoice *string `json:"invoice,omitempty"`
}

type Hook

type Hook struct {
	Name   string   `json:"name"`
	Before []string `json:"before,omitempty"`
}

type Htlc

type Htlc struct {
	ShortChannelId     string `json:"short_channel_id"`
	Id                 uint64 `json:"id"`
	AmountMsat         uint64 `json:"amount_msat"`
	CltvExpiry         uint32 `json:"cltv_expiry"`
	CltvExpiryRelative int32  `json:"cltv_expiry_relative"`
	PaymentHash        string `json:"payment_hash"`
}

type HtlcAccepted

type HtlcAccepted struct {
	Onion     *Onion `json:"onion"`
	Htlc      *Htlc  `json:"htlc"`
	ForwardTo string `json:"forward_to"`
}

type InitConfiguration

type InitConfiguration struct {
	LightningDir   string       `json:"lightning-dir"`
	RpcFile        string       `json:"rpc-file"`
	Startup        bool         `json:"startup"`
	Network        string       `json:"network"`
	FeatureSet     *FeatureBits `json:"feature_set"`
	Proxy          *Proxy       `json:"proxy"`
	TorV3Enabled   bool         `json:"torv3-enabled"`
	AlwaysUseProxy bool         `json:"always_use_proxy"`
}

type InitMessage

type InitMessage struct {
	Options       map[string]interface{} `json:"options,omitempty"`
	Configuration *InitConfiguration     `json:"configuration,omitempty"`
}

type LogNotification

type LogNotification struct {
	Level   string `json:"level"`
	Message string `json:"message"`
}

type Manifest

type Manifest struct {
	Options       []Option     `json:"options"`
	RpcMethods    []*RpcMethod `json:"rpcmethods"`
	Dynamic       bool         `json:"dynamic"`
	Subscriptions []string     `json:"subscriptions,omitempty"`
	Hooks         []Hook       `json:"hooks,omitempty"`
	FeatureBits   *FeatureBits `json:"featurebits,omitempty"`
	NonNumericIds bool         `json:"nonnumericids"`
}

type Onion

type Onion struct {
	Payload           string `json:"payload"`
	ShortChannelId    string `json:"short_channel_id"`
	ForwardMsat       uint64 `json:"forward_msat"`
	OutgoingCltvValue uint32 `json:"outgoing_cltv_value"`
	SharedSecret      string `json:"shared_secret"`
	NextOnion         string `json:"next_onion"`
}

type Option

type Option struct {
	Name        string  `json:"name"`
	Type        string  `json:"type"`
	Description string  `json:"description"`
	Default     *string `json:"default,omitempty"`
	Multi       *bool   `json:"multi,omitempty"`
	Deprecated  *bool   `json:"deprecated,omitempty"`
}

type Proxy

type Proxy struct {
	Type    string `json:"type"`
	Address string `json:"address"`
	Port    int    `json:"port"`
}

type Request

type Request struct {
	Id      json.RawMessage `json:"id,omitempty"`
	Method  string          `json:"method"`
	JsonRpc string          `json:"jsonrpc"`
	Params  json.RawMessage `json:"params,omitempty"`
}

type Response

type Response struct {
	Id      json.RawMessage `json:"id"`
	JsonRpc string          `json:"jsonrpc"`
	Result  Result          `json:"result,omitempty"`
	Error   *RpcError       `json:"error,omitempty"`
}

type Result

type Result interface{}

type RpcError

type RpcError struct {
	Code    int             `json:"code"`
	Message string          `json:"message"`
	Data    json.RawMessage `json:"data,omitempty"`
}

type RpcMethod

type RpcMethod struct {
	Name            string  `json:"name"`
	Usage           string  `json:"usage"`
	Description     string  `json:"description"`
	LongDescription *string `json:"long_description,omitempty"`
	Deprecated      *bool   `json:"deprecated,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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