Skip to content

Instantly share code, notes, and snippets.

@ccamel
Last active March 5, 2025 16:49
Show Gist options
  • Save ccamel/75628fd9b042f30cfaaf2507338f9b50 to your computer and use it in GitHub Desktop.
Save ccamel/75628fd9b042f30cfaaf2507338f9b50 to your computer and use it in GitHub Desktop.
One-liner sorcery to rip stats from the Axone Cognitarium smart contract (πŸ”— https://axone.xyz)
( export CONTRACT="axone1xa8wemfrzq03tkwqxnv9lun7rceec7wuhh8x3qjgxkaaj5fl50zsmj8u0n"; \
export NODE="https://axone-rpc.jayjayinfra.space/"; \
axoned \
--node "$NODE" \
query wasm contract-state smart "$CONTRACT" \
'{"store":{}}' \
-o json \
| jq -r '
.data.stat as $stat |
"Triples=" +
($stat.triple_count
| tonumber
| tostring
| gsub("(?<=\\d)(?=(\\d{3})+$)"; " ")) +
"\nSize=" +
($stat.byte_size
| tonumber
| tostring
| gsub("(?<=\\d)(?=(\\d{3})+$)"; " "))
' \
| bat -p --language=DotENV )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment