pha-deploy
CLI utility for deploying fungible tokens and NFTs on Phantasma, creating NFT series, and minting NFTs using a TOML configuration file (or CLI-only flags). It uses the same phantasma-sdk-ts builders as the Token Deployment UI, but is optimized for repeatable CLI workflows.
Related: Token Deployment UI
Installation
# install globally
npm i -g pha-deploy
# or run once via npx
npx pha-deploy --help
# local dev install
npm install
npm run buildIf you have just installed, the repo includes helpers such as just ct (create token), just cs (create series), and just mn (mint).
Quick start
# copy the example config
cp config/config.example.toml config.toml
# edit config.toml (rpc, nexus, wif, metadata, schemas)
pha-deploy --create-tokenConfiguration file (config.toml)
By default the CLI loads config.toml from the current working directory. Use --config <path> to load an alternate file.
The config uses TOML with embedded JSON strings (triple quotes) for complex data.
Connection and signer
rpcdefaults tohttps://testnet.phantasma.info/rpcif omitted.nexusshould match the target network (example:mainnet,testnet).wifis required for all actions (including dry-run) because the CLI signs transactions. Keep it out of version control. See Private Key Guideline.
Token definition
Rules enforced by the SDK:
Symbol must be 1 to 255 characters, uppercase A-Z only.
token_type = "fungible"requirestoken_max_supplyandfungible_decimals.fungible_decimalsmust be an integer in the range 0..255.token_max_supplymust be non-negative.For NFTs,
token_max_supplyis optional, but if provided it must fit into Int64.
Token metadata (required)
token_metadata must be a JSON object. All values must be strings. Required fields: name, icon, url, description.
Icon rules (enforced by the SDK):
Must be a base64 data URI:
data:image/png|jpeg|webp;base64,...Payload must be valid base64 and non-empty.
Token schemas (NFTs only)
NFT tokens require token_schemas, provided as JSON with three arrays: seriesMetadata, rom, and ram.
Schema rules enforced by TokenSchemasBuilder:
Mandatory metadata fields must appear in either
seriesMetadataorrom:name,description,imageURL,infoURL,royalties.System fields are reserved and auto-managed by the SDK:
id,mode,rom. Do not add custom fields with these names.Field names are case-sensitive.
If
ramis an empty array, the SDK uses a dynamic RAM schema.
Supported field types (VmType names):
Series metadata and NFT metadata
series_metadata and nft_metadata accept either:
a JSON object of key/value pairs, or
a JSON array of
{ "name": "...", "value": ... }entries.
Values can be strings or numbers. The SDK validates the values against the schema.
Token and series identifiers
Use these when creating a series or minting against an existing token or series.
Limits and fees
These values are passed directly to the SDK transaction helpers. Use the defaults from config.example.toml as a starting point and adjust only if needed.
Runtime flags
dry_run enables dry-run mode in config. The CLI --dry-run flag always overrides it.
CLI-only usage (no config file)
You can run without a TOML file by passing all required values as flags:
Create a token:
Create a series:
Mint an NFT:
Notes:
For fungible tokens, also pass
--token-max-supplyand--fungible-decimals.For series and mint actions, supply the metadata JSON strings and token schemas.
Running actions
Create a token
Requirements:
wif,rpc,nexus,symbol.token_metadatais required for all tokens.For fungible tokens:
token_max_supply,fungible_decimals.For NFT tokens:
token_schemas.
Create an NFT series
Requirements:
carbon_token_id.token_schemas.seriesMetadata.series_metadata(can be empty JSON object if your schema only includes required defaults).
Mint an NFT
Requirements:
carbon_token_idandcarbon_token_series_id.token_schemas.rom.nft_metadata.
Dry-run and settings log
Append --dry-run to any action to build and print the transaction without broadcasting. Use --settings-log to print the resolved configuration; the CLI omits the WIF and prints the derived owner address instead.
Transaction status
After broadcasting, the CLI polls getTransaction every 2 seconds for up to 30 seconds. If the state does not reach Halt in that window, it reports the timeout so you can check the transaction manually.
CLI flags and overrides
Actions:
--create-token--create-series--mint-nft
Common flags:
--config <path>Path to TOML config file (default:config.toml).--dry-runDo not broadcast transactions; just show payloads.--rpc-logEnable SDK JSON-RPC logging (full response payloads).--settings-logPrint resolved configuration before executing an action.--helpShow help.
Overrides (replace config.toml values when provided):
--rpc <url>RPC endpoint.--nexus <name>Nexus name (example:mainnet,testnet).--wif <wif>WIF for signing.--symbol <symbol>Token symbol.--token-type <nft|fungible>Token type to create (default:nft).--token-max-supply <int>Max supply (required forfungible).--fungible-max-supply <int>Alias for--token-max-supply.--fungible-decimals <0..255>Decimals for fungible tokens.--carbon-token-id <int>Existing token id (for series or mint).--carbon-token-series-id <int>Existing series id (for mint).--rom <hex>Token ROM hex (not required by built-in actions).--token-schemas '<json>'Inline JSON for token schemas.--token-metadata '<json>'Inline JSON for token metadata.--series-metadata '<json>'Inline JSON for series metadata.--nft-metadata '<json>'Inline JSON for NFT metadata.--create-token-max-data <int>Payload limit for token creation.--create-token-series-max-data <int>Payload limit for series creation.--mint-token-max-data <int>Payload limit for minting.--gas-fee-base <int>Base gas fee.--gas-fee-create-token-base <int>Gas fee for create-token.--gas-fee-create-token-symbol <int>Symbol registration fee.--gas-fee-create-token-series <int>Gas fee for create-series.--gas-fee-multiplier <int>Multiplier applied to gas fee.
Notes:
JSON arguments must be single-line quoted strings. For large edits, update
config.toml.Unknown flags are ignored by the config loader, but prefer editing the TOML for long-lived changes.
Last updated