-
Notifications
You must be signed in to change notification settings - Fork 110
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
Integrate trustedcoin clightning plugin #597
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3197338
trustedcoin: add pkg
neverupdate 35fc3a2
trustedcoin: add module
neverupdate c747ddb
readme: reference trustedcoin source
neverupdate 3d26f72
clightning-plugins: add trustedcoin
neverupdate 5b5e769
trustedcoin: fix shellcheck
seberm 8c00c26
trustedcoin: update to v0.6.1
seberm 4942130
tests: add tests for trustedcoin clightning plugin
seberm 67f2eb2
trustedcoin: explicitly use the HTTPS_PROXY for external connections
seberm a3c6547
docs: trustedcoin: add info about possible problems
seberm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ in { | |
./feeadjuster.nix | ||
./prometheus.nix | ||
./summary.nix | ||
./trustedcoin.nix | ||
./zmq.nix | ||
]; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
let cfg = config.services.clightning.plugins.trustedcoin; in | ||
{ | ||
options.services.clightning.plugins.trustedcoin = { | ||
enable = mkEnableOption "Trustedcoin (clightning plugin)"; | ||
package = mkOption { | ||
type = types.package; | ||
default = config.nix-bitcoin.pkgs.trustedcoin; | ||
defaultText = "config.nix-bitcoin.pkgs.trustedcoin"; | ||
description = mdDoc "The package providing trustedcoin binaries."; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
services.clightning.extraConfig = '' | ||
plugin=${cfg.package}/bin/trustedcoin | ||
disable-plugin=bcli | ||
''; | ||
|
||
# Trustedcoin does not honor the clightning's proxy configuration. | ||
# Ref.: https://github.com/nbd-wtf/trustedcoin/pull/19 | ||
systemd.services.clightning.environment = mkIf (config.services.clightning.proxy != null) { | ||
HTTPS_PROXY = "socks5://${config.services.clightning.proxy}"; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ lib, buildGoModule, fetchFromGitHub }: | ||
|
||
buildGoModule rec { | ||
pname = "trustedcoin"; | ||
version = "0.6.1"; | ||
src = fetchFromGitHub { | ||
owner = "nbd-wtf"; | ||
repo = pname; | ||
rev = "v${version}"; | ||
sha256 = "sha256-UNQjxhAT0mK1In7vUtIoMoMNBV+0wkrwbDmm7m+0R3o="; | ||
}; | ||
|
||
vendorSha256 = "sha256-xvkK9rMQlXTnNyOMd79qxVSvhgPobcBk9cq4/YWbupY="; | ||
|
||
subPackages = [ "." ]; | ||
|
||
meta = with lib; { | ||
description = "Light bitcoin node implementation"; | ||
homepage = "https://github.com/nbd-wtf/trustedcoin"; | ||
maintainers = with maintainers; [ seberm fort-nix ]; | ||
platforms = platforms.linux; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /usr/bin/env nix-shell | ||
#! nix-shell -i bash -p git gnupg curl jq | ||
set -euo pipefail | ||
|
||
|
||
TMPDIR="$(mktemp -d -p /tmp)" | ||
trap 'rm -rf $TMPDIR' EXIT | ||
cd "$TMPDIR" | ||
|
||
echo "Fetching latest release" | ||
repo='nbd-wtf/trustedcoin' | ||
latest=$(curl --location --silent --show-error https://api.github.com/repos/${repo}/releases/latest | jq -r .tag_name) | ||
echo "Latest release is $latest" | ||
git clone --depth 1 --branch "$latest" "https://github.com/${repo}" 2>/dev/null | ||
cd trustedcoin | ||
|
||
echo "tag: $latest" | ||
git checkout -q "tags/$latest" | ||
rm -rf .git | ||
nix --extra-experimental-features nix-command hash path . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I am still not sure if it makes sense to run trustedcoin scenario regurarly in CI.