chrisguida / smaug

`smaug` watches your bitcoin treasury with a meticulous eye
MIT License
13 stars 3 forks source link

flake with overlay for cln #23

Closed jurraca closed 11 months ago

jurraca commented 1 year ago

This isn't fully right, but if you want to use a different version of CLN in your repo, you would use an overlay like this. Basically, you change the src attribute of the nixpkgs clightning package to point to lisa's onchain-notif branch and create a package and devshell from there. I can't seem to get the eachDefaultSystem thing to work correctly but this should get you started.

chrisguida commented 1 year ago

How can I recreate this?

I can't seem to get the eachDefaultSystem thing to work correctly but this should get you started.

I'm actually not seeing any errors now since my fix.

jurraca commented 1 year ago

cleaned up some stuff and been hitting my head against a wall with this overlay -- it works but it's not pulling the right CLN version from nifty's fork and I have no clue why. I'm fairly sure this is the right syntax...

chrisguida commented 1 year ago

What's still left to do on this?

Also I noticed that the build isn't working anymore without openssl, can you add that back?

jurraca commented 1 year ago

todo:

jurraca commented 1 year ago

i get it now -- this has been working fine actually. I was just checking the version of the binary it output via the command line. the version is a set string in the upstream / nixpkgs clightning/default.nix expression, so it stayed the same with the overlay. We need to override it as well. see prev commit

jurraca commented 1 year ago

this builds for me -- can you check @chrisguida ?

chrisguida commented 1 year ago

Yep, builds! It was building before for me too, but now it has the version you added. Not sure if we should stick with this since the version is actually a special commit on a special fork, but it's definitely closer than before!

I added bitcoind to the dev shell so that we can immediately run source contrib/startup_regtest.sh from the lightning repo (currently you need to have this checked out... any way we can add it to the smaug repo here without duplicating the source for the bash script?)

This is very close to being done!

chrisguida commented 1 year ago

Another thing I'd like to add if possible is a cargo build of smaug itself, and a command to start the plugin, possibly with our own override of startup_regtest.sh... what do you think?

chrisguida commented 1 year ago

Perhaps the dev should be expected to run cargo build? so maybe just the l1-cli plugin start bash alias?

jurraca commented 1 year ago

Another thing I'd like to add if possible is a cargo build of smaug itself

nix develop then cargo build

possibly with our own override of startup_regtest.sh

so contrib/startup_regtest.sh lives in the clightning repo. It should be possible to copy the script file by modifying its buildPhase or something but i haven't figured it out yet.

jurraca commented 1 year ago

thanks to @samrose for the assist