From 1d3bf713e874e3ce0e5efe9f0dff459d5c1471ca Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 6 Jan 2026 10:30:42 -0800 Subject: skip empty vtxos --- routes/users.ts | 1 + wallet.Dockerfile | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 wallet.Dockerfile diff --git a/routes/users.ts b/routes/users.ts index 7e9c656a..ca15924f 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -850,6 +850,7 @@ export default { { "content-type": "application/json" }, ); const { vtxos } = await r.json(); + if (!vtxos?.length) continue; account.balance = vtxos.reduce( (a, b) => a + Number.parseInt(b.amount), 0, diff --git a/wallet.Dockerfile b/wallet.Dockerfile new file mode 100644 index 00000000..db080737 --- /dev/null +++ b/wallet.Dockerfile @@ -0,0 +1,32 @@ +# First stage: build the ark-wallet-daemon binary +FROM golang:1.25.3 AS builder + +ARG VERSION +ARG TARGETOS +ARG TARGETARCH + +ARG BRANCH=v0.8.4 + +WORKDIR /app + +RUN git clone https://github.com/arkade-os/arkd.git && cd arkd && git checkout ${BRANCH} + +RUN mkdir -p bin && cd arkd && \ + CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \ + go build -ldflags="-X 'main.Version=${VERSION}'" -o /app/bin/arkd-wallet ./cmd/arkd-wallet/main.go + +# Second stage: minimal runtime image +FROM alpine:3.22 + +RUN apk update && apk upgrade + +WORKDIR /app + +COPY --from=builder /app/bin/arkd-wallet /app/ + +ENV PATH="/app:${PATH}" +ENV ARK_WALLET_DATADIR=/app/wallet-data + +VOLUME /app/wallet-data + +ENTRYPOINT [ "arkd-wallet" ] \ No newline at end of file -- cgit v1.2.3