Versions in this module Expand all Collapse all v0 v0.2.97 Oct 15, 2022 Changes in this version + const BTC_BURN + const LBTC_BURN + var TIMEOUT = setTimeout() + func AssertWaitForBalanceChange(t *testing.T, node LightningNode, scid string, before uint64, ...) bool + func AssertWaitForChannelBalance(t *testing.T, node LightningNode, scid string, expected, delta float64, ...) bool + func BalanceChannel5050(node, peer *CLightningNode, scid string) error + func FreePort(port int) + func GenerateRandomString(n int) (string, error) + func GenerateToLiquidWallet(node *LiquidNode, walletName string, bitcoin float64) error + func GetFreePort() (port int, err error) + func GetFreePorts(n int) ([]int, error) + func ReadConfig(filename string) (map[string]string, error) + func RequireWaitForBalanceChange(t *testing.T, node LightningNode, scid string, before uint64, ...) + func RequireWaitForChannelBalance(t *testing.T, node LightningNode, scid string, expected, delta float64, ...) + func ScidFromLndChanId(id uint64) string + func SplitLnAddr(addr string) (string, string, int, error) + func SwitchWallet(node *LiquidNode, walletName string) error + func WaitFor(f WaitFunc, timeout time.Duration) error + func WaitForWithErr(f WaitFuncWithErr, timeout time.Duration) error + func WriteConfig(filename string, config map[string]string, regtestConfig map[string]string, ...) + type BitcoinNode struct + ConfigFile string + DataDir string + RpcPassword string + RpcPort int + RpcUser string + WalletName string + ZmqPubRawBlock string + ZmqPubRawTx string + func NewBitcoinNode(testDir string, id int) (*BitcoinNode, error) + func (n *BitcoinNode) GenerateBlocks(b int) error + func (n *BitcoinNode) ReturnAsset() string + func (n *BitcoinNode) Run(generateInitialBlocks bool) error + type CLightningNode struct + ConfigFile string + DataDir string + Info *glightning.NodeInfo + Port int + func NewCLightningNode(testDir string, bitcoin *BitcoinNode, id int) (*CLightningNode, error) + func (n *CLightningNode) AddInvoice(amtSat uint64, desc, label string) (payreq string, err error) + func (n *CLightningNode) Address() string + func (n *CLightningNode) Connect(peer LightningNode, waitForConnection bool) error + func (n *CLightningNode) FundWallet(sats uint64, mineBlock bool) (string, error) + func (n *CLightningNode) GetBtcBalanceSat() (sats uint64, err error) + func (n *CLightningNode) GetChannelBalanceSat(scid string) (sats uint64, err error) + func (n *CLightningNode) GetDataDir() string + func (n *CLightningNode) GetLatestInvoice() (string, error) + func (n *CLightningNode) GetMemoFromPayreq(bolt11 string) (string, error) + func (n *CLightningNode) GetScid(remote LightningNode) (string, error) + func (n *CLightningNode) Id() string + func (n *CLightningNode) IsBlockHeightSynced() (bool, error) + func (n *CLightningNode) IsChannelActive(scid string) (bool, error) + func (n *CLightningNode) IsConnected(remote LightningNode) (bool, error) + func (n *CLightningNode) OpenChannel(remote LightningNode, capacity uint64, ...) (string, error) + func (n *CLightningNode) PayInvoice(payreq string) error + func (n *CLightningNode) Run(waitForReady, waitForBitcoinSynced bool) error + func (n *CLightningNode) SendPay(bolt11, scid string) error + func (n *CLightningNode) Shutdown() error + func (n *CLightningNode) Stop() error + type CLightningProxy struct + Rpc *glightning.Lightning + func NewCLightningProxy(socketFileName, dataDir string) (*CLightningProxy, error) + func (p *CLightningProxy) StartProxy() error + type DaemonProcess struct + Cmd *exec.Cmd + CmdLine []string + StdErr *lockedWriter + StdOut *lockedWriter + func NewDaemonProcess(cmdline []string, prefix string) *DaemonProcess + func (d *DaemonProcess) AppendCmdLine(options []string) + func (d *DaemonProcess) HasLog(regex string) (bool, error) + func (d *DaemonProcess) Kill() + func (d *DaemonProcess) Prefix() string + func (d *DaemonProcess) Run() + func (d *DaemonProcess) WaitForLog(regex string, timeout time.Duration) error + func (d *DaemonProcess) WithCmd(cmd string) + type IdGetter interface + NextId func() int + type IntIdGetter struct + func (i *IntIdGetter) NextId() int + type LightningNode interface + AddInvoice func(amtSat uint64, desc, label string) (payreq string, err error) + Address func() (addr string) + Connect func(peer LightningNode, waitForConnection bool) error + FundWallet func(sats uint64, mineBlock bool) (addr string, err error) + GetBtcBalanceSat func() (sats uint64, err error) + GetChannelBalanceSat func(scid string) (sats uint64, err error) + GetLatestInvoice func() (payreq string, err error) + GetMemoFromPayreq func(payreq string) (memo string, err error) + GetScid func(peer LightningNode) (scid string, err error) + Id func() (id string) + IsBlockHeightSynced func() (bool, error) + IsChannelActive func(scid string) (bool, error) + IsConnected func(peer LightningNode) (bool, error) + OpenChannel func(peer LightningNode, capacity uint64, ...) (scid string, err error) + PayInvoice func(payreq string) error + Run func(waitForReady, swaitForBitcoinSynced bool) error + SendPay func(bolt11, scid string) error + Stop func() error + type LiquidNode struct + ConfigFile string + DataDir string + Network string + Port int + RpcPassword string + RpcPort int + RpcUser string + WalletName string + func NewLiquidNode(testDir string, bitcoin *BitcoinNode, id int) (*LiquidNode, error) + func (n *LiquidNode) GenerateBlocks(b int) error + func (n *LiquidNode) ReturnAsset() string + func (n *LiquidNode) Run(generateInitialBlocks bool) error + func (n *LiquidNode) SwitchWallet(wallet string) error + type LndNode struct + ConfigFile string + DataDir string + Info *lnrpc.GetInfoResponse + ListenPort int + MacaroonPath string + RpcPort int + TlsPath string + func NewLndNode(testDir string, bitcoin *BitcoinNode, id int, extraConfig map[string]string) (*LndNode, error) + func (n *LndNode) AddInvoice(amt uint64, desc, _ string) (payreq string, err error) + func (n *LndNode) Address() string + func (n *LndNode) ChanIdFromScid(scid string) (uint64, error) + func (n *LndNode) Connect(peer LightningNode, waitForConnection bool) error + func (n *LndNode) FundWallet(sats uint64, mineBlock bool) (string, error) + func (n *LndNode) GetBtcBalanceSat() (uint64, error) + func (n *LndNode) GetChannelBalanceSat(scid string) (sats uint64, err error) + func (n *LndNode) GetLatestInvoice() (payreq string, err error) + func (n *LndNode) GetMemoFromPayreq(bolt11 string) (string, error) + func (n *LndNode) GetScid(peer LightningNode) (scid string, err error) + func (n *LndNode) HasPendingHtlcOnChannel(scid string) (bool, error) + func (n *LndNode) Id() (id string) + func (n *LndNode) IsBlockHeightSynced() (bool, error) + func (n *LndNode) IsChannelActive(scid string) (bool, error) + func (n *LndNode) IsConnected(remote LightningNode) (bool, error) + func (n *LndNode) OpenChannel(peer LightningNode, capacity uint64, ...) (string, error) + func (n *LndNode) PayInvoice(payreq string) error + func (n *LndNode) Run(waitForReady, waitForBitcoinSynced bool) error + func (n *LndNode) SendPay(bolt11, _ string) error + func (n *LndNode) Stop() error + type LndRpcClient struct + Rpc lnrpc.LightningClient + RpcV2 routerrpc.RouterClient + func NewLndRpcClient(host, certPath, macaroonPath string, options ...grpc.DialOption) (*LndRpcClient, error) + type PortMap struct + type RpcProxy struct + Rpc jsonrpc.RPCClient + func NewRpcProxy(configFile string) (*RpcProxy, error) + func (p *RpcProxy) Call(method string, parameters ...interface{}) (*jsonrpc.RPCResponse, error) + func (p *RpcProxy) UpdateServiceUrl(url string) + type WaitFunc func() bool + type WaitFuncWithErr func() (bool, error)