aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-01-06 10:30:42 -0800
committerAdam Soltys <[email protected]>2026-02-06 08:58:11 -0800
commit1d3bf713e874e3ce0e5efe9f0dff459d5c1471ca (patch)
tree270da7f197bae81e37e8288014458d6459f50863
parentaff872f2a282491382f46f6c7bb6a6b5822f0dbb (diff)
downloadcoinos-server-1d3bf713e874e3ce0e5efe9f0dff459d5c1471ca.tar.gz
coinos-server-1d3bf713e874e3ce0e5efe9f0dff459d5c1471ca.zip
skip empty vtxos
-rw-r--r--routes/users.ts1
-rw-r--r--wallet.Dockerfile32
2 files changed, 33 insertions, 0 deletions
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