Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Run revive linter
uses: docker://morphy/revive-action:v2
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Set up Go
uses: actions/setup-go@v6
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.25-alpine3.22 AS builder
FROM golang:1.25-alpine3.23 AS builder

ARG USER_ID=10001
ARG GROUP_ID=10001
Expand Down
12 changes: 10 additions & 2 deletions docker/mainnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@

This environment is designed to test hydrus against the mainnet network graph.

It spins up a light neutrino node that adds a peer and loads the graph to then execute hydrus on it.
It spins up a lightweight neutrino node that adds a peer and loads the graph to then execute hydrus on it.

Make sure the configuration has `dry-run` enabled:

```yml
agent.dry-run: true
agent.dry_run: true
```

### Setup

The first time the enviroment is spun out, the LND wallet must be initialized to start the daemon. For that, execute:

```console
lncli --tlscertpath /home/lnd/.lnd/tls.cert create
```

### Commands
Expand Down
17 changes: 1 addition & 16 deletions docker/mainnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ services:
context: ../../
image: hydrus/hydrus
container_name: hydrus
network_mode: service:tor
restart: on-failure:3
command: scores nodes
volumes:
Expand All @@ -23,27 +22,13 @@ services:
build:
context: lnd
args:
LND_VERSION: v0.19.3-beta
LND_VERSION: v0.20.0-beta
image: hydrus/lnd-mainnet
container_name: lnd
network_mode: service:tor
restart: on-failure:3
volumes:
- ./volumes/lnd:/home/lnd/.lnd
volumes_from:
- tor:ro
environment:
AUTO_UNLOCK_PWD: ${AUTO_UNLOCK_PWD}
depends_on:
- tor

tor:
build: tor
image: hydrus/tor
container_name: tor
restart: always
volumes:
- ./volumes/tor/data:/var/lib/tor
- ./volumes/tor/config:/etc/tor
ports:
- 10009:10009
2 changes: 1 addition & 1 deletion docker/mainnet/hydrus.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Test configuration file
lightning:
rpc:
address: localhost:10009
address: lnd:10009
tls_cert_path: /home/lnd/.lnd/tls.cert
macaroon_path: /home/lnd/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
timeout: 30s
Expand Down
10 changes: 5 additions & 5 deletions docker/mainnet/lnd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
ARG LND_VERSION=v0.18.5-beta
ARG LND_VERSION=v0.20.0-beta

FROM lightninglabs/lnd:${LND_VERSION}

ARG USER_ID=10001
ARG GROUP_ID=10001

RUN apk --no-cache --no-progress add sudo=~1

RUN addgroup -g "$GROUP_ID" lnd && \
adduser --disabled-password --shell "/sbin/nologin" --uid "${USER_ID}" lnd --ingroup lnd

COPY --chown=${USER_ID}:${GROUP_ID} lnd.conf /tmp/lnd.conf
COPY lnd.conf /tmp/lnd.conf

COPY entrypoint.sh /entrypoint.sh

COPY healthcheck.sh /healthcheck.sh

USER lnd

ENTRYPOINT ["/entrypoint.sh"]

HEALTHCHECK --interval=5s --timeout=20s --start-period=5s --retries=12 CMD /healthcheck.sh
HEALTHCHECK --start-period=120s CMD /healthcheck.sh
12 changes: 10 additions & 2 deletions docker/mainnet/lnd/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,23 @@ cp /tmp/lnd.conf $LND_HOME/lnd.conf

echo ${AUTO_UNLOCK_PWD} > /tmp/pwd

LOCAL_GRAPH_SUM=$(md5sum $LOCAL_GRAPH_PATH | cut -d ' ' -f 1)
if [ ! -f $LOCAL_GRAPH_PATH ]; then
LOCAL_GRAPH_SUM=''
else
LOCAL_GRAPH_SUM=$(md5sum $LOCAL_GRAPH_PATH | cut -d ' ' -f 1)
fi

EXTERNAL_GRAPH_SUM=$(curl -s $SPEEDLOADER_URL/mainnet/graph/MD5SUMS | cut -d ' ' -f 1)

if [ "$LOCAL_GRAPH_SUM" != "$EXTERNAL_GRAPH_SUM" ]; then
# Download external graph to avoid constructing it ourselves, which takes a considerable amount of time
echo "Downloading graph from external service"

mkdir -p $(dirname $LOCAL_GRAPH_PATH)

curl -s -o $LOCAL_GRAPH_PATH $SPEEDLOADER_URL/mainnet/graph/graph-001d.db
fi

exec lnd
chown -R lnd $LND_HOME

exec sudo -u lnd lnd
Empty file modified docker/mainnet/lnd/healthcheck.sh
100644 → 100755
Empty file.
9 changes: 3 additions & 6 deletions docker/mainnet/lnd/lnd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ wallet-unlock-allow-create=1
fee.url=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json
# Prevent unintentional leaking of identifying information
listen=localhost
tlsautorefresh=true
tlsextradomain=lnd
rpclisten=0.0.0.0:10009

[neutrino]
neutrino.connect=btcd1.lnolymp.us
neutrino.connect=btcd-mainnet.lightning.computer
neutrino.connect=node.eldamar.icu

[tor]
tor.active=1
tor.v3=1
tor.streamisolation=1
tor.skip-proxy-for-clearnet-targets=0

[bolt]
db.bolt.dbtimeout=2m

Expand Down
Empty file modified docker/mainnet/tor/entrypoint.sh
100644 → 100755
Empty file.
10 changes: 1 addition & 9 deletions docker/regtest/bitcoind/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
FROM debian:stable-slim

ARG USER_ID=10001
ARG GROUP_ID=10001
ARG BITCOIN_VERSION="28.1"
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH

RUN groupadd -f -g $GROUP_ID bitcoin && useradd -m -r -u $USER_ID -g $GROUP_ID bitcoin

RUN chown -R $USER_ID:$GROUP_ID "$(getent passwd bitcoin | cut -d: -f6)"

RUN apt-get update -y \
&& apt-get install -y curl wget \
&& apt-get clean \
Expand All @@ -19,10 +13,8 @@ RUN SYS_ARCH="$(uname -m)" \
&& tar -xzf bitcoin-${BITCOIN_VERSION}-${SYS_ARCH}-linux-gnu.tar.gz -C /opt \
&& rm bitcoin-${BITCOIN_VERSION}-${SYS_ARCH}-linux-gnu.tar.gz

COPY --chown=${USER_ID}:${GROUP_ID} bitcoin.conf /tmp/bitcoin.conf
COPY bitcoin.conf /tmp/bitcoin.conf

COPY entrypoint.sh /entrypoint.sh

USER bitcoin

ENTRYPOINT ["/entrypoint.sh"]
2 changes: 0 additions & 2 deletions docker/regtest/bitcoind/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ trap stop SIGTERM

cp /tmp/bitcoin.conf $BITCOIN_HOME/bitcoin.conf

chown -R $USER_ID:$GROUP_ID /home/bitcoin

bitcoind &

if [ ! -f "$BITCOIN_HOME/regtest/wallets/wallet.dat" ]; then
Expand Down
2 changes: 1 addition & 1 deletion docker/regtest/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
build:
context: lnd
args:
LND_VERSION: v0.19.3-beta
LND_VERSION: v0.20.0-beta
image: hydrus/lnd-regtest
container_name: alice
hostname: alice
Expand Down
10 changes: 5 additions & 5 deletions docker/regtest/lnd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
ARG LND_VERSION=v0.18.5-beta
ARG LND_VERSION=v0.20.0-beta

FROM lightninglabs/lnd:${LND_VERSION}

ARG USER_ID=10001
ARG GROUP_ID=10001

RUN apk --no-cache --no-progress add sudo=~1

RUN addgroup -g "$GROUP_ID" lnd && \
adduser --disabled-password --shell "/sbin/nologin" --uid "${USER_ID}" lnd --ingroup lnd

COPY --chown=${USER_ID}:${GROUP_ID} lnd.conf /tmp/lnd.conf
COPY lnd.conf /tmp/lnd.conf

COPY entrypoint.sh /entrypoint.sh

COPY healthcheck.sh /healthcheck.sh

USER lnd

ENTRYPOINT ["/entrypoint.sh"]

HEALTHCHECK --interval=5s --timeout=20s --start-period=5s --retries=12 CMD /healthcheck.sh
HEALTHCHECK --start-period=120s CMD /healthcheck.sh
10 changes: 8 additions & 2 deletions docker/regtest/lnd/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/bash
set -e

LND_HOME="/home/lnd/.lnd"

echo 'alias lncli="lncli --network regtest"' >> ~/.bashrc

HOSTNAME=$(hostname)

sed -i "s:HOSTNAME:$HOSTNAME:g" /tmp/lnd.conf

cp /tmp/lnd.conf /home/lnd/.lnd/lnd.conf
mkdir -p $LND_HOME

chown -R lnd $LND_HOME

cp /tmp/lnd.conf $LND_HOME/lnd.conf

exec lnd
exec sudo -u lnd lnd
Empty file modified docker/regtest/lnd/healthcheck.sh
100644 → 100755
Empty file.
Loading
Loading