Skip to main content

snapcat is a Python command-line tool that helps monitor CATs (Chia Asset Tokens) on Chia Blockchain.

Project description

SnapCAT

snapcat is a Python command-line tool that helps monitor CATs (Chia Asset Tokens) on Chia Blockchain. It retrieves the latest CAT holder data by communicating with your local Chia Full Node RPC. The tool also leverages code from chia-network's CAT-addresses.

❯ snapcat --help

 Usage: snapcat [OPTIONS] COMMAND [ARGS]...

╭─ Options ───────────────────────────────────────────────────────────────────────────────────╮
│ --version              Show the version and exit.                                           │
│ --file-name  -f  TEXT  The name of the database file (default: <tail_hash>.db)              │
│ --help                 Show this message and exit.                                          │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────────────────╮
│ export      Export the CAT holder as csv or json.                                           │
│ show        Display the CAT db information.                                                 │
│ sync        Sync or create (if not exist) the CAT holder database.                          │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯

Sync (i.e., generate CAT database)

❯ snapcat sync --help

 Usage: snapcat sync [OPTIONS]

 Sync or create (if not exist) the CAT holder database.

╭─ Options ───────────────────────────────────────────────────────────────────────────────────╮
│ *  --tail-hash  -t  BYTES32  The TAIL hash of CAT [required]                                │
│    --help                    Show this message and exit.                                    │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯

❯ snapcat -f dbx.db sync -t db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20
press Ctrl+C to exit.
tail hash: db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20
database file name: dbx.db
Full Node is synced
Processed all blocks from 0 to 5320532

Export

❯ snapcat export --help

 Usage: snapcat export [OPTIONS]

 Export the CAT holder as csv or json.

╭─ Options ───────────────────────────────────────────────────────────────────────────────────╮
│ --output  -o  TEXT  The name of the output file (default: <tail_hash>-<block>.csv or .json) │
│ --coins   -c        Show individual coins in output rather than collapsing on puzzle hash   │
│ --json    -j        Export as JSON instead of CSV                                           │
│ --help              Show this message and exit.                                             │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯

❯ snapcat -f dbx.db export --json -o dbx.json
Exporting CAT holders
Tail Hash: db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20
Last Block Height: 5320532

Show

❯ snapcat show --help

 Usage: snapcat show [OPTIONS]

 Display the CAT db information.

╭─ Options ───────────────────────────────────────────────────────────────────────────────────╮
│ --puzzle-hash  -p  BYTES32  The (inner) puzzle hash to show the unspent coins and available │
│                             balance for                                                     │
│ --help                      Show this message and exit.                                     │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯

❯ snapcat -f dbx.db show
Tail Hash: db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20
Last Block Height: 5320532
# of Coins Spent: 152881
# of Coins Created: 158324

❯ snapcat -f dbx.db show -p 627d8cb88c51412d783bc2e6048b6bd9d48e68d790182d582d90395d860da680
Tail Hash: db1a9020d48d9d4ad22631b66ab4b9ebd3637ef7758ad38881348c5d24c38f20
Last Block Height: 5320532
Puzzle Hash: 627d8cb88c51412d783bc2e6048b6bd9d48e68d790182d582d90395d860da680
# of Unspent Coins: 2
Available Balance: 13,678.781

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snapcat-0.1.2.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

snapcat-0.1.2-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file snapcat-0.1.2.tar.gz.

File metadata

  • Download URL: snapcat-0.1.2.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0

File hashes

Hashes for snapcat-0.1.2.tar.gz
Algorithm Hash digest
SHA256 682bf540fccdf3fd070bd3ca0ff71a195c53111b34f61fb5c1a031364aad2a88
MD5 7a47fd7563860b510378b3b5259be452
BLAKE2b-256 3fa2d7522cad643d4508510c9a0938636ee62e087f4db6521640044cfbc56d7c

See more details on using hashes here.

File details

Details for the file snapcat-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: snapcat-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0

File hashes

Hashes for snapcat-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 733524de5518f442a30d7b38bc8c1ee1709f70a570bb3134f1b99be05a641f60
MD5 843a457264ecc2e7f234a40d5dbd6d15
BLAKE2b-256 e0073caec6150d35b5a7bd393ed91acd39449a6968f52db5ea5f6aa7ae069232

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page