CLI for Phantasma token flows and contract lifecycle workflows.
Current surface area:
- Token actions:
--create-token--create-series--mint-fungible--mint-nft
- Contract actions:
contract compilecontract deploycontract upgradecontract attach
--versionprints both thepha-deployversion and the resolvedpha-tombversion/path.- Dry-run mode is available for token and contract transactions.
- Node.js
>=16 pha-tomb >= 2.1.0must be available forcontract compile, either inPATHor through--compiler/PHA_TOMB_PATH
contract deploy, contract upgrade, and contract attach do not invoke the compiler directly. They work from a compiled artifact bundle or explicit --script / --abi inputs.
# global install
npm i -g pha-deploy
# inspect the installed CLI and compiler binding
pha-deploy --version
# local development install
npm install
npm run build
node dist/cli.js --helpExample version output:
pha-deploy 0.5.0
pha-tomb version 2.1.0
pha-tomb path /usr/local/bin/pha-tomb
pha-deploy contract <compile|deploy|upgrade|attach> [options]
pha-deploy --create-token [options]
pha-deploy --create-series [options]
pha-deploy --mint-fungible [options]
pha-deploy --mint-nft [options]Token actions still support the config-first TOML flow.
Typical setup:
cp config/config.example.toml config.toml
pha-deploy --create-token --config config.tomlCommon token flags:
--config <path>: load TOML config, defaultconfig.toml--dry-run: build/sign but do not broadcast--rpc-log: enable SDK JSON-RPC logging--settings-log: print the resolved configuration before execution--rpc <url>--nexus <name>--wif <wif>--symbol <symbol>--token-type <nft|fungible>--token-max-supply <int>--fungible-max-supply <int>--fungible-decimals <0..255>--carbon-token-id <int>--phantasma-series-id <int>--mint-fungible-to <address>--mint-fungible-amount <int>--rom <hex>--token-schemas <json>--token-metadata <json>--series-metadata <json>--nft-metadata <json>--create-token-max-data <int>--create-token-series-max-data <int>--mint-token-max-data <int>--gas-fee-base <int>--gas-fee-create-token-base <int>--gas-fee-create-token-symbol <int>--gas-fee-create-token-series <int>--gas-fee-multiplier <int>
Required token inputs by action:
--create-token- requires
rpc,nexus,wif,symbol - NFT path requires
token_schemas - fungible path requires
token_max_supplyandfungible_decimals
- requires
--create-series- requires
carbon_token_id,token_schemas,series_metadata
- requires
--mint-nft- requires
carbon_token_id,phantasma_series_id,token_schemas,nft_metadata
- requires
--mint-fungible- requires
carbon_token_id,mint_fungible_amount mint_fungible_todefaults to the signer address when omitted
- requires
series_metadata and nft_metadata accept either:
- a JSON object of
name -> value - an array of
{ "name": "...", "value": ... }
Compile a .tomb source file through pha-tomb from PATH, or pin an exact local compiler with --compiler / PHA_TOMB_PATH.
pha-deploy contract compile \
--source ./contracts/demo.tomb \
--compiler /path/to/pha-tomb \
--out ./dist/contracts/demo \
--debug \
--protocol 16 \
--nativecheck warnSupported compile flags:
--source <path>: required.tombsource file--compiler <path>: optional explicitpha-tombexecutable path; takes precedence overPHA_TOMB_PATHandPATH--out <dir>: final artifact bundle directory--contract-name <name>: required when the compiler emits multiple modules and you need to pick one--protocol <number>: passed through topha-tomb--debug: request debug artifacts--nativecheck <off|warn|error>--libpath <path>: repeatable additional library search path
PHA_TOMB_PATH=/path/to/pha-tomb is also supported when --compiler is omitted and you want to avoid whichever pha-tomb happens to be first in PATH.
Compile output:
- prints the exact compiler command and cwd
- prints separated
pha-tomb stdout/pha-tomb stderr - materializes an artifact bundle in the selected output directory
- writes
manifest.json - copies:
<contract>.pvm<contract>.abi- optional
<contract>.debug - optional
<contract>.asm - optional
<contract>.pvm.hex - optional
<contract>.abi.hex
manifest.json is the preferred handoff format for later deploy/upgrade/attach commands.
Deploy a compiled contract bundle.
Using the manifest produced by contract compile:
pha-deploy contract deploy \
--rpc https://testnet.phantasma.info/rpc \
--nexus testnet \
--chain main \
--wif <WIF> \
--manifest ./dist/contracts/demo/manifest.json \
--dry-runUsing explicit artifact paths instead of a manifest:
pha-deploy contract deploy \
--rpc https://testnet.phantasma.info/rpc \
--nexus testnet \
--wif <WIF> \
--contract-name demo \
--script ./dist/contracts/demo/demo.pvm \
--abi ./dist/contracts/demo/demo.abiUpgrade an already deployed contract using the same artifact inputs:
pha-deploy contract upgrade \
--rpc https://testnet.phantasma.info/rpc \
--nexus testnet \
--chain main \
--wif <WIF> \
--manifest ./dist/contracts/demo/manifest.json \
--dry-runAttach a compiled VM contract bundle to an already existing token symbol:
pha-deploy contract attach \
--rpc https://testnet.phantasma.info/rpc \
--nexus testnet \
--chain main \
--wif <WIF> \
--manifest ./dist/contracts/demo/manifest.json \
--symbol DEMO \
--dry-runWhen --symbol is omitted, contract attach defaults to the bundle contract name from the manifest or direct artifact inputs.
Shared deploy/upgrade/attach flags:
--rpc <url>: required--nexus <name>: required--chain <name>: optional, defaults tomain--wif <wif>: required--manifest <path>: preferred compiled bundle input--contract-name <name>: required when using direct--script/--abi--script <path>: compiled.pvm--abi <path>: compiled.abi--debug <path>: optional.debug--gas-price <int>--gas-limit <int>--pow <int>--payload-hex <hex>--dry-run
Attach-only flag:
--symbol <symbol>: existing token symbol to attach to; defaults to the bundle contract name when omitted
Deploy/upgrade output always includes:
- operation
- contract name
- signer address
- script byte count
- ABI byte count
- generated VM script hex
- signed transaction hex
Attach output also prints the resolved token symbol used for the interop call.
When --dry-run is omitted, the CLI also broadcasts the transaction, waits for the tx result, and prints the tx hash.
Create an NFT token from config:
pha-deploy --create-token --config ./config.tomlMint fungible tokens without editing the config file:
pha-deploy --mint-fungible \
--config ./config.toml \
--carbon-token-id 123 \
--mint-fungible-amount 100000000Compile, then deploy from the emitted manifest:
pha-deploy contract compile --source ./contracts/demo.tomb
pha-deploy contract deploy \
--rpc https://testnet.phantasma.info/rpc \
--nexus testnet \
--wif <WIF> \
--manifest ./dist/contracts/demo/manifest.json \
--dry-runThis repo ships a justfile with the current documented shortcuts:
just buildjust testjust ctjust ctfjust ctdjust csjust csdjust mnjust mndjust mfjust mfd
Run just --list to inspect the full local helper set.