Documentation
¶
Index ¶
- Constants
- type Client
- func (t Client) Connect(accountName, beacon string) (res string, err error)
- func (t Client) CreateAccount(msats int) (res string, err error)
- func (t Client) ExecCmd(method string, argv []string) (res []byte, err error)
- func (t Client) GetInfo() (res string, err error)
- func (t Client) Listen(accountName string) (res string, err error)
- type Directory
- func (t *Directory) AddAccount(acct account.Db)
- func (t *Directory) GenerateAccountName() string
- func (t *Directory) GetAccountList() []account.Db
- func (t *Directory) GetAccountNameSet() (accounts []string)
- func (t *Directory) GetAccounts() (accounts []account.Db)
- func (t *Directory) LookupByName(name string) *account.Db
- func (t *Directory) LookupByPaymentHash(hash string)
- func (t *Directory) LookupBySeed(seed beacon.SharedSeed) account.Db
- func (t *Directory) ReindexAccount(acct account.Db)
- type Layer
- func (o *Layer) AnnounceNexus(belowNexus nexus.Nexus)
- func (o *Layer) HandleInvoiceRequest(ss beacon.SharedSeed, msats int)
- func (o *Layer) HandlePayRequest(ss beacon.SharedSeed, bolt11 string)
- func (o *Layer) HandleProviderInfoRequest(ss beacon.SharedSeed)
- func (o *Layer) NotifyPreImage(sharedSeeds []beacon.SharedSeed, preimage string)
- func (o *Layer) RegisterAboveLayer(belowLayer layer.Layer)
- func (o *Layer) RevokeNexus(belowNexus nexus.Nexus)
- func (o *Layer) SetupTerminusNexus(belowNexus nexus.Nexus) *Nexus
- type Nexus
- func (o Nexus) IsLayerMessage(message message_base.MoneysocketMessage) bool
- func (o *Nexus) NotifyPreimage(preimage, requestReferenceUUID string)
- func (o *Nexus) NotifyProviderInfo(ss beacon.SharedSeed)
- func (o *Nexus) OnBinMessage(belowNexus nexus.Nexus, msgBytes []byte)
- func (o *Nexus) OnMessage(belowNexus nexus.Nexus, message message_base.MoneysocketMessage)
- type OnStackEvent
- type RPCMessage
- type Stack
- func (s *Stack) AnnounceNexus(terminusNexus Nexus)
- func (s *Stack) Connect(location location.WebsocketLocation, sharedSeed *beacon.SharedSeed) (*websocket2.OutgoingSocket, error)
- func (s *Stack) GetListenLocation() []location.Location
- func (s *Stack) Listen() error
- func (s *Stack) LocalConnect(sharedSeed beacon.SharedSeed)
- func (s *Stack) SendStackEvent(layerName string, nexus nexus.Nexus, status string)
- func (s *Stack) SetupIncomingStack(config *config.Config, localLayer *local.OutgoingLocalLayer) *stack.IncomingStack
- func (s *Stack) SetupLocalLayer() *local.OutgoingLocalLayer
- func (s *Stack) SetupProviderLayer(belowLayer layer.Layer) *provider.Layer
- func (s *Stack) SetupRendezvousLayer(belowLayer1 layer.Layer, belowLayer2 layer.Layer) *rendezvous.OutgoingRendezvousLayer
- func (s *Stack) SetupTerminusLayer(belowLayer layer.Layer) *Layer
- func (s *Stack) SetupWebsocketLayer() *websocket.OutgoingWebsocketLayer
- type Terminus
- func (t *Terminus) Create(msats int) account.Db
- func (t *Terminus) GetInfo() (res string)
- func (t *Terminus) Listen(rawAcct string, rawSharedSeed string) (encodedBeacon string, err error)
- func (t *Terminus) LoadPersisted()
- func (t *Terminus) OnAnnounce(nexus nexus.Nexus)
- func (t *Terminus) OnRevoke(nexus nexus.Nexus)
- func (t *Terminus) RetryConnectionLoop()
- func (t *Terminus) ServeHTTP(w http.ResponseWriter, request *http.Request)
- func (t *Terminus) Start(ctx context.Context) error
- func (t *Terminus) StartServer() error
Constants ¶
const ( // get info rpc method GetInfoMethod = "getinfo" // create account rpc method CreateAccountMethod = "create" // connect rpc method ConnectMethod = "connect" // listen rpc method ListenMethod = "listen" )
const NexusName = "TerminusNexus"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.54.0
type Client struct {
// contains filtered or unexported fields
}
func (Client) CreateAccount ¶ added in v0.54.0
create account with a given number of sats
type Directory ¶ added in v0.54.0
type Directory struct {
Accounts map[string]account.Db
AccountsByPaymentHash map[string]account.Db
// contains filtered or unexported fields
}
func NewTerminusDirectory ¶
func (*Directory) AddAccount ¶ added in v0.54.0
func (*Directory) GenerateAccountName ¶ added in v0.54.0
generate an account name from an autoincrementing int
func (*Directory) GetAccountList ¶ added in v0.54.0
func (*Directory) GetAccountNameSet ¶ added in v0.54.0
get list of acount names
func (*Directory) GetAccounts ¶ added in v0.54.0
python version is an iterator
func (*Directory) LookupByName ¶ added in v0.54.0
func (*Directory) LookupByPaymentHash ¶ added in v0.54.0
func (*Directory) LookupBySeed ¶ added in v0.54.0
func (t *Directory) LookupBySeed(seed beacon.SharedSeed) account.Db
func (*Directory) ReindexAccount ¶ added in v0.54.0
type Layer ¶ added in v0.54.0
TODO this needs to be fully implemented
func NewTerminusLayer ¶
func NewTerminusLayer() *Layer
func (*Layer) AnnounceNexus ¶ added in v0.54.0
AnnounceNexus creates a new TerminusNexus and registers it
func (*Layer) HandleInvoiceRequest ¶ added in v0.54.0
func (o *Layer) HandleInvoiceRequest(ss beacon.SharedSeed, msats int)
func (*Layer) HandlePayRequest ¶ added in v0.54.0
func (o *Layer) HandlePayRequest(ss beacon.SharedSeed, bolt11 string)
func (*Layer) HandleProviderInfoRequest ¶ added in v0.54.0
func (o *Layer) HandleProviderInfoRequest(ss beacon.SharedSeed)
func (*Layer) NotifyPreImage ¶ added in v0.54.0
func (o *Layer) NotifyPreImage(sharedSeeds []beacon.SharedSeed, preimage string)
func (*Layer) RegisterAboveLayer ¶ added in v0.54.0
RegisterAboveLayer registers the current nexuses announce/revoke nexuses to the below layer
func (*Layer) RevokeNexus ¶ added in v0.54.0
type Nexus ¶ added in v0.54.0
func (Nexus) IsLayerMessage ¶ added in v0.54.0
func (o Nexus) IsLayerMessage(message message_base.MoneysocketMessage) bool
func (*Nexus) NotifyPreimage ¶ added in v0.54.0
func (*Nexus) NotifyProviderInfo ¶ added in v0.54.0
func (o *Nexus) NotifyProviderInfo(ss beacon.SharedSeed)
func (*Nexus) OnBinMessage ¶ added in v0.54.0
func (*Nexus) OnMessage ¶ added in v0.54.0
func (o *Nexus) OnMessage(belowNexus nexus.Nexus, message message_base.MoneysocketMessage)
type RPCMessage ¶ added in v0.54.0
type Stack ¶ added in v0.54.0
func NewTerminusStack ¶
func (*Stack) AnnounceNexus ¶ added in v0.54.0
func (*Stack) Connect ¶ added in v0.54.0
func (s *Stack) Connect(location location.WebsocketLocation, sharedSeed *beacon.SharedSeed) (*websocket2.OutgoingSocket, error)
func (*Stack) GetListenLocation ¶ added in v0.54.0
get ws listen locations from the config
func (*Stack) LocalConnect ¶ added in v0.54.0
func (s *Stack) LocalConnect(sharedSeed beacon.SharedSeed)
func (*Stack) SendStackEvent ¶ added in v0.54.0
func (*Stack) SetupIncomingStack ¶ added in v0.54.0
func (s *Stack) SetupIncomingStack(config *config.Config, localLayer *local.OutgoingLocalLayer) *stack.IncomingStack
func (*Stack) SetupLocalLayer ¶ added in v0.54.0
func (s *Stack) SetupLocalLayer() *local.OutgoingLocalLayer
func (*Stack) SetupProviderLayer ¶ added in v0.54.0
func (*Stack) SetupRendezvousLayer ¶ added in v0.54.0
func (s *Stack) SetupRendezvousLayer(belowLayer1 layer.Layer, belowLayer2 layer.Layer) *rendezvous.OutgoingRendezvousLayer
func (*Stack) SetupTerminusLayer ¶ added in v0.54.0
func (*Stack) SetupWebsocketLayer ¶ added in v0.54.0
func (s *Stack) SetupWebsocketLayer() *websocket.OutgoingWebsocketLayer
type Terminus ¶
type Terminus struct {
// contains filtered or unexported fields
}
Terminus is the app
func NewTerminus ¶
NewTerminus creates a Terminus node from a config
func (*Terminus) Create ¶
Create creates an account with a given number of msats and add it to the directory
func (*Terminus) LoadPersisted ¶
func (t *Terminus) LoadPersisted()
LoadPersisted loads persisted accounts from the disk
func (*Terminus) OnAnnounce ¶ added in v0.54.0
OnAnnounce handles nexus announcements
func (*Terminus) RetryConnectionLoop ¶ added in v0.17.0
func (t *Terminus) RetryConnectionLoop()
RetryConnectionLoop retries a connection on a loop
func (*Terminus) ServeHTTP ¶
func (t *Terminus) ServeHTTP(w http.ResponseWriter, request *http.Request)
ServeHTTP handles requests through the rpc server todo break this out into separate methods
func (*Terminus) StartServer ¶
StartServer starts the terminus server