|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Params: |
| 4 | +# PROOF_TYPE = sp1|groth16|plonk|risc0 (default sp1) |
| 5 | +# RPC_URL (default localhost:8545) |
| 6 | +# NETWORK devnet|holesky-stage|holesky |
| 7 | +# REPETITIONS (default 1) |
| 8 | + |
| 9 | +if [ -z "$NETWORK" ]; then |
| 10 | + echo "NETWORK is not set. Setting it to devnet" |
| 11 | + NETWORK="devnet" |
| 12 | +fi |
| 13 | + |
| 14 | +if [ -z "$RPC_URL" ]; then |
| 15 | + echo "RPC_URL is not set. Setting it to localhost:8545" |
| 16 | + RPC_URL="http://localhost:8545" |
| 17 | +fi |
| 18 | + |
| 19 | +if [ -z $PROOF_TYPE ]; then |
| 20 | + echo "Proof type not provided, using SP1 default" |
| 21 | + PROOF_TYPE="sp1" #sp1|groth16|plonk|risc0 |
| 22 | +fi |
| 23 | + |
| 24 | +if [ -z $REPETITIONS ]; then |
| 25 | + echo "REPETITIONS not provided, using 1 as default" |
| 26 | + REPETITIONS=1 |
| 27 | +fi |
| 28 | + |
| 29 | +echo "Sending $REPETITIONS $PROOF_TYPE proof/s to the batcher" |
| 30 | +echo "Batcher in $NETWORK and endpoint at $RPC_URL" |
| 31 | + |
| 32 | +if [[ $PROOF_TYPE == "sp1" ]]; then |
| 33 | + aligned submit \ |
| 34 | + --proving_system SP1 \ |
| 35 | + --proof ../../scripts/test_files/sp1/sp1_fibonacci_4_1_3.proof \ |
| 36 | + --vm_program ../../scripts/test_files/sp1/sp1_fibonacci_4_1_3.elf \ |
| 37 | + --random_address \ |
| 38 | + --repetitions $REPETITIONS \ |
| 39 | + --rpc_url $RPC_URL \ |
| 40 | + --network $NETWORK |
| 41 | + |
| 42 | +elif [[ $PROOF_TYPE == "groth16" ]]; then |
| 43 | + aligned submit \ |
| 44 | + --proving_system Groth16Bn254 \ |
| 45 | + --proof ../../scripts/test_files/gnark_groth16_bn254_script/groth16.proof \ |
| 46 | + --public_input ../../scripts/test_files/gnark_groth16_bn254_script/groth16.pub \ |
| 47 | + --vk ../../scripts/test_files/gnark_groth16_bn254_script/groth16.vk \ |
| 48 | + --random_address \ |
| 49 | + --repetitions $REPETITIONS \ |
| 50 | + --rpc_url $RPC_URL \ |
| 51 | + --network $NETWORK |
| 52 | + |
| 53 | +elif [[ $PROOF_TYPE == "plonk" ]]; then |
| 54 | + aligned submit \ |
| 55 | + --proving_system GnarkPlonkBn254 \ |
| 56 | + --proof ../../scripts/test_files/gnark_plonk_bn254_script/plonk.proof \ |
| 57 | + --public_input ../../scripts/test_files/gnark_plonk_bn254_script/plonk_pub_input.pub \ |
| 58 | + --vk ../../scripts/test_files/gnark_plonk_bn254_script/plonk.vk \ |
| 59 | + --random_address \ |
| 60 | + --repetitions $REPETITIONS \ |
| 61 | + --rpc_url $RPC_URL \ |
| 62 | + --network $NETWORK |
| 63 | + |
| 64 | +elif [[ $PROOF_TYPE == "risc0" ]]; then |
| 65 | + aligned submit \ |
| 66 | + --proving_system Risc0 \ |
| 67 | + --proof ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_2_0.proof \ |
| 68 | + --vm_program ../../scripts/test_files/risc_zero/fibonacci_proof_generator/fibonacci_id_2_0.bin \ |
| 69 | + --public_input ../../scripts/test_files/risc_zero/fibonacci_proof_generator/risc_zero_fibonacci_2_0.pub \ |
| 70 | + --random_address \ |
| 71 | + --repetitions $REPETITIONS \ |
| 72 | + --rpc_url $RPC_URL \ |
| 73 | + --network $NETWORK |
| 74 | + |
| 75 | +else |
| 76 | + echo "Incorrect proof type provided $1" |
| 77 | + exit 1 |
| 78 | +fi |
0 commit comments