terminus

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// get info rpc method
	GetInfoMethod = "getinfo"
	// create account rpc method
	CreateAccountMethod = "create"
	// connect rpc method
	ConnectMethod = "connect"
	// listen rpc method
	ListenMethod = "listen"
)
View Source
const TerminusNexusName = "TerminusNexus"

Variables

This section is empty.

Functions

This section is empty.

Types

type OnStackEvent

type OnStackEvent func(layerName string, nexus nexus.Nexus, status string)

type RpcMessage

type RpcMessage struct {
	Method string     `json:"method"`
	Params [][]string `json:"params"`
}

type Terminus

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

func NewTerminus

func NewTerminus(config *config.Config) Terminus

func (*Terminus) Create

func (t *Terminus) Create(msats int) account.AccountDb

create an account with a given number of msats and add it to the directory

func (*Terminus) GetInfo

func (t *Terminus) GetInfo() (res string)

get formatted info (for python paritY)

func (*Terminus) Listen

func (t *Terminus) Listen(rawAcct string, rawSharedSeed string) (encodedBeacon string, err error)

raw shared seed is optional

func (*Terminus) LoadPersisted

func (t *Terminus) LoadPersisted()

load persisted accounts from disk

func (*Terminus) RetryConnectionLoop added in v0.17.0

func (t *Terminus) RetryConnectionLoop()

func (*Terminus) ServeHTTP

func (t *Terminus) ServeHTTP(w http.ResponseWriter, request *http.Request)

todo break this out into seperate methods

func (*Terminus) Start

func (t *Terminus) Start(ctx context.Context) error

func (*Terminus) StartServer

func (t *Terminus) StartServer()

start the server

type TerminusClient

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

func NewClient

func NewClient(config *config.Config) TerminusClient

func (TerminusClient) Connect added in v0.13.0

func (t TerminusClient) Connect(accountName, beacon string) (res string, err error)

func (TerminusClient) CreateAccount

func (t TerminusClient) CreateAccount(msats int) (res string, err error)

create account with a given number of sats

func (TerminusClient) ExecCmd

func (t TerminusClient) ExecCmd(method string, argv []string) (res []byte, err error)

func (TerminusClient) GetInfo

func (t TerminusClient) GetInfo() (res string, err error)

get list of beacons, accounts, etc

func (TerminusClient) Listen

func (t TerminusClient) Listen(accountName string) (res string, err error)

type TerminusDirectory

type TerminusDirectory struct {
	AccountBySharedSeed   map[string]account.AccountDb
	SharedSeedsByAccount  map[string][]beacon.SharedSeed
	Accounts              map[string]account.AccountDb
	AccountsByPaymentHash map[string]account.AccountDb
	// contains filtered or unexported fields
}

func NewTerminusDirectory

func NewTerminusDirectory(config *config.Config) *TerminusDirectory

func (*TerminusDirectory) AddAccount

func (t *TerminusDirectory) AddAccount(acct account.AccountDb)

func (*TerminusDirectory) GenerateAccountName

func (t *TerminusDirectory) GenerateAccountName() string

generate an account name from an autoincrementing int

func (*TerminusDirectory) GetAccountList

func (t *TerminusDirectory) GetAccountList() []account.AccountDb

func (*TerminusDirectory) GetAccountNameSet

func (t *TerminusDirectory) GetAccountNameSet() (accounts []string)

get list of acount names

func (*TerminusDirectory) GetAccounts

func (t *TerminusDirectory) GetAccounts() (accounts []account.AccountDb)

python verison is an iterator

func (*TerminusDirectory) LookupByName

func (t *TerminusDirectory) LookupByName(name string) *account.AccountDb

func (*TerminusDirectory) LookupByPaymentHash

func (t *TerminusDirectory) LookupByPaymentHash(hash string)

func (*TerminusDirectory) LookupBySeed

func (t *TerminusDirectory) LookupBySeed(seed beacon.SharedSeed) account.AccountDb

func (*TerminusDirectory) ReindexAccount

func (t *TerminusDirectory) ReindexAccount(acct account.AccountDb)

type TerminusLayer

type TerminusLayer struct {
	layer.BaseLayer
	NexusesBySharedSeed map[string][]string
	// contains filtered or unexported fields
}

TODO this needs to be fully implemented

func NewTerminusLayer

func NewTerminusLayer() *TerminusLayer

func (*TerminusLayer) AnnounceNexus

func (o *TerminusLayer) AnnounceNexus(belowNexus nexus.Nexus)

func (*TerminusLayer) HandleInvoiceRequest

func (o *TerminusLayer) HandleInvoiceRequest(ss beacon.SharedSeed, msats int)

func (*TerminusLayer) HandlePayRequest

func (o *TerminusLayer) HandlePayRequest(ss beacon.SharedSeed, bolt11 string)

func (*TerminusLayer) HandleProviderInfoRequest

func (o *TerminusLayer) HandleProviderInfoRequest(ss beacon.SharedSeed)

func (*TerminusLayer) NotifyPreImage

func (o *TerminusLayer) NotifyPreImage(sharedSeeds []beacon.SharedSeed, preimage string)

func (*TerminusLayer) RegisterAboveLayer

func (o *TerminusLayer) RegisterAboveLayer(belowLayer layer.Layer)

func (*TerminusLayer) RevokeNexus

func (o *TerminusLayer) RevokeNexus(belowNexus nexus.Nexus)

func (*TerminusLayer) SetupTerminusNexus

func (o *TerminusLayer) SetupTerminusNexus(belowNexus nexus.Nexus) *TerminusNexus

type TerminusNexus

type TerminusNexus struct {
	*base.BaseNexus
	// contains filtered or unexported fields
}

func NewTerminusNexus

func NewTerminusNexus(below nexus.Nexus, layer layer.Layer) TerminusNexus

func (TerminusNexus) IsLayerMessage

func (o TerminusNexus) IsLayerMessage(message message_base.MoneysocketMessage) bool

func (*TerminusNexus) NotifyPreimage

func (o *TerminusNexus) NotifyPreimage(preimage, requestReferenceUuid string)

func (*TerminusNexus) NotifyProviderInfo

func (o *TerminusNexus) NotifyProviderInfo(ss beacon.SharedSeed)

func (*TerminusNexus) OnBinMessage

func (o *TerminusNexus) OnBinMessage(belowNexus nexus.Nexus, msgBytes []byte)

func (*TerminusNexus) OnMessage

func (o *TerminusNexus) OnMessage(belowNexus nexus.Nexus, message message_base.MoneysocketMessage)

type TerminusStack

type TerminusStack struct {
	Config *config.Config
	// contains filtered or unexported fields
}

func NewTerminusStack

func NewTerminusStack(config *config.Config) *TerminusStack

func (*TerminusStack) Connect

func (*TerminusStack) GetListenLocation

func (s *TerminusStack) GetListenLocation() []location.Location

get ws listen locations from the config

func (*TerminusStack) Listen

func (s *TerminusStack) Listen()

func (*TerminusStack) LocalConnect

func (s *TerminusStack) LocalConnect(sharedSeed beacon.SharedSeed)

func (*TerminusStack) SendStackEvent

func (s *TerminusStack) SendStackEvent(layerName string, nexus nexus.Nexus, status string)

func (*TerminusStack) SetupIncomingStack

func (s *TerminusStack) SetupIncomingStack(config *config.Config, localLayer *local.OutgoingLocalLayer) *stack.IncomingStack

func (*TerminusStack) SetupLocalLayer

func (s *TerminusStack) SetupLocalLayer() *local.OutgoingLocalLayer

func (*TerminusStack) SetupProviderLayer

func (s *TerminusStack) SetupProviderLayer(belowLayer layer.Layer) *provider.ProviderLayer

func (*TerminusStack) SetupRendezvousLayer

func (s *TerminusStack) SetupRendezvousLayer(belowLayer1 layer.Layer, belowLayer2 layer.Layer) *rendezvous.OutgoingRendezvousLayer

func (*TerminusStack) SetupTerminusLayer

func (s *TerminusStack) SetupTerminusLayer(belowLayer layer.Layer) *TerminusLayer

func (*TerminusStack) SetupWebsocketLayer

func (s *TerminusStack) SetupWebsocketLayer() *websocket.OutgoingWebsocketLayer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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