Skip to content

Commit 3cbd07c

Browse files
committed
one line command to setup coordinator configurations
1 parent 710e38e commit 3cbd07c

File tree

3 files changed

+69
-4
lines changed

3 files changed

+69
-4
lines changed

coordinator/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ coordinator_cron:
3434
coordinator_tool:
3535
go build -ldflags "-X scroll-tech/common/version.ZkVersion=${ZK_VERSION}" -o $(PWD)/build/bin/coordinator_tool ./cmd/tool
3636

37+
localsetup: coordinator_api ## Local setup: build coordinator_api, copy config, and setup releases
38+
@echo "Copying configuration files..."
39+
cp -r $(PWD)/conf $(PWD)/build/bin/
40+
@echo "Setting up releases..."
41+
cd $(PWD)/build && bash setup_releases.sh
42+
43+
3744
#coordinator_api_skip_libzkp:
3845
# go build -ldflags "-X scroll-tech/common/version.ZkVersion=${ZK_VERSION}" -o $(PWD)/build/bin/coordinator_api ./cmd/api
3946

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
3+
# release version
4+
if [ -z "${SCROLL_ZKVM_VERSION}" ]; then
5+
echo "SCROLL_ZKVM_VERSION not set"
6+
exit 1
7+
fi
8+
9+
# set ASSET_DIR by reading from config.json
10+
CONFIG_FILE="bin/conf/config.json"
11+
if [ ! -f "$CONFIG_FILE" ]; then
12+
echo "Config file $CONFIG_FILE not found"
13+
exit 1
14+
fi
15+
16+
# get the number of verifiers in the array
17+
VERIFIER_COUNT=$(jq -r '.prover_manager.verifier.verifiers | length' "$CONFIG_FILE")
18+
19+
if [ "$VERIFIER_COUNT" = "null" ] || [ "$VERIFIER_COUNT" -eq 0 ]; then
20+
echo "No verifiers found in config file"
21+
exit 1
22+
fi
23+
24+
echo "Found $VERIFIER_COUNT verifier(s) in config"
25+
26+
# iterate through each verifier entry
27+
for ((i=0; i<$VERIFIER_COUNT; i++)); do
28+
# extract assets_path for current verifier
29+
ASSETS_PATH=$(jq -r ".prover_manager.verifier.verifiers[$i].assets_path" "$CONFIG_FILE")
30+
FORK_NAME=$(jq -r ".prover_manager.verifier.verifiers[$i].fork_name" "$CONFIG_FILE")
31+
32+
if [ "$ASSETS_PATH" = "null" ]; then
33+
echo "Warning: Could not find assets_path for verifier $i, skipping..."
34+
continue
35+
fi
36+
37+
echo "Processing verifier $i ($FORK_NAME): assets_path=$ASSETS_PATH"
38+
39+
# check if it's an absolute path (starts with /)
40+
if [[ "$ASSETS_PATH" = /* ]]; then
41+
# absolute path, use as is
42+
ASSET_DIR="$ASSETS_PATH"
43+
else
44+
# relative path, prefix with "bin/"
45+
ASSET_DIR="bin/$ASSETS_PATH"
46+
fi
47+
48+
echo "Using ASSET_DIR: $ASSET_DIR"
49+
50+
# create directory if it doesn't exist
51+
mkdir -p "$ASSET_DIR"
52+
53+
# assets for verifier-only mode
54+
echo "Downloading assets for $FORK_NAME to $ASSET_DIR..."
55+
wget https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/verifier/verifier.bin -O ${ASSET_DIR}/verifier.bin
56+
wget https://circuit-release.s3.us-west-2.amazonaws.com/scroll-zkvm/releases/$SCROLL_ZKVM_VERSION/verifier/openVmVk.json -O ${ASSET_DIR}/openVmVk.json
57+
58+
echo "Completed downloading assets for $FORK_NAME"
59+
echo "---"
60+
done
61+
62+
echo "All verifier assets downloaded successfully"

coordinator/conf/config.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
"verifier": {
1010
"min_prover_version": "v4.4.45",
1111
"verifiers": [
12-
{
13-
"assets_path": "assets",
14-
"fork_name": "euclidV2"
15-
},
1612
{
1713
"assets_path": "assets",
1814
"fork_name": "feynman"

0 commit comments

Comments
 (0)