Skip to content

Commit 5e39263

Browse files
committed
infra: add risc0 setup
1 parent 83576e3 commit 5e39263

File tree

5 files changed

+41
-9
lines changed

5 files changed

+41
-9
lines changed

infra/aggregation_mode/aggregation_mode.service

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ After=network.target
66
Type=oneshot
77
WorkingDirectory=/home/user
88
ExecStartPre=sleep 60
9-
ExecStart=/home/user/.cargo/bin/proof_aggregator /home/user/config/config-proof-aggregator.yaml
10-
Environment="SP1_PROVER=cuda"
9+
ExecStart=/home/user/run.sh
1110

1211
[Install]
1312
WantedBy=multi-user.target

infra/aggregation_mode/aggregation_mode.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ curl -L https://sp1.succinct.xyz | bash
8282
source $HOME/.bashrc
8383
sp1up
8484

85+
# Install Risc0
86+
curl -L https://risczero.com/install | bash
87+
source $HOME/.bashrc
88+
rzup install
89+
8590
# Install cast
8691
curl -L https://foundry.paradigm.xyz | bash
8792
source $HOME/.bashrc
@@ -95,14 +100,20 @@ mkdir -p ~/.keystores
95100
# Create keystore
96101
cast wallet import proof_aggregation.keystore -k $HOME/.keystores -i
97102

98-
# Create config file interactively
99-
./infra/aggregation_mode/config_file.sh ./infra/aggregation_mode/config-proof-aggregator.template.yaml
100-
touch $HOME/config/proof-aggregator.last_aggregated_block.json
101-
read -p "Enter a number (last_aggregated_block): " num && echo "{\"last_aggregated_block\":$num}" > $HOME/config/proof-aggregator.last_aggregated_block.json
103+
# Create config file for SP1
104+
./infra/aggregation_mode/config_file.sh ./infra/aggregation_mode/config-proof-aggregator-sp1.template.yaml $HOME/config/config-proof-aggregator-sp1.yaml
105+
read -p "Enter a block number for SP1 (last_aggregated_block): " num && echo "{\"last_aggregated_block\":$num}" > $HOME/config/proof-aggregator-sp1.last_aggregated_block.json
106+
107+
# Create config file for Risc0
108+
./infra/aggregation_mode/config_file.sh ./infra/aggregation_mode/config-proof-aggregator-risc0.template.yaml $HOME/config/config-proof-aggregator-risc0.yaml
109+
read -p "Enter a block number for Risc0 (last_aggregated_block): " num && echo "{\"last_aggregated_block\":$num}" > $HOME/config/proof-aggregator-risc0.last_aggregated_block.json
102110

103111
# Build the proof_aggregator
104112
make install_aggregation_mode
105113

114+
# Copy run script
115+
cp ./infra/aggregation_mode/run.sh $HOME/run.sh
116+
106117
# Setup systemd service
107118
cp ./infra/aggregation_mode/aggregation_mode.service $HOME/.config/systemd/user/aggregation_mode.service
108119
cp ./infra/aggregation_mode/aggregation_mode.timer $HOME/.config/systemd/user/aggregation_mode.timer
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
aligned_service_manager_address: <aligned_service_manager_address>
2+
proof_aggregation_service_address: <proof_aggregation_service_address>
3+
eth_rpc_url: <eth_rpc_url>
4+
eth_ws_url: <eth_ws_url>
5+
max_proofs_in_queue: 1000
6+
last_aggregated_block_filepath: /home/user/config/proof-aggregator-risc0.last_aggregated_block.json
7+
8+
ecdsa:
9+
private_key_store_path: <private_key_store_path>
10+
private_key_store_password: <private_key_store_password>

infra/aggregation_mode/config-proof-aggregator.template.yaml renamed to infra/aggregation_mode/config-proof-aggregator-sp1.template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ proof_aggregation_service_address: <proof_aggregation_service_address>
33
eth_rpc_url: <eth_rpc_url>
44
eth_ws_url: <eth_ws_url>
55
max_proofs_in_queue: 1000
6-
last_aggregated_block_filepath: ~/config/proof-aggregator.last_aggregated_block.json
6+
last_aggregated_block_filepath: /home/user/config/proof-aggregator-sp1.last_aggregated_block.json
77

88
ecdsa:
99
private_key_store_path: <private_key_store_path>

infra/aggregation_mode/config_file.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
#!/bin/bash
22

3+
# This script creates a configuration file for the proof aggregator
4+
5+
# ENV VARIABLES
6+
#
7+
# TEMPLATE_FILE: Path to the template file
8+
# - SP1: ./infra/aggregation_mode/config-proof-aggregator-sp1.template.yaml
9+
# - Risc0: ./infra/aggregation_mode/config-proof-aggregator-risc0.template.yaml
10+
#
11+
# OUTPUT_FILE: Path to the output file
12+
# - SP1: $HOME/config/config-proof-aggregator-sp1.yaml
13+
# - Risc0: $HOME/config/config-proof-aggregator-risc0.yaml
14+
315
# Check if template file path is provided as argument
416
if [ $# -ne 1 ]; then
517
echo "Usage: $0 <template_file_path>"
@@ -39,9 +51,9 @@ prompt_and_replace "<private_key_store_password>" "ECDSA Private Key Store Passw
3951
mkdir -p /home/user/config
4052

4153
# Copy the completed file to destination
42-
cp "$TEMP_FILE" $HOME/config/config-proof-aggregator.yaml
54+
cp "$TEMP_FILE" "$OUTPUT_FILE"
4355

4456
# Clean up temporary file
4557
rm "$TEMP_FILE"
4658

47-
echo "Configuration file has been created and copied to $HOME/config/config-proof-aggregator.yaml"
59+
echo "Configuration file has been created and copied to $OUTPUT_FILE"

0 commit comments

Comments
 (0)