-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (46 loc) · 1.89 KB
/
Dockerfile
File metadata and controls
53 lines (46 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright 2025 MeshJS
# Multi-architecture support: This image supports linux/amd64 and linux/arm64.
# Multi-stage build: first stage downloads params, second stage uses official image
# Stage 1: Download zk params using Alpine
FROM alpine:latest AS params-downloader
# Install curl
RUN apk add --no-cache curl
# Set default environment variables
ENV CIRCUIT_PARAM_RANGE="10 11 12 13 14 15 16 17"
ENV ZK_PARAMS_DIR="/.cache/midnight/zk-params"
# Create the fetch script directly in the Dockerfile
RUN printf '#!/bin/sh\n\
# Copyright 2025 Brick Towers\n\
\n\
set -e # exit on error\n\
set -x # print each command before executing\n\
\n\
# Default CIRCUIT_PARAM_RANGE if not provided\n\
CIRCUIT_PARAM_RANGE=${CIRCUIT_PARAM_RANGE:-"10 11 12 13 14 15 16 17"}\n\
ZK_PARAMS_DIR=${ZK_PARAMS_DIR:-"/.cache/midnight/zk-params"}\n\
\n\
# Create target directory\n\
mkdir -p "$ZK_PARAMS_DIR/zswap/4"\n\
\n\
echo "📥 Downloading BLS Filecoin params..."\n\
for i in $CIRCUIT_PARAM_RANGE; do\n\
echo " ↳ bls_filecoin_2p$i"\n\
curl --insecure -sSLo "$ZK_PARAMS_DIR/bls_filecoin_2p$i" \\\n\
"https://midnight-s3-fileshare-dev-eu-west-1.s3.eu-west-1.amazonaws.com/bls_filecoin_2p$i"\n\
done\n\
\n\
echo "📥 Downloading zswap/4 circuits..."\n\
cd "$ZK_PARAMS_DIR/zswap/4" || exit 1\n\
for file in \\\n\
output.bzkir output.prover output.verifier \\\n\
sign.bzkir sign.prover sign.verifier \\\n\
spend.bzkir spend.prover spend.verifier; do\n\
echo " ↳ $file"\n\
curl -sSLO "https://midnight-s3-fileshare-dev-eu-west-1.s3.eu-west-1.amazonaws.com/zswap/4/$file"\n\
done\n' > /tmp/fetch-zk-params.sh && chmod +x /tmp/fetch-zk-params.sh
# Run the script to fetch zk params
RUN /tmp/fetch-zk-params.sh
# Stage 2: Use official image and copy params
FROM midnightnetwork/proof-server:4.0.0
# Copy the zk params from the downloader stage
COPY --from=params-downloader /.cache/midnight/zk-params /.cache/midnight/zk-params