Skip to content

Commit

Permalink
feat(images): add support for litd v0.13.99-alpha.rc4
Browse files Browse the repository at this point in the history
  • Loading branch information
jamaljsr committed Jul 15, 2024
1 parent 2eab0c4 commit b0860ab
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 56 deletions.
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Replace `<version>` with the desired Tap version (ex: `0.2.0-alpha`).

### Tags

- `0.13.0-alpha.rc1` ([tap/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/tapd/Dockerfile))
- `0.13.99-alpha.rc4` ([tap/Dockerfile](https://github.com/jamaljsr/polar/blob/master/docker/tapd/Dockerfile))

**Building the image**

Expand Down
57 changes: 7 additions & 50 deletions docker/litd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,3 @@
# Start with a NodeJS base image that also contains yarn.
FROM node:16.14.2-buster-slim as nodejsbuilder

RUN apt-get update -y \
&& apt-get install -y git

# Copy in the local repository to build from.
RUN git clone --branch 0-19-staging https://github.com/lightninglabs/lightning-terminal.git /go/src/github.com/lightninglabs/lightning-terminal/

RUN cd /go/src/github.com/lightninglabs/lightning-terminal/app \
&& yarn install \
&& yarn build

# The first stage is already done and all static assets should now be generated
# in the app/build sub directory.
# If you change this value, please also update:
# /Dockerfile
# /.github/workflows/main.yml
FROM golang:1.22-bookworm as golangbuilder

# Instead of checking out from git again, we just copy the whole working
# directory of the previous stage that includes the generated static assets.
COPY --from=nodejsbuilder /go/src/github.com/lightninglabs/lightning-terminal /go/src/github.com/lightninglabs/lightning-terminal

# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
# queries required to connect to linked containers succeed.
ENV GODEBUG netdns=cgo

# Install dependencies and install/build lightning-terminal.
# RUN apk add --no-cache --update alpine-sdk \
# make \
# && cd /go/src/github.com/lightninglabs/lightning-terminal \
# && make go-install \
# && make go-install-cli

RUN apt-get update -y \
&& apt-get install -y make \
&& cd /go/src/github.com/lightninglabs/lightning-terminal \
&& make go-install \
&& make go-install-cli

FROM debian:stable-slim

ARG LITD_VERSION
Expand All @@ -49,22 +8,20 @@ RUN apt-get update -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Copy the binaries and entrypoint from the builder image.
COPY --from=golangbuilder /go/bin/litd /bin/
COPY --from=golangbuilder /go/bin/litcli /bin/
COPY --from=golangbuilder /go/bin/lncli /bin/
COPY --from=golangbuilder /go/bin/frcli /bin/
COPY --from=golangbuilder /go/bin/loop /bin/
COPY --from=golangbuilder /go/bin/pool /bin/
COPY --from=golangbuilder /go/bin/tapcli /bin/
RUN SYS_ARCH="$(dpkg --print-architecture)" \
&& curl -SLO https://github.com/lightninglabs/lightning-terminal/releases/download/v${LITD_VERSION}/lightning-terminal-linux-${SYS_ARCH}-v${LITD_VERSION}.tar.gz \
&& tar -xzf *.tar.gz \
&& mkdir /opt/litd \
&& mv ./lightning-terminal-linux-${SYS_ARCH}-v${LITD_VERSION}/* /opt/litd \
&& rm *.tar.gz

COPY docker-entrypoint.sh /entrypoint.sh

RUN chmod a+x /entrypoint.sh

VOLUME ["/home/litd/.litd"]

EXPOSE 8443 10009 9735
EXPOSE 9735 8080 10000

ENTRYPOINT ["/entrypoint.sh"]

Expand Down
2 changes: 1 addition & 1 deletion src/store/models/lit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const litModel: LitModel = {
const assetsInChannels = actions
.getAssetsInChannels({ nodeName: node.name })
.filter(a => a.asset.id === assetId)
.filter(a => BigInt(a.asset.remoteBalance) > BigInt(amount));
.filter(a => BigInt(a.asset.remoteBalance) >= BigInt(amount));

if (assetsInChannels.length === 0) {
throw new Error('Not enough assets in a channel to create the invoice');
Expand Down
8 changes: 4 additions & 4 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export const dockerConfigs: Record<NodeImplementation, DockerConfig> = {
'--taproot-assets.universerpccourier.initialbackoff=300ms',
'--taproot-assets.universerpccourier.maxbackoff=600ms',
'--taproot-assets.experimental.rfq.priceoracleaddress=use_mock_price_oracle_service_promise_to_not_use_on_mainnet',
'--taproot-assets.experimental.rfq.mockoraclecentpersat=1000000',
'--taproot-assets.experimental.rfq.mockoracleassetsperbtc=1000000',
'--lnd.trickledelay=50',
'--lnd.gossip.sub-batch-delay=5ms',
'--lnd.caches.rpc-graph-cache-duration=100ms',
Expand Down Expand Up @@ -398,10 +398,10 @@ export const defaultRepoState: DockerRepoState = {
},
},
litd: {
latest: '0.13.99-alpha.rc2',
versions: ['0.13.99-alpha.rc2'],
latest: '0.13.99-alpha.rc4',
versions: ['0.13.99-alpha.rc4'],
compatibility: {
'0.13.99-alpha.rc2': '27.0',
'0.13.99-alpha.rc4': '27.0',
},
},
},
Expand Down

0 comments on commit b0860ab

Please sign in to comment.