litrpc

package
v0.0.0-...-92076c6 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2019 License: MIT Imports: 34 Imported by: 0

README

RPC Commands

Other structs referenced in request/responses have their declarations copied in second secton of this document.

chancmds

ChannelList

Args:

  • ChanIdx (uint32)

Returns:

  • Channels (ChannelInfo list)

If ChanIdx is nonzero, returns info for only that channel.

FundChannel

Args:

  • Peer (uint32)
  • CoinType (uint32)
  • Capacity (int64)
  • Roundup (int64)
  • InitialSend (int64)
  • Data (32 byte array)

Returns:

  • Status (string)
DualFundChannel

Args:

  • Peer (uint32)
  • CoinType (uint32)
  • OurAmount (int64)
  • TheirAmount (int64)

Returns:

  • Status (string)
DualFundRespond

Args:

  • AcceptOrDecline (bool)

Returns:

  • Status (string)

True for accept, false for decline.

PendingDualFund

Args: empty object

Returns:

  • Pending (bool)
  • PeerIdx (uint32)
  • CoinType (uint32)
  • TheirAmount (int64)
  • RequestedAmount (int64)
StateDump

Args: empty object

Returns:

  • Txs (JusticeTx list)
Push

Args:

  • ChanIdx (uint32)
  • Amt (int64)
  • Data (32 byte array)

Returns:

  • `StateIndex (uint64)``
CloseChannel

Args:

  • ChanIdx (uint32)

Returns:

  • Status (string)
BreakChannel

Args:

  • ChanIdx (uint32)

Returns:

  • Status (string)
DumpPrivs

Args: none

Returns:

  • Privs (PrivInfo list)

dlccmds

ListOracles

Args: empty object

Returns:

  • Oracles (DlcOracle list)
ImportOracle

Args:

  • Url (string)
  • Name (string)

Returns:

  • Oracle (DlcOracle)
AddOracle

Args:

  • Key (string)
  • Name (string)

Returns:

  • Oracle (DlcOracle)
NewContract

Args: empty object

Returns:

  • Contract (DlcContract)
ListContracts

Args: empty object

Returns:

  • Contracts (DlcContract list)
GetContract

Args:

  • Idx (uint64)

Returns:

  • Contract (DlcContract)
SetContractOracle

Args:

  • CIdx (uint64)
  • OIdx (uint64)

Returns:

  • Success (bool)
SetContractDatafeed

Args:

  • CIdx (uint64)
  • Feed (uint64)

Returns:

  • Success (bool)
SetContractRPoint

Args:

  • CIdx (uint64)
  • RPoint (33 byte list)

Returns:

  • Success (bool)
SetContractFunding

Args:

  • CIdx (uint64)
  • OutAmount (int64)
  • TheirAmount (int64)
SetContractDivision

Args:

  • CIdx (uint64)
  • ValueFullyOurs (int64)
  • ValueFullyTheirs (int64)

Returns:

  • Success (bool)
SetContractCoinType

Args:

  • CIdx (uint64)
  • CoinType (uint32)

Returns:

  • Success (bool)
OfferContract

Args:

  • CIdx (uint64)
  • PeerIdx (uint32)

Returns:

  • Success (bool)
ContractRespond

Args:

  • AcceptOrDecline (bool)
  • CIdx (uint64)

Returns:

  • Success (bool)

True for accept, false for decline.

SettleContract

Args:

  • CIdx (uint64)
  • OracleValue (int64)
  • OracleSig (32 byte list)

Returns:

  • Success (bool)
  • SettleTxHash (32 byte list)
  • ClaimTxHash (32 byte list)

netcmds

Listen

Args:

  • Port (string) (why is this a string lol)

Returns:

  • LisIpPorts (string list)
  • Adr (string)
Connect

Args:

  • LNAddr (string)

Returns:

  • Status (string)
  • PeerIdx (uint32)
AssignNickname

Args:

  • Peer (uint32)
  • Nickname (string)

Returns:

  • Status (string)
ListConnections

Args: none

Returns:

  • Connections (PeerInfo list)
  • MyPKH (string)
GetListeningPorts

Args: none

Returns:

  • LisIpPorts (string list)
  • Adr (string)
GetMessages

Args: none

Returns:

  • Status (string)
Say

Args:

  • Peer (uint32)
  • Message (string)

Returns:

  • Status (string)
Stop

Args: none

Returns:

  • Status (string)
GetChannelMap

Args: none

Returns:

  • Graph (string)

The string is formatted in the GraphViz .dot format.

towercmds

Watch

Args:

  • ChanIdx (uint32)
  • SendToPeer (uint32)

Returns:

  • Msg (string)

walletcmds

Balance

Args: none

Returns:

  • Balances (CoinBalReply list)
TxoList

Args: none

Returns:

  • Txos (TxoInfo list)
Send

Args:

  • DestArgs (string list)
  • Amts (int64 list)

Returns:

  • Txids (string list)
Sweep

Args:

  • DestAdr (string)
  • NumTx (uint32)
  • Drop (bool)

Returns:

  • Txids (string list)
Fanout

Args:

  • DestAdr (string)
  • NumOutputs (uint32)
  • AmtPerOutput (int64)

Returns:

  • Txids (string list)
SetFee

Args:

  • Fee (int64)
  • CoinType (uint32)

Returns:

  • CurrentFee (int64)
GetFee

Args:

  • CoinType (uint32)

Returns:

  • CurrentFee (int64)
Address

Args:

  • NumToMake (uint32)
  • CoinType (uint32)

Returns:

  • CoinTypes (uint32 list)
  • WitAddresses (string list)
  • LegacyAddresses (string list)

If you set NumToMake to 0, it'll return all the addresses of the type.

GetAddresses

Args: none

Returns:

  • CoinTypes (uint32 list)
  • WitAddresses (string list)
  • LegacyAddresses (string list)

Other Types

ChannelInfo
type ChannelInfo struct {
	OutPoint      string
	CoinType      uint32
	Closed        bool
	Capacity      int64
	MyBalance     int64
	Height        int32  // block height of channel fund confirmation
	StateNum      uint64 // Most recent commit number
	PeerIdx, CIdx uint32
	PeerID        string
	Data          [32]byte
	Pkh           [20]byte
	LastUpdate    uint64
}
Priv Info
type PrivInfo struct {
	OutPoint string
	Amt      int64
	Height   int32
	Delay    int32
	CoinType string
	Witty    bool
	PairKey  string

	WIF string
}
DlcOracle
type DlcOracle struct {
	Idx  uint64   // Index of the oracle for refencing in commands
	A    [33]byte // public key of the oracle
	Name string   // Name of the oracle for display purposes
	Url  string   // Base URL of the oracle, if its REST based (optional)
}
DlcContract
type DlcContract struct {
	// Index of the contract for referencing in commands
	Idx uint64
	// Index of the contract on the other peer (so we can reference it in
	// messages)
	TheirIdx uint64
	// Index of the peer we've offered the contract to or received the contract
	// from
	PeerIdx uint32
	// Coin type
	CoinType uint32
	// Pub keys of the oracle and the R point used in the contract
	OracleA, OracleR [33]byte
	// The time we expect the oracle to publish
	OracleTimestamp uint64
	// The payout specification
	Division []DlcContractDivision
	// The amounts either side are funding
	OurFundingAmount, TheirFundingAmount int64
	// PKH to which the contracts funding change should go
	OurChangePKH, TheirChangePKH [20]byte
	// Pubkey used in the funding multisig output
	OurFundMultisigPub, TheirFundMultisigPub [33]byte
	// Pubkey to be used in the commit script (combined with oracle pubkey
	// or CSV timeout)
	OurPayoutBase, TheirPayoutBase [33]byte
	// Pubkeyhash to which the contract pays out (directly)
	OurPayoutPKH, TheirPayoutPKH [20]byte
	// Status of the contract
	Status DlcContractStatus
	// Outpoints used to fund the contract
	OurFundingInputs, TheirFundingInputs []DlcContractFundingInput
	// Signatures for the settlement transactions
	TheirSettlementSignatures []DlcContractSettlementSignature
	// The outpoint of the funding TX we want to spend in the settlement
	// for easier monitoring
	FundingOutpoint wire.OutPoint
}
PeerInfo
type PeerInfo struct {
	PeerNumber uint32
	RemoteHost string
	LitAdr 	   string
	Nickname   string
}
CoinBalReply
type CoinBalReply struct {
	CoinType    uint32
	SyncHeight  int32 // height this wallet is synced to
	ChanTotal   int64 // total balance in channels
	TxoTotal    int64 // all utxos
	MatureWitty int64 // confirmed, spendable and witness
	FeeRate     int64 // fee per byte
}
TxoInfo
type TxoInfo struct {
	OutPoint string
	Amt      int64
	Height   int32
	Delay    int32
	CoinType string
	Witty    bool

	KeyPath string
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdrStringToOutscript

func AdrStringToOutscript(adr string) ([]byte, error)

AdrStringToOutscript converts an address string into an output script byte slice note that this ignores the prefix! Be careful not to mix networks. currently only works for testnet legacy addresses

func CoinTypeFromAdr

func CoinTypeFromAdr(adr string) uint32

Default to testnet for unknown / bad addrs.

func CoinTypeFromBechAdr

func CoinTypeFromBechAdr(adr string) (uint32, error)

Gives the cointype from an address string (if known)

func LndcRpcCanConnectLocally

func LndcRpcCanConnectLocally() bool

LndcRpcCanConnectLocally checks if we can connect to lit using the normal home directory. In that case, we read from the privkey.hex and use a different derivation than the nodeID to determine the private key. This key is authorized by default for remote control.

func LndcRpcCanConnectLocallyWithHomeDir

func LndcRpcCanConnectLocallyWithHomeDir(litHomeDir string) bool

LndcRpcCanConnectLocallyWithHomeDir checks if we can connect to lit given the home directory. In that case, we read from the privkey.hex and use a different derivation than the nodeID to determine the private key. This key is authorized by default for remote control.

func RPCListen

func RPCListen(rpcl *LitRPC, host string, port uint16)

func WebUIHandler

func WebUIHandler(w http.ResponseWriter, r *http.Request)

Types

type AddHTLCArgs

type AddHTLCArgs struct {
	ChanIdx  uint32
	Amt      int64
	LockTime uint32
	RHash    [32]byte
	Data     [32]byte
}

------------------------- HTLCs

type AddHTLCReply

type AddHTLCReply struct {
	StateIndex uint64
	HTLCIndex  uint32
}

type AddOracleArgs

type AddOracleArgs struct {
	Key  string
	Name string
}

type AddOracleReply

type AddOracleReply struct {
	Oracle *dlc.DlcOracle
}

type AddressArgs

type AddressArgs struct {
	NumToMake uint32
	CoinType  uint32
}

------------------------- address

type AddressReply

type AddressReply struct {
	CoinTypes       []uint32
	WitAddresses    []string
	LegacyAddresses []string
}

TODO Make this contain an array of structures not a structure of arrays.

type AssignNicknameArgs

type AssignNicknameArgs struct {
	Peer     uint32
	Nickname string
}

------------------------- name a connection

type BalanceReply

type BalanceReply struct {
	Balances []CoinBalReply
}

type ChanArgs

type ChanArgs struct {
	ChanIdx uint32
}

------------------------- cclose

type ChannelGraphReply

type ChannelGraphReply struct {
	Graph string
}

------------ Dump channel map

type ChannelInfo

type ChannelInfo struct {
	OutPoint      string
	CoinType      uint32
	Closed        bool
	Failed        bool
	Capacity      int64
	MyBalance     int64
	Height        int32  // block height of channel fund confirmation
	StateNum      uint64 // Most recent commit number
	PeerIdx, CIdx uint32
	PeerID        string
	Data          [32]byte
	Pkh           [20]byte
	HTLCs         []HTLCInfo
	LastUpdate    uint64
}

type ChannelListReply

type ChannelListReply struct {
	Channels []ChannelInfo
}

type ClaimHTLCArgs

type ClaimHTLCArgs struct {
	R [16]byte
}

type ClearHTLCArgs

type ClearHTLCArgs struct {
	ChanIdx uint32
	HTLCIdx uint32
	R       [16]byte
	Data    [32]byte
}

type ClearHTLCReply

type ClearHTLCReply struct {
	StateIndex uint64
}

type CoinArgs

type CoinArgs struct {
	CoinType uint32
}

type CoinBalReply

type CoinBalReply struct {
	CoinType    uint32
	SyncHeight  int32 // height this wallet is synced to
	ChanTotal   int64 // total balance in channels
	TxoTotal    int64 // all utxos
	MatureWitty int64 // confirmed, spendable and witness
	FeeRate     int64 // fee per byte
}

------------------------- balance BalReply is the reply when the user asks about their balance.

type ConInfo

type ConInfo struct {
	PeerNumber uint32
	RemoteHost string
}

type ConnectArgs

type ConnectArgs struct {
	LNAddr string
}

------------------------- connect

type ConnectReply

type ConnectReply struct {
	Status  string
	PeerIdx uint32
}

type ContractRespondArgs

type ContractRespondArgs struct {
	// True for accept, false for decline.
	AcceptOrDecline bool
	CIdx            uint64
}

type ContractRespondReply

type ContractRespondReply struct {
	Success bool
}

type DualFundArgs

type DualFundArgs struct {
	Peer        uint32 // who to make the channel with
	CoinType    uint32 // what coin to use
	OurAmount   int64  // what amount we will fund
	TheirAmount int64  // what amount we request them to fund
}

------------------------- dual fund

type DualFundRespondArgs

type DualFundRespondArgs struct {
	// True for accept, false for decline
	AcceptOrDecline bool
}

type DumpReply

type DumpReply struct {
	Privs []PrivInfo
}

type FanArgs

type FanArgs struct {
	DestAdr      string
	NumOutputs   uint32
	AmtPerOutput int64
}

------------------------- fanout

type FeeArgs

type FeeArgs struct {
	CoinType uint32
}

get fee

type FeeReply

type FeeReply struct {
	CurrentFee int64
}

type FundArgs

type FundArgs struct {
	Peer        uint32 // who to make the channel with
	CoinType    uint32 // what coin to use
	Capacity    int64  // later can be minimum capacity
	Roundup     int64  // ignore for now; can be used to round-up capacity
	InitialSend int64  // Initial send of -1 means "ALL"
	Data        [32]byte
}

------------------------- fund

type FundReply

type FundReply struct {
	Status     string
	ChanIdx    uint32
	FundHeight int32
}

type GetContractArgs

type GetContractArgs struct {
	Idx uint64
}

type GetContractReply

type GetContractReply struct {
	Contract *lnutil.DlcContract
}

type HTLCInfo

type HTLCInfo struct {
	Idx            uint32
	Incoming       bool
	Amt            int64
	RHash          [32]byte
	Locktime       uint32
	R              [16]byte
	Cleared        bool
	Clearing       bool
	ClearedOnChain bool
	InProg         bool
}

type ImportOracleArgs

type ImportOracleArgs struct {
	Url  string
	Name string
}

type ImportOracleReply

type ImportOracleReply struct {
	Oracle *dlc.DlcOracle
}

type ListConnectionsReply

type ListConnectionsReply struct {
	Connections []qln.SimplePeerInfo
	MyPKH       string
}

type ListContractsArgs

type ListContractsArgs struct {
}

type ListContractsReply

type ListContractsReply struct {
	Contracts []*lnutil.DlcContract
}

type ListOraclesArgs

type ListOraclesArgs struct {
}

type ListOraclesReply

type ListOraclesReply struct {
	Oracles []*dlc.DlcOracle
}

type ListenArgs

type ListenArgs struct {
	Port int
}

type ListeningPortsReply

type ListeningPortsReply struct {
	LisIpPorts []string
	Adr        string
}

type LitRPC

type LitRPC struct {
	Node      *qln.LitNode
	OffButton chan bool
}

func (*LitRPC) AddHTLC

func (r *LitRPC) AddHTLC(args AddHTLCArgs, reply *AddHTLCReply) error

func (*LitRPC) AddOracle

func (r *LitRPC) AddOracle(args AddOracleArgs, reply *AddOracleReply) error

AddOracle manually adds an oracle from its PubKey A

func (*LitRPC) Address

func (r *LitRPC) Address(args *AddressArgs, reply *AddressReply) error

func (*LitRPC) AssignNickname

func (r *LitRPC) AssignNickname(args AssignNicknameArgs, reply *StatusReply) error

func (*LitRPC) Balance

func (r *LitRPC) Balance(args *NoArgs, reply *BalanceReply) error

func (*LitRPC) BreakChannel

func (r *LitRPC) BreakChannel(args ChanArgs, reply *StatusReply) error

------------------------- break

func (*LitRPC) ChannelList

func (r *LitRPC) ChannelList(args ChanArgs, reply *ChannelListReply) error

ChannelList sends back a list of every (open?) channel with some info for each.

func (*LitRPC) ClaimHTLC

func (r *LitRPC) ClaimHTLC(args *ClaimHTLCArgs, reply *TxidsReply) error

func (*LitRPC) ClearHTLC

func (r *LitRPC) ClearHTLC(args ClearHTLCArgs, reply *ClearHTLCReply) error

func (*LitRPC) CloseChannel

func (r *LitRPC) CloseChannel(args ChanArgs, reply *StatusReply) error

reply with status string CloseChannel is a cooperative closing of a channel to a specified address.

func (*LitRPC) Connect

func (r *LitRPC) Connect(args ConnectArgs, reply *ConnectReply) error

func (*LitRPC) ContractRespond

func (r *LitRPC) ContractRespond(args ContractRespondArgs, reply *ContractRespondReply) error

DeclineContract declines an offered contract

func (*LitRPC) DualFundChannel

func (r *LitRPC) DualFundChannel(args DualFundArgs, reply *StatusReply) error

func (*LitRPC) DualFundRespond

func (r *LitRPC) DualFundRespond(args DualFundRespondArgs, reply *StatusReply) error

func (*LitRPC) DumpPrivs

func (r *LitRPC) DumpPrivs(args NoArgs, reply *DumpReply) error

DumpPrivs returns WIF private keys for every utxo and channel

func (*LitRPC) Fanout

func (r *LitRPC) Fanout(args FanArgs, reply *TxidsReply) error

func (*LitRPC) FundChannel

func (r *LitRPC) FundChannel(args FundArgs, reply *FundReply) error

func (*LitRPC) GetAddresses

func (r *LitRPC) GetAddresses(args *NoArgs, reply *AddressReply) error

More human-readable replies

func (*LitRPC) GetChannelMap

func (r *LitRPC) GetChannelMap(args NoArgs, reply *ChannelGraphReply) error

func (*LitRPC) GetContract

func (r *LitRPC) GetContract(args GetContractArgs,
	reply *GetContractReply) error

GetContract returns a single contract based on its index

func (*LitRPC) GetFee

func (r *LitRPC) GetFee(args *FeeArgs, reply *FeeReply) error

Fee gets the fee rate for a wallet.

func (*LitRPC) GetListeningPorts

func (r *LitRPC) GetListeningPorts(args NoArgs, reply *ListeningPortsReply) error

func (*LitRPC) GetMessages

func (r *LitRPC) GetMessages(args NoArgs, reply *StatusReply) error

------- receive chat

func (*LitRPC) ImportOracle

func (r *LitRPC) ImportOracle(args ImportOracleArgs,
	reply *ImportOracleReply) error

ImportOracle imports an oracle from a REST API

func (*LitRPC) ListConnections

func (r *LitRPC) ListConnections(args NoArgs, reply *ListConnectionsReply) error

func (*LitRPC) ListContracts

func (r *LitRPC) ListContracts(args ListContractsArgs,
	reply *ListContractsReply) error

ListContracts returns all contracts know to LIT

func (*LitRPC) ListMultihopPayments

func (r *LitRPC) ListMultihopPayments(args NoArgs, reply *MultihopPaymentsReply) error

func (*LitRPC) ListOracles

func (r *LitRPC) ListOracles(args ListOraclesArgs,
	reply *ListOraclesReply) error

ListOracles returns all oracles know to LIT

func (*LitRPC) ListPendingRemoteControlAuthRequests

func (r *LitRPC) ListPendingRemoteControlAuthRequests(args NoArgs, reply *RCPendingAuthRequestsReply) error

func (*LitRPC) Listen

func (r *LitRPC) Listen(args ListenArgs, reply *ListeningPortsReply) error

func (*LitRPC) NewContract

func (r *LitRPC) NewContract(args NewContractArgs,
	reply *NewContractReply) error

NewContract creates a new draft contract

func (*LitRPC) OfferContract

func (r *LitRPC) OfferContract(args OfferContractArgs,
	reply *OfferContractReply) error

OfferContract offers a contract to a (connected) peer

func (*LitRPC) PayMultihop

func (r *LitRPC) PayMultihop(args PayMultihopArgs, reply *StatusReply) error

PayMultihop tries to find a multi-hop path to send the payment along

func (*LitRPC) PendingDualFund

func (r *LitRPC) PendingDualFund(args PendingDualFundRequestsArgs, reply *PendingDualFundReply) error

func (*LitRPC) Push

func (r *LitRPC) Push(args PushArgs, reply *PushReply) error

func (*LitRPC) RemoteControlAuth

func (r *LitRPC) RemoteControlAuth(args RCAuthArgs, reply *StatusReply) error

func (*LitRPC) RequestRemoteControlAuthorization

func (r *LitRPC) RequestRemoteControlAuthorization(args RCRequestAuthArgs, reply *StatusReply) error

func (*LitRPC) Say

func (r *LitRPC) Say(args SayArgs, reply *StatusReply) error

func (*LitRPC) Send

func (r *LitRPC) Send(args SendArgs, reply *TxidsReply) error

func (*LitRPC) SetContractCoinType

func (r *LitRPC) SetContractCoinType(args SetContractCoinTypeArgs,
	reply *SetContractCoinTypeReply) error

SetContractCoinType sets the coin type the contract will be in. Note that a peer that doesn't have a wallet of that type will automatically decline the contract.

func (*LitRPC) SetContractDatafeed

func (r *LitRPC) SetContractDatafeed(args SetContractDatafeedArgs,
	reply *SetContractDatafeedReply) error

SetContractDatafeed sets a data feed by index to a contract, which is then used to fetch the R-point from the oracle's REST API

func (*LitRPC) SetContractDivision

func (r *LitRPC) SetContractDivision(args SetContractDivisionArgs,
	reply *SetContractDivisionReply) error

SetContractDivision sets how the contract is settled. The parameters indicate at what value the full contract funds are ours, and at what value they are full funds are for our peer. Between those values, the contract will divide the contract funds linearly

func (*LitRPC) SetContractFunding

func (r *LitRPC) SetContractFunding(args SetContractFundingArgs,
	reply *SetContractFundingReply) error

SetContractFunding sets the division in funding the channel. The arguments decide how much we're funding and how much we expect the peer we offer the contract to to fund

func (*LitRPC) SetContractOracle

func (r *LitRPC) SetContractOracle(args SetContractOracleArgs,
	reply *SetContractOracleReply) error

SetContractOracle assigns a known oracle to a (new) contract

func (*LitRPC) SetContractRPoint

func (r *LitRPC) SetContractRPoint(args SetContractRPointArgs,
	reply *SetContractRPointReply) error

SetContractRPoint manually sets the R-point for the contract using a pubkey

func (*LitRPC) SetContractSettlementTime

func (r *LitRPC) SetContractSettlementTime(args SetContractSettlementTimeArgs,
	reply *SetContractSettlementTimeReply) error

SetContractSettlementTime sets the time this contract will settle (the unix epoch)

func (*LitRPC) SetFee

func (r *LitRPC) SetFee(args *SetFeeArgs, reply *FeeReply) error

SetFee allows you to set a fee rate for a wallet.

func (*LitRPC) SettleContract

func (r *LitRPC) SettleContract(args SettleContractArgs,
	reply *SettleContractReply) error

SettleContract uses the value and signature from the oracle to settle the contract and send the equivalent settlement transaction to the blockchain. It will subsequently claim the contract output back to our wallet

func (*LitRPC) StateDump

func (r *LitRPC) StateDump(args StateDumpArgs, reply *StateDumpReply) error

StateDump dumps all of the meta data for the state commitments of a channel

func (*LitRPC) Stop

func (r *LitRPC) Stop(args NoArgs, reply *StatusReply) error

func (*LitRPC) Sweep

func (r *LitRPC) Sweep(args SweepArgs, reply *TxidsReply) error

func (*LitRPC) TestLog

func (r *LitRPC) TestLog(arg string, reply *string) error

func (*LitRPC) TxoList

func (r *LitRPC) TxoList(args *NoArgs, reply *TxoListReply) error

TxoList sends back a list of all non-channel utxos

func (*LitRPC) Watch

func (r *LitRPC) Watch(args WatchArgs, reply *WatchReply) error

type LndcRpcClient

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

LndcRpcClient can be used to remotely talk to a lit node over LNDC, making remote control instructions over the remote control interface. It uses a regular lndc.Conn to connect to lit over port 2448, and sends RemoteControlRpcRequestMsg to it, and receives RemoteControlRpcResponseMsg

func NewLndcRpcClient

func NewLndcRpcClient(address string, key *koblitz.PrivateKey) (*LndcRpcClient, error)

NewLndcRpcClient creates a new LNDC client using the given private key, which is arbitrary. It will then connect to the lit node specified in address, and can then exchange remote control calls with it. In order to succesfully execute command, the given key must be authorized in the lit instance we're connecting to.

func NewLocalLndcRpcClient

func NewLocalLndcRpcClient() (*LndcRpcClient, error)

NewLocalLndcRpcClient is an overload for NewLocalLndcRpcClientWithHomeDirAndPort using the default home dir and port

func NewLocalLndcRpcClientWithHomeDirAndPort

func NewLocalLndcRpcClientWithHomeDirAndPort(litHomeDir string, port uint32) (*LndcRpcClient, error)

NewLocalLndcRpcClientWithHomeDirAndPort loads up privkey.hex, and derives the local lit node's address from it, as well as derives the default remote control private key from it. Then it will connect to the local lit instance.

func NewLocalLndcRpcClientWithPort

func NewLocalLndcRpcClientWithPort(port uint32) (*LndcRpcClient, error)

NewLocalLndcRpcClientWithPort is an overload for NewLocalLndcRpcClientWithHomeDirAndPort using the default home dir

func (*LndcRpcClient) Call

func (cli *LndcRpcClient) Call(serviceMethod string, args interface{}, reply interface{}) error

func (*LndcRpcClient) Close

func (cli *LndcRpcClient) Close() error

func (*LndcRpcClient) ReceiveLoop

func (cli *LndcRpcClient) ReceiveLoop()

ReceiveLoop reads messages from the LNDC connection and check if they are RPC responses

type LndcRpcWebsocketProxy

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

LndcRpcWebsocketProxy is a regular websocket server that translates the received requests into a call on the new LNDC based remote control transport

func NewLndcRpcWebsocketProxy

func NewLndcRpcWebsocketProxy(litAdr string, key *koblitz.PrivateKey) (*LndcRpcWebsocketProxy, error)

NewLndcRpcWebsocketProxy is an overload to NewLndcRpcWebsocketProxyWithLndc connecting to the given lit node specified by litAdr, identifying with the given key.

func NewLndcRpcWebsocketProxyWithLndc

func NewLndcRpcWebsocketProxyWithLndc(lndcRpcClient *LndcRpcClient) *LndcRpcWebsocketProxy

NewLndcRpcWebsocketProxyWithLndc creates a new proxy that listens on the websocket port and translates requests into remote control messages over lndc transport.

func NewLocalLndcRpcWebsocketProxy

func NewLocalLndcRpcWebsocketProxy() (*LndcRpcWebsocketProxy, error)

NewLocalLndcRpcWebsocketProxy is an overload to NewLndcRpcWebsocketProxyWithLndc connecting to the local lit using a derived key from the locally stored privkey.hex using the default home dir and port

func NewLocalLndcRpcWebsocketProxyWithHomeDirAndPort

func NewLocalLndcRpcWebsocketProxyWithHomeDirAndPort(litHomeDir string, port uint32) (*LndcRpcWebsocketProxy, error)

NewLocalLndcRpcWebsocketProxy is an overload to NewLndcRpcWebsocketProxyWithLndc connecting to the local lit using a derived key from the locally stored privkey.hex using the given homedir and the given port

func NewLocalLndcRpcWebsocketProxyWithPort

func NewLocalLndcRpcWebsocketProxyWithPort(port uint32) (*LndcRpcWebsocketProxy, error)

NewLocalLndcRpcWebsocketProxy is an overload to NewLndcRpcWebsocketProxyWithLndc connecting to the local lit using a derived key from the locally stored privkey.hex using the default home dir and the given port

func (*LndcRpcWebsocketProxy) Listen

func (p *LndcRpcWebsocketProxy) Listen(host string, port uint16)

Listen starts listening on the given host and port for websocket requests This function blocks unless an error occurs, so you should call it as a goroutine

type MultihopPaymentInfo

type MultihopPaymentInfo struct {
	RHash     [32]byte
	R         [16]byte
	Amt       int64
	Path      []string
	Succeeded bool
}

------------ Show multihop payments

type MultihopPaymentsReply

type MultihopPaymentsReply struct {
	Payments []MultihopPaymentInfo
}

type NewContractArgs

type NewContractArgs struct {
}

type NewContractReply

type NewContractReply struct {
	Contract *lnutil.DlcContract
}

type NoArgs

type NoArgs struct {
}

type OfferContractArgs

type OfferContractArgs struct {
	CIdx    uint64
	PeerIdx uint32
}

type OfferContractReply

type OfferContractReply struct {
	Success bool
}

type OiOoReadWriter

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

OiOoReadWriter is for One-In-One-Out Reader/Writer and I hope to god that it works.

func (OiOoReadWriter) Close

func (o OiOoReadWriter) Close() error

func (OiOoReadWriter) Read

func (o OiOoReadWriter) Read(p []byte) (int, error)

func (OiOoReadWriter) Write

func (o OiOoReadWriter) Write(p []byte) (int, error)

type PayMultihopArgs

type PayMultihopArgs struct {
	DestLNAdr      string
	DestCoinType   uint32
	OriginCoinType uint32
	Amt            int64
}

type PendingDualFundReply

type PendingDualFundReply struct {
	Pending         bool
	PeerIdx         uint32
	CoinType        uint32
	TheirAmount     int64
	RequestedAmount int64
}

type PendingDualFundRequestsArgs

type PendingDualFundRequestsArgs struct {
}

type PrivInfo

type PrivInfo struct {
	OutPoint string
	Amt      int64
	Height   int32
	Delay    int32
	CoinType string
	Witty    bool
	PairKey  string

	WIF string
}

------------------------- dumpPriv

type PushArgs

type PushArgs struct {
	ChanIdx uint32
	Amt     int64
	Data    [32]byte
}

------------------------- push

type PushReply

type PushReply struct {
	StateIndex uint64
}

type RCAuthArgs

type RCAuthArgs struct {
	PubKey        []byte
	Authorization *qln.RemoteControlAuthorization
}

type RCPendingAuthRequestsReply

type RCPendingAuthRequestsReply struct {
	PubKeys [][33]byte
}

type RCRequestAuthArgs

type RCRequestAuthArgs struct {
	PubKey [33]byte
}

type SayArgs

type SayArgs struct {
	Peer    uint32
	Message string
}

type SendArgs

type SendArgs struct {
	DestAddrs []string
	Amts      []int64
}

------------------------- send

type SetContractCoinTypeArgs

type SetContractCoinTypeArgs struct {
	CIdx     uint64
	CoinType uint32
}

type SetContractCoinTypeReply

type SetContractCoinTypeReply struct {
	Success bool
}

type SetContractDatafeedArgs

type SetContractDatafeedArgs struct {
	CIdx uint64
	Feed uint64
}

type SetContractDatafeedReply

type SetContractDatafeedReply struct {
	Success bool
}

type SetContractDivisionArgs

type SetContractDivisionArgs struct {
	CIdx             uint64
	ValueFullyOurs   int64
	ValueFullyTheirs int64
}

type SetContractDivisionReply

type SetContractDivisionReply struct {
	Success bool
}

type SetContractFundingArgs

type SetContractFundingArgs struct {
	CIdx        uint64
	OurAmount   int64
	TheirAmount int64
}

type SetContractFundingReply

type SetContractFundingReply struct {
	Success bool
}

type SetContractOracleArgs

type SetContractOracleArgs struct {
	CIdx uint64
	OIdx uint64
}

type SetContractOracleReply

type SetContractOracleReply struct {
	Success bool
}

type SetContractRPointArgs

type SetContractRPointArgs struct {
	CIdx   uint64
	RPoint [33]byte
}

type SetContractRPointReply

type SetContractRPointReply struct {
	Success bool
}

type SetContractSettlementTimeArgs

type SetContractSettlementTimeArgs struct {
	CIdx uint64
	Time uint64
}

type SetContractSettlementTimeReply

type SetContractSettlementTimeReply struct {
	Success bool
}

type SetFeeArgs

type SetFeeArgs struct {
	Fee      int64
	CoinType uint32
}

set fee

type SettleContractArgs

type SettleContractArgs struct {
	CIdx        uint64
	OracleValue int64
	OracleSig   [32]byte
}

type SettleContractReply

type SettleContractReply struct {
	Success      bool
	SettleTxHash [32]byte
	ClaimTxHash  [32]byte
}

type StateDumpArgs

type StateDumpArgs struct {
}

------------------------- statedump

type StateDumpReply

type StateDumpReply struct {
	Txs []qln.JusticeTx
}

type StatusReply

type StatusReply struct {
	Status string
}

type SweepArgs

type SweepArgs struct {
	DestAdr string
	NumTx   uint32
	Drop    bool
}

------------------------- sweep

type TxidsReply

type TxidsReply struct {
	Txids []string
}

type TxoInfo

type TxoInfo struct {
	OutPoint string
	Amt      int64
	Height   int32
	Delay    int32
	CoinType string
	Witty    bool

	KeyPath string
}

type TxoListReply

type TxoListReply struct {
	Txos []TxoInfo
}

type WatchArgs

type WatchArgs struct {
	ChanIdx, SendToPeer uint32
}

type WatchReply

type WatchReply struct {
	Msg string
}

Jump to

Keyboard shortcuts

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