Skip to content

Instantly share code, notes, and snippets.

@david-bakin-sl
Created August 24, 2023 21:06
Show Gist options
  • Save david-bakin-sl/22518a39a5388777f8e2c6009cff86d9 to your computer and use it in GitHub Desktop.
Save david-bakin-sl/22518a39a5388777f8e2c6009cff86d9 to your computer and use it in GitHub Desktop.
Get all file create transactions from Hedera mirror node
OUT=fileCreateTransactions.json
MNODE=https://mainnet-public.mirrornode.hedera.com
echo '[' > $OUT
R=$(curl -S -s "${MNODE}/api/v1/transactions?transactionType=FILECREATE&result=success&order=asc")
echo ${R} , >> $OUT
while NEXT=$(echo $R | jq --exit-status --raw-output ' .links.next')
do
echo ${NEXT}
R=$(curl -S -s "${MNODE}${NEXT}")
echo ${R}, >> $OUT
done
echo '{}]' >> $OUT
echo "$(grep -o FILECREATE ${OUT}) file create transactions found"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment