### Example CLI Commands Source: https://github.com/zenx-labs/godl-program/blob/main/CLAUDE.md Examples of running specific commands with the GODL CLI. ```bash cargo run -p cli -- board ``` ```bash cargo run -p cli -- deploy --amount 100000 --square 7 --pooled ``` -------------------------------- ### Get Buffer Address from Keypair Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Derives the Solana address from a generated keypair file. This address is used to interact with the buffer account on-chain. ```bash BUFFER_ADDRESS=$(solana address -k "$BUFFER_KEYPAIR") echo "Buffer keypair: $BUFFER_KEYPAIR" echo "Buffer address: $BUFFER_ADDRESS" ``` -------------------------------- ### Run Test Suite Source: https://github.com/zenx-labs/godl-program/blob/main/README.md Execute the test suite for the project using the Solana toolchain. ```bash cargo test-sbf ``` -------------------------------- ### Write Program to On-Chain Buffer Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Deploys the locally built program binary to a buffer account on the Solana mainnet. Requires a Helius API key for network access. ```bash solana program write-buffer "target/deploy/${LIBRARY_NAME}.so" \ --buffer "$BUFFER_KEYPAIR" \ --with-compute-unit-price 1000000 \ --url "https://mainnet.helius-rpc.com/?api-key=${HELIUS_API_KEY}" ``` -------------------------------- ### Build All Targets Source: https://github.com/zenx-labs/godl-program/blob/main/CLAUDE.md Builds all project components for host targets using Cargo. ```bash cargo build --release ``` -------------------------------- ### Build Solana Program with solana-verify Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Builds the Solana program using solana-verify, ensuring reproducible builds. It first removes existing artifacts to guarantee a fresh build. ```bash rm -f target/deploy/*.so solana-verify build --library-name "$LIBRARY_NAME" ``` -------------------------------- ### Build On-Chain Program Source: https://github.com/zenx-labs/godl-program/blob/main/CLAUDE.md Builds only the on-chain BPF/SBF program using Cargo. ```bash cargo build-sbf --manifest-path program/Cargo.toml ``` -------------------------------- ### Run CLI Command Source: https://github.com/zenx-labs/godl-program/blob/main/CLAUDE.md Executes a command using the GODL CLI binary. Environment variables like RPC and KEYPAIR can be loaded from a .env file. ```bash cargo run -p cli -- [...] ``` -------------------------------- ### Run Test Suite with Line Coverage Source: https://github.com/zenx-labs/godl-program/blob/main/README.md Obtain line coverage information for the test suite using llvm-cov. ```bash cargo llvm-cov ``` -------------------------------- ### Show Files Changed Since Deployed Version Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Displays a summary of files that have been modified between the deployed version and the current HEAD. Useful for a quick overview of changes. ```bash git diff --stat $DEPLOYED_COMMIT..HEAD ``` -------------------------------- ### Generate Temporary Buffer Keypair Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Creates a new, temporary keypair for the program buffer. The address of this keypair will serve as the buffer address on the Solana network. ```bash BUFFER_KEYPAIR="/tmp/${LIBRARY_NAME}-buffer-$(date +%s).json" solana-keygen new -o "$BUFFER_KEYPAIR" --no-bip39-passphrase --force ``` -------------------------------- ### Show Code Changes Since Deployed Version Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Displays the full code differences between the deployed version and the current HEAD. Essential for a detailed review of code modifications. ```bash git diff $DEPLOYED_COMMIT..HEAD ``` -------------------------------- ### Extend ProgramData Account Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Ensures the ProgramData account is large enough for the new binary. This command uses the permissionless `ExtendProgram` instruction and is paid for by the local CLI wallet. It's safe to re-run. ```bash RPC="https://mainnet.helius-rpc.com/?api-key=${HELIUS_API_KEY}" \ KEYPAIR="$HOME/.config/solana/id.json" \ CARGO_TARGET_DIR=/tmp/godl-cli-target \ cargo run -p cli -- extend-program \ --so-path "target/deploy/${LIBRARY_NAME}.so" \ --headroom 8192 \ --max-sol 0.1 \ --yes ``` -------------------------------- ### Show Commits Since Deployed Version Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Lists all Git commits made since the currently deployed version of the program. This helps in reviewing changes before deployment. ```bash git log --oneline $DEPLOYED_COMMIT..HEAD ``` -------------------------------- ### Generate Multisig Transactions for Upgrade and PDA Verification Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Generates the necessary information to create a program upgrade transaction and a Solana Verify PDA transaction in Squads. The output includes details for the upgrade and a base58 encoded string for the PDA transaction. ```bash COMMIT_HASH=$(git rev-parse HEAD) REMOTE_URL=$(git remote get-url origin | sed 's/\.git$//' | sed 's|git@github.com:|https://github.com/|') BUFFER_REFUND="botHfLbBG8oSrohhfCF63xj3LhpBjJrYQkyE27gA4rN" UPGRADE_NAME="Upgrade ${LIBRARY_NAME} @ ${COMMIT_HASH:0:7}" # Strip all whitespace/newlines so the base58 tx is one continuous, copy-safe block PDA_TX=$(solana-verify export-pda-tx \ "$GITHUB_REPO" \ --library-name "$LIBRARY_NAME" \ --program-id "$PROGRAM_ID" \ --uploader "$MULTISIG_AUTHORITY" \ --encoding base58 \ --compute-unit-price 0 | tr -d '[:space:]') cat <