Use this file to discover all available pages before exploring further.
Make sure you have a wallet set up at ~/.config/solana/id.json. Get one here, if you don’t have one.
The CLI will use this wallet as the default fee payer and mint authority.
Ensure you have Node >= v20.9.0 installed on your machine. Windows users do not require WSL.
Run this single command to install the CLI.
npm i -g @lightprotocol/zk-compression-cli
Building from source
If you prefer to build the CLI from source, follow the steps below to install the necessary prerequisites.1. Activate the Development EnvironmentEnsure you are at the root of the monorepo.
. ./scripts/devenv
2. Install and build the monorepo from source. This also builds the CLI.
./scripts/install.sh
./scripts/build.sh
3. Make your CLI available globally
pnpm link --global
# Verify the CLI was correctly installedwhich light
By default, the CLI interacts with localnet. You can view the current config by running:
light config --get
1. Once globally installed, start the Light test validator
light test-validator
This starts a Solana test-validator with the Light System programs and accounts, a prover server, and the Photon indexer as background processes against a clean ledger.
# Pass --skip-indexer to start without the indexerlight test-validator --skip-indexer# Pass --skip-prover to start without the proverlight test-validator --skip-prover
Note:The CLI currently runs the photon indexer and light-prover as background processes at port: 8784 and 3001 respectively.
2. Ensure you have sufficient localnet funds
# Airdrop 1 SOLsolana airdrop 1# Print your addresssolana address# Print your balancesolana balance
Now you’re all set up to run CLI commands!
Alternative: Using Devnet
To switch to Devnet, point the URLs to an RPC supporting ZK Compression. For example, run:
USAGE $ light create-mint [--mint-keypair <value>] [--mint-authority <value>] [--mint-decimals <value>]FLAGS --mint-authority=<value> Path to the mint authority keypair file. Defaults to the fee payer. --mint-decimals=<value> Number of base 10 digits to the right of the decimal place [default: 9]. --mint-keypair=<value> Path to a mint keypair file. Defaults to a random keypair.
light transfer --mint "YOUR_MINT_ADDRESS" --to "RECIPIENT_WALLET_ADDRESS" --amount 4200000000
USAGE $ light transfer --mint <value> --to <value> --amount <value> [--fee-payer <value>]FLAGS --amount=<value> (required) Amount to send. --fee-payer=<value> Fee payer account. Defaults to the client keypair. --mint=<value> (required) Mint to transfer --to=<value> (required) Recipient address
USAGE $ light create-token-account MINT [--owner <value>]ARGUMENTS MINT (required) Base58 encoded mint address.FLAGS --owner=<value> Owner of the token account. Defaults to the fee payer's public key.
USAGE $ light token-balance --mint <value> --owner <value>FLAGS --mint=<value> (required) Mint address of the token account. --owner=<value> (required) Address of the token owner.