Created
May 3, 2024 19:39
-
-
Save MauroToscano/b6a15942e38715c5039503583a98bcbc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Make build has to be run before this | |
# Needs to be run from within eigenda directory | |
# jq and grpcurl need to be installed | |
REQUEST_ID=$(grpcurl \ | |
-import-path ./api/proto \ | |
-proto ./api/proto/disperser/disperser.proto \ | |
-d '{"data": "'$(tools/kzgpad/bin/kzgpad -e hello)'"}' \ | |
disperser-holesky.eigenda.xyz:443 disperser.Disperser/DisperseBlob | jq -r '.requestId') | |
echo "Created Request with ID: $REQUEST_ID" | |
echo "Waiting for disperser confirmation..." | |
START_TIME=$(date +%s) | |
while [ "$(grpcurl \ | |
-import-path ./api/proto \ | |
-proto ./api/proto/disperser/disperser.proto \ | |
-d "{\"request_id\": \"$REQUEST_ID\"}" \ | |
disperser-holesky.eigenda.xyz:443 disperser.Disperser/GetBlobStatus | jq -r '.status')" == "PROCESSING" ] | |
do | |
sleep 1 | |
done | |
echo "Confirmed" | |
END_TIME=$(date +%s) | |
# Calculate elapsed time | |
ELAPSED_TIME=$((END_TIME - START_TIME)) | |
echo "Elapsed time: $ELAPSED_TIME seconds" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment