Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test lspd without binary #230

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/actions/build-lspd/action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Build LSPD'
description: 'Build LSPD and upload the build artifacts.'
name: 'Build LSPD CLN plugin'
description: 'Build LSPD CLN plugin and upload the build artifacts.'
runs:
using: 'composite'
steps:
Expand All @@ -14,13 +14,11 @@ runs:
go-version: '1.21'

- name: build
run: make release-all
run: make release-plugin
shell: bash

- name: upload lspd artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
lspd
lspd_cln_plugin
path: lspd_cln_plugin
5 changes: 1 addition & 4 deletions .github/actions/test-lspd/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ runs:
name: build-artifacts

- name: Set permissions
run: |
chmod 755 lspd
chmod 755 lspd_cln_plugin
run: chmod 755 lspd_cln_plugin
shell: bash

- name: Cache LND client
Expand Down Expand Up @@ -127,7 +125,6 @@ runs:
--lndexec ~/go_lnd_lsp/bin/lnd \
--lndmobileexec ~/go_lnd_client/bin/lnd \
--clnpluginexec ${{ github.workspace }}/lspd_cln_plugin \
--lspdexec ${{ github.workspace }}/lspd \
--preservelogs \
--testdir /home/runner/test_state || echo "step_failed=true" >> $GITHUB_ENV
shell: bash
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ on:
pull_request:
env:
BITCOIN_VERSION: '25.0'
LSP_REF: 'breez-node-v0.17.2-beta'
CLIENT_REF: 'v0.16.4-breez-3'
LSP_REF: 'breez-node-v0.17.5-beta'
CLIENT_REF: 'v0.17.5-breez-3'
GO_VERSION: '^1.19'
CLN_VERSION: 'v24.02.2'
CLN_VERSION: 'v24.05'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,11 @@ go test -timeout 20m -v ./itest \
--lndexec /full/path/to/lnd \
--lndmobileexec /full/path/to/lnd \
--clnpluginexec /full/path/to/lspd_cln_plugin \
--lspdexec /full/path/to/lspd \
```

- Required: `--lightningdexec` Full path to lightningd development build executable. Defaults to `lightningd` in `$PATH`.
- Required: `--lndexec` Full path to LSP LND executable. Defaults to `lnd` in `$PATH`.
- Required: `--lndmobileexec` Full path to Breez mobile client LND executable. No default.
- Required: `--lspdexec` Full path to `lspd` executable to test. Defaults to `lspd` in `$PATH`.
- Required: `--clnpluginexec` Full path to the lspd cln plugin executable. No default.
- Recommended: `--bitcoindexec` Full path to `bitcoind`. Defaults to `bitcoind` in `$PATH`.
- Recommended: `--bitcoincliexec` Full path to `bitcoin-cli`. Defaults to `bitcoin-cli` in `$PATH`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package lspd

import (
"context"
Expand Down
20 changes: 3 additions & 17 deletions cln/cln_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,7 @@ func (c *ClnClient) GetChannel(peerID []byte, channelPoint wire.OutPoint) (*ligh
}

for _, c := range channels.Channels {
if c.State == nil {
log.Printf("Channel '%+v' with peer '%x' doesn't have a state (yet).",
c.ShortChannelId, c.PeerId)
continue
}
state := int32(*c.State)
state := int32(c.State)
log.Printf("getChannel destination: %s, scid: %+v, local alias: %+v, "+
"FundingTxID:%x, State:%+v ", pubkey, c.ShortChannelId,
c.Alias.Local, c.FundingTxid, c.State)
Expand Down Expand Up @@ -267,12 +262,7 @@ func (c *ClnClient) GetClosedChannels(

lookup := make(map[string]uint64)
for _, c := range channels.Channels {
if c.State == nil {
log.Printf("Channel '%+v' with peer '%x' doesn't have a state (yet).",
c.ShortChannelId, c.PeerId)
continue
}
state := int32(*c.State)
state := int32(c.State)

if slices.Contains(CLOSING_STATUSES, state) {
if c.ShortChannelId == nil {
Expand Down Expand Up @@ -371,11 +361,7 @@ func (c *ClnClient) WaitChannelActive(peerID []byte, deadline time.Time) error {
)
if err == nil {
for _, c := range peer.Channels {
if c.State == nil {
continue
}

if slices.Contains(OPEN_STATUSES, int32(*c.State)) {
if slices.Contains(OPEN_STATUSES, int32(c.State)) {
return nil
}
}
Expand Down
Loading
Loading