-
Notifications
You must be signed in to change notification settings - Fork 2k
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
lncli: Added support for backup/verify/restore of single chanpoint to/from file #7437
lncli: Added support for backup/verify/restore of single chanpoint to/from file #7437
Conversation
Someone should figure out whether this change makes sense. It seems to me that backup restoration currently does not support restoring a single chan_point from file. Whether this design is intentional is unknown to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. Looks good, just one nit. And you're right, it doesn't look like you can specify a single file when restoring just yet. Maybe it would make sense to add a --single_file
flag to the restorechanbackup
command as well in this PR?
Agreed! I'll look at implementing the restore part as well. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, thanks. Please take a look at the pull request check list and contribution guideline about commit structure and naming as well as other requirements (like running the linter).
@guggero Should I add an entry in release notes myself in this merge request? |
Yes. You can add a new file |
Not entirely sure why the CI is failing. Anything I can do to fix it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure why the CI is failing. Anything I can do to fix it?
There are known flakes that are under investigation so we'll see what's failed exactly. Meanwhile the linter should not fail tho, plus you may want to squash and clean your commit messages a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rebase and squash the commits into a single one for the changes in cmd/lncli
and one for the release notes please?
cmd/lncli/commands.go
Outdated
|
||
* A single channel packed SCB, which can be obtained from | ||
exportchanbackup. This should be passed in hex encoded format. | ||
|
||
* A packed multi-channel SCB, which couples several individual | ||
static channel backups in single blob. | ||
|
||
* A file path which points to a packed single-channel backup within a | ||
file, using the same format that lnd does in its channel.backup file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is longer than 80 characters (when using 8 spaces for the tab character in your editor), that's why the linter is complaining.
ee28e33
to
e118289
Compare
Rebased and squashed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK, LGTM 🎉
This will need to wait with being merged until after 0.16.0 final is out.
@ardevd can you rebase this on top of the |
318b6f2
to
0756093
Compare
Rebased now, but conflicts with release notes. |
Yes, can you resolve the conflict? When doing |
Should be good to go. |
No, it looks like you merged the target branch into yours. Instead you should rebase your branch on top of |
author ardevd <edvard.holst@gmail.com> 1676983861 +0100 committer ardevd <ardevd@users.noreply.github.com> 1677705118 +0100 Write to the specified file if the user specifies a chan_point for backup and also specifies an output file to write the backup to. Fixes lightningnetwork#7436
c5db55d
to
d1f961c
Compare
@guggero should be good to go now |
Looks good, thanks a lot, @ardevd. Integration test failures are flakes, as this is a CLI change only. |
Added support for backup/verify/restore of a single chanpoint to file.
Fixes #7436
Change Description
Previously, specifying both a chan_point and a output file to write the backup to resulted in the output file argument being ignored and json output to be written to the console. Effectively discarding the desire to write to file.
Also, there was no way to restore a single channel from a file nor was there a way to verify such backups.
Steps to Test
lncli exportchanbackup <chan_point> --output_file <filename>
lncli verifychanbackup --single_file <filename>
lncli restorechanbackup --single_file `Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]
in the commit message for small changes.