CAT Admin CLI
Intro
This document is a reference guide for Chia's CAT Admin Tool, located in the CAT-admin-tool repository.
To set up your environment (including installing this tool), follow our CAT Creation Tutorial.
Reference
cats
Functionality: Create and administer Chia Asset Tokens (CATs)
Usage: cats [OPTIONS]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-l | --tail | TEXT | True | The TAIL program to launch this CAT with |
-c | --curry | TEXT | False | An argument to curry into the TAIL |
-s | --solution | TEXT | False | The solution to the TAIL program [default: ()] |
-t | --send-to | TEXT | True | The address these CATs will appear at once they are issued |
-a | --amount | INTEGER | True | The amount to issue in mojos (regular XCH will be used to fund this) |
-m | --fee | INTEGER | False | The fees for the transaction, in mojos [default: 0] |
-d | --authorized-provider | TEXT | False | A trusted DID that can issue VCs that are allowed to trade the CAT. Specifying this option will make the CAT a CR (credential restricted) CAT. Requires specifying either --proofs-checker or --cr-flag |
-r | --proofs-checker | TEXT | False | The program that checks the proofs of a VC for a CR-CAT. Specifying this option requires a value for --authorized-providers |
-v | --cr-flag | TEXT | False | Specify a list of flags to check a VC for in order to authorize this CR-CAT. Specifying this option requires a value for --authorized-providers . Cannot be used if a custom --proofs-checker is specified. |
-f | --fingerprint | INTEGER | False | The wallet fingerprint to use as funds |
-sig | --signature | TEXT | False | A signature to aggregate with the transaction |
-as | --spend | TEXT | False | An additional spend to aggregate with the transaction |
-b | --as-bytes | None | False | Output the spend bundle as a sequence of bytes instead of JSON |
-sc | --select-coin | None | False | Stop the process once a coin from the wallet has been selected and return the coin |
-q | --quiet | None | False | Quiet mode will not ask to push transaction to the network |
-p | --push | None | False | Automatically push transaction to the network in quiet mode |
--root-path | PATH | False | The root folder where the config lies [default: ~/.chia/mainnet] | |
--wallet-rpc-port | INTEGER | False | The RPC port the wallet service is running on | |
--help | None | False | Show a help message and exit |
Example 1 - select a coin from the wallet with a value of at least 1 XCH (1 trillion mojos)
Request:
cats --tail ./reference_tails/genesis_by_coin_id.clsp.hex --send-to txch1jk4r06xsj0fnwqk57322yjqzkdyx7kh8h8kvxus3l68tjnkf05aqd9uevs --amount 1000000000000 --as-bytes --select-coin
Response:
{
"amount": 1999731499999,
"parent_coin_info": "0x3179dd9b38f7c4e4de532e346cfefb33affda1f2860ed68aeb0e70c38a5c9f6e",
"puzzle_hash": "0x74fcdd0e27ead17559cf9eaf791c62a6517c0c4fcf5ac3a6f014857571fc7608"
}
Name: 345dd430bcd7a413f8feed25c382d83855edd6ccceb41d1dbc293ca8e49e6b2d
The "parent_coin_info", "puzzle_hash", and "amount" values are hashed together to create the coin's "Name".
Example 2 - Push a transaction to the network, currying an inner puzzle hash into the TAIL
Request:
cats --tail ./reference_tails/genesis_by_coin_id.clsp.hex --send-to txch19k6cl5syzvxgkgulr7m49v2r57yh0aanm23hrffgd89j4nj3ywhqxadyqr --amount 1000000000000 --as-bytes --curry 0x8f4dbff8df3f6aa9303eb47625cf8f09d885f1ad6a2d440582cb6bd45f53d2e8
Response:
The transaction has been created, would you like to push it to the network? (Y/N)y
Successfully pushed the transaction to the network
Asset ID: 9c39398afb1d7ffa03a589f60e5e39f2ae4572ff7048e689fe3128c339581b2d
Eve Coin ID: 9fe3e95308949cb9c49333f829922dc7118cd3e2fdf365cde669b47852ce3a7b
After pushing the transaction, the new ID and Eve Coin (singleton parent coin) will be shown.
Example 3 - Mint a new CR-CAT
First, select a coin to use for the minting. Flags included in this example (CR-specific flags are in bold):
--tail
: The tail to use; in this case we'll use a single-issuance TAIL--send-to
: The address to send the CR-CATs to upon minting--authorized-provider
: The DID that is authorized to issue VCs containing the required proof(s) for this CAT--cr-flag
: The proof(s) required for owning this CR-CAT--amount
: The number of mojos for this issuance (1 million mojos = 1 thousand CR-CATs)-m
: The transaction fee, in mojos--as-bytes
: Use bytes instead of JSON--select-coin
: Instead of minting the CAT, just select a coin to use for the isuance
cats --tail ./reference_tails/genesis_by_coin_id.clsp.hex --send-to txch1ek6ln2ejdsec6l734x8tggk9j5sepl8nfqjer5yt2dr905f04prqmcjcc5 --authorized-provider did:chia:1x23lnyd2xjefnfly075ngk79duf0yxna35cp86mgnnp4t33senfs4cah7u --cr-flag "test_proof1" --amount 1000000 -m 1000 --as-bytes --select-coin
Response:
{
"amount": 999694993543,
"parent_coin_info": "0x3ad9ec3ab9039047106476b4b23d05c46a7f02a6114c4eaf82792c3229e74416",
"puzzle_hash": "0xa8180f3997eeda1804508c1f4dbe55ef17808fe2df970bba408807b10e7dd9ba"
}
Name: c5519ac8ef55043b23bef45b1326d445f2c4af579f13dc0cdec10335ccb0a809