Skip to content

Instantly share code, notes, and snippets.

@kaisbaccour
Last active April 10, 2023 18:36
Show Gist options
  • Save kaisbaccour/dade97c704896c13c5f95d498d9dea24 to your computer and use it in GitHub Desktop.
Save kaisbaccour/dade97c704896c13c5f95d498d9dea24 to your computer and use it in GitHub Desktop.
# make snapshot
noisd export > nois-testnet-005.json

CONVERSION_RATE=0.000001 

cat nois-testnet-005.json | \
jq '[.app_state.staking.delegations | group_by(.delegator_address) | map({
  address: .[0].delegator_address, 
  amount: (map(.shares | tonumber) | add)
})][0]' | \
jq 'sort_by(-.amount)' | \
jq --argjson multiplier $CONVERSION_RATE 'map(
  if .amount | type == "number" 
  then .amount |= (. * $multiplier | floor)
  else .
  end
)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment