2025-03-03 12:09:35 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -e
|
|
|
|
|
|
2025-03-06 01:21:11 +04:00
|
|
|
# Order of these proofs is important, we sequence them topologically by composition order
|
2025-03-05 23:22:26 +04:00
|
|
|
proofs=$(cat <<EOF
|
2025-03-07 01:33:18 +04:00
|
|
|
risc0_proofs
|
|
|
|
|
bundle_risc0_proof
|
|
|
|
|
ledger_risc0_proof
|
2025-03-05 23:22:26 +04:00
|
|
|
EOF
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
for proof in $proofs; do
|
|
|
|
|
echo "Building $proof"
|
|
|
|
|
# Run the cargo risczero build command and process output line by line
|
|
|
|
|
cargo risczero build --manifest-path "$proof/Cargo.toml" | while read -r line; do
|
|
|
|
|
# Parse out the
|
2025-10-19 23:38:34 +04:00
|
|
|
if [[ $line =~ ImageID:\ ([0-9a-f]+)\ -\ (.+\.bin) ]]; then
|
2025-03-05 23:22:26 +04:00
|
|
|
image_id="${BASH_REMATCH[1]}"
|
|
|
|
|
image_elf="${BASH_REMATCH[2]}"
|
2025-10-19 23:38:34 +04:00
|
|
|
image_name=$(basename $image_elf .bin | tr '[:lower:]' '[:upper:]')
|
2025-03-06 01:14:40 +04:00
|
|
|
echo "${image_name}_ID: $image_id"
|
|
|
|
|
echo "${image_name}_ELF: $(cat $image_elf | xxd -p | head -c 32)..."
|
2025-03-05 23:22:26 +04:00
|
|
|
|
2025-03-06 00:23:49 +04:00
|
|
|
echo $image_id | tr -d '\n' > "risc0_images/src/${image_name}_ID"
|
2025-03-06 01:14:40 +04:00
|
|
|
cp $image_elf "risc0_images/src/${image_name}_ELF"
|
2025-03-05 23:22:26 +04:00
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
done
|