Skip to content

Instantly share code, notes, and snippets.

@peterargue
Created July 5, 2022 18:29
Show Gist options
  • Save peterargue/ba79eeb21ae0fc690f051f4868203f82 to your computer and use it in GitHub Desktop.
Save peterargue/ba79eeb21ae0fc690f051f4868203f82 to your computer and use it in GitHub Desktop.
Search for events from start height to latest using flow-cli
#!/bin/bash
EVENT=flow.AccountContractAdded
START=32795233
END=$(flow blocks get latest -n mainnet -o json | jq '.height')
echo "Start: ${START}"
echo "End: ${END}"
echo "Event: ${EVENT}"
for (( i=${START}; i<=${END}; i += 251 )); do
let endrange=$i+250
flow events get ${EVENT} -n mainnet --start $i --end $endrange
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment