Skip to content

Instantly share code, notes, and snippets.

@gufmar
Last active April 7, 2021 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gufmar/097d16e1a627b9962e582c2d37cb3443 to your computer and use it in GitHub Desktop.
Save gufmar/097d16e1a627b9962e582c2d37cb3443 to your computer and use it in GitHub Desktop.
check cardano-node logfiles for...
#!/usr/bin/env bash
echo "Log file ${1}"
evntCount=0
cat logs/node0-${1}.json | grep SwitchedToAFork | jq -r '.at, .data.newtip' | paste - - | while read -r line ; do
evntCount=$((evntCount+1))
echo "${evntCount} SwitchedToAFork: ${line}"
done
#!/usr/bin/env bash
echo "Log file ${1}"
prevline=$(cat logs/node0-${1}.json | grep -m1 TraceStartLeadershipCheck | jq -r .data.slot)
cat logs/node0-${1}.json | grep TraceStartLeadershipCheck | jq -r .data.slot | while read -r line ; do
if [[ $((line-prevline)) -gt 1 ]]; then
echo "slotDiff $line $prevline $((line-prevline))"
fi
prevline=$line
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment