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

Bug: Update instructions to create CLN custom node #863

Open
toneloc opened this issue Mar 21, 2024 · 5 comments · May be fixed by #879
Open

Bug: Update instructions to create CLN custom node #863

toneloc opened this issue Mar 21, 2024 · 5 comments · May be fixed by #879
Labels
bug Something isn't working

Comments

@toneloc
Copy link

toneloc commented Mar 21, 2024

Describe the bug

I am trying to create a custom CLN node with version 24.02.1 to try dual-funded channels.

The instructions here - https://github.com/jamaljsr/polar/blob/master/docs/custom-nodes.md#c-lightning - seem to be out of date.

I would like to help update those.

To Reproduce

Following the above instructions with the Dockerfile listed gives us an error, where it appears to fail fetching some packages:

#13 1.543 E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-arm64/Packages 404 Not Found [IP: 151.101.66.132 80] ... etc

So, I modified the Dockerfile, using the file on the main CLN repo, and modifying the end of the file.

I used this Docker file - https://github.com/toneloc/stable-channels/blob/main/Dockerfile - I annotate the end of it (see "Polar Modification"). I used the same docker-entrypoint.sh file as in the above instructions.

This image appeared to build okay.

I then created a custom image on the Polar UI. I added the flag --developer to startup commands. Note: the new Dockerfile from CLN team did not have the ARG DEVELOPER=0 parameter in there. This is why I added the flag here instead.

Then, I tried to start up a 1 BTC core / 1 custom CLN network.

I got this error:

Unable to connect to c-lightning node
ENOENT: no such file or directory, open '/Users/t/.polar/networks/6/volumes/c-lightning/alice/rest-api/access.macaroon'

Where do these get created and copied?

Expected behavior

I would expect the custom node to start okay.

Screenshots

Screenshot 2024-03-21 at 1 52 46 PM

Desktop (please complete the following information):

  • I am on Mac Ventura 13.5.
  • Polar version 2.1.0.
  • Docker Desktop version 4.18.0
  • Docker Engine version 20.10.24

Additional context

I would like to use dual-funded channels, which is on this version.

I would also like to include a custom plugin to try out. This is the plugin I want to try - https://github.com/toneloc/stable-channels

Thanks.

@toneloc toneloc added the bug Something isn't working label Mar 21, 2024
@jamaljsr
Copy link
Owner

Hey @toneloc, thanks for all of the details.

The instructions here - https://github.com/jamaljsr/polar/blob/master/docs/custom-nodes.md#c-lightning - seem to be out of date.

Yes, the exact Dockerfile is outdated. There's a note at the top of the doc that states "Note: The Dockerfiles for each implementation will likely change in the future. Please be mindful to make updates as needed when necessary." It would be too much work to keep this doc update to date with all of the implementation's releases. It's meant just to be a guide to point you in the right direction. You can check the Dockerfiles in the docker/c-lightning dir to see the exact files we use to build the images for Polar. Unfortunately, the c-lightning file is also a bit outdated due to some trouble I ran into in recent releases. See #774.

I got this error:

Unable to connect to c-lightning node
ENOENT: no such file or directory, open '/Users/t/.polar/networks/6/volumes/c-lightning/alice/rest-api/access.macaroon'

This seems like the access.macaroon file isn't being created by the c-lightning-REST plugin. Can you check the node's logs to see if the plugin is starting up correctly?

@toneloc
Copy link
Author

toneloc commented Mar 28, 2024

A few observations:

Here are Docker startup commands I am using:

lightningd
  --alias={{name}}
  --addr={{name}}
  --addr=0.0.0.0:9735
  --network=regtest
  --bitcoin-rpcuser={{rpcUser}}
  --bitcoin-rpcpassword={{rpcPass}}
  --bitcoin-rpcconnect={{backendName}}
  --bitcoin-rpcport=18443
  --log-level=debug
  --dev-bitcoind-poll=2
  --dev-fast-gossip
  --grpc-port=11001
  --log-file=-
  --log-file=/home/clightning/.lightning/debug.log
  --clnrest-port=8080
  --clnrest-protocol=http
  --developer

@jamaljsr
Copy link
Owner

Polar doesn't currently support the new REST APi included in CLN. It still requires the c-lightning-REST plugin. You would need to install this plugin in your Docker like Polar does here. Also, you'd have to keep these flags in your startup command.

@toneloc
Copy link
Author

toneloc commented Mar 30, 2024

Got it. For this line: --plugin=/opt/c-lightning-rest/plugin.js looks like plugin.js is renamed clrest.js in updated library.

So I put --plugin=/opt/c-lightning-rest/clrest.js

Also had to add --developer flag.

Then got this message as well bitcoin-cli exited with code 255: qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

I am building docker image on Mac M2. I saw something about needing to specify the Linux build platform and tried that, but no luck anyway. Hope this helps.

@jamaljsr
Copy link
Owner

Got it. For this line: --plugin=/opt/c-lightning-rest/plugin.js looks like plugin.js is renamed clrest.js in updated library.

So I put --plugin=/opt/c-lightning-rest/clrest.js

Yes, I ran into that issue also. We chose to rename the file after installing the plugin to avoid breaking backwards compatibility with older nodes in Polar.

Then got this message as well bitcoin-cli exited with code 255: qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

In Polar we use separate Dockerfiles for x64 and arm64 builds. You can find them in the c-lightning dir. The commands we use to build them and the the docker/README.md file if you want to use them as a reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants