|
1 | 1 | #!/bin/bash |
2 | 2 |
|
| 3 | +# Get the directory of the script |
| 4 | +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 5 | + |
| 6 | +# Load environment variables from .env file |
| 7 | +if [ -f "$SCRIPT_DIR/.env" ]; then |
| 8 | + source "$SCRIPT_DIR/.env" |
| 9 | +fi |
| 10 | + |
3 | 11 | if [ $# -lt 1 ]; then |
4 | 12 | echo "Usage: $0 <x> <repetitions?>" |
5 | 13 | exit 1 |
|
16 | 24 | echo "Generating proof $x != 0" |
17 | 25 | go run scripts/test_files/gnark_groth16_bn254_infinite_script/cmd/main.go $x |
18 | 26 |
|
19 | | -./batcher/target/release/aligned submit \ |
20 | | - --proving_system Groth16Bn254 \ |
21 | | - --repetitions $repetitions \ |
22 | | - --proof scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/ineq_${x}_groth16.proof \ |
23 | | - --public_input scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/ineq_${x}_groth16.pub \ |
24 | | - --vk scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/ineq_${x}_groth16.vk \ |
25 | | - --proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 |
| 27 | +# Set default values for RPC and BATCHER if they are not set |
| 28 | +RPC=${RPC:-http://localhost:8545} |
| 29 | +BATCHER=${BATCHER:-ws://localhost:8080} |
| 30 | + |
| 31 | +cmd=( |
| 32 | + ./batcher/target/release/aligned |
| 33 | + submit |
| 34 | + --proving_system Groth16Bn254 |
| 35 | + --repetitions "$repetitions" |
| 36 | + --proof "scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/ineq_${x}_groth16.proof" |
| 37 | + --public_input "scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/ineq_${x}_groth16.pub" |
| 38 | + --vk "scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/ineq_${x}_groth16.vk" |
| 39 | + --proof_generator_addr 0x66f9664f97F2b50F62D13eA064982f936dE76657 |
| 40 | + --rpc "$RPC" |
| 41 | + --conn "$BATCHER" |
| 42 | +) |
| 43 | + |
| 44 | +# If PRIVATE_KEY is set then add private key argument |
| 45 | +if [ -n "$PRIVATE_KEY" ]; then |
| 46 | + cmd+=(--private_key "$PRIVATE_KEY") |
| 47 | +fi |
| 48 | + |
| 49 | +# Execute the command |
| 50 | +"${cmd[@]}" |
0 commit comments