Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
GODL
https://github.com/zenx-labs/godl-program
Admin
GODL is a Solana on-chain crypto mining protocol built with the steel framework.
Tokens:
3,757
Snippets:
57
Trust Score:
2.4
Update:
4 months ago
Context
Chat
Benchmark
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### 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 -- <subcommand> [...] ``` -------------------------------- ### 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 <<EOF ============== 1) SQUADS — NEW PROGRAM UPGRADE============== Name : ${UPGRADE_NAME} Buffer Address : ${BUFFER_ADDRESS} Buffer Refund : ${BUFFER_REFUND} Commit Link : ${REMOTE_URL}/commit/${COMMIT_HASH} EOF # Print the tx on its own line with no leading indentation so it stays a single clean block echo "============== 2) SOLANA-VERIFY PDA TX (base58) ============= ``` ```bash echo "copy the single line below" echo "------------------------------------------------------------" printf '%s\n' "$PDA_TX" echo "------------------------------------------------------------" ``` -------------------------------- ### Fetch Deployed Commit Hash Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Retrieves the commit hash of the currently deployed program from Solana Verify. This is used to compare against local changes. ```bash DEPLOYED_COMMIT=$(curl -s "https://verify.osec.io/status/${PROGRAM_ID}" -H "Accept: application/json" | grep -o '"commit":"[^"]*"' | cut -d'"' -f4) echo "Currently deployed commit: $DEPLOYED_COMMIT" ``` -------------------------------- ### Verify On-Chain Buffer Integrity Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Compares the hash of the locally built program with the hash of the on-chain buffer account to ensure data integrity. A delay is included to allow the buffer to settle on-chain. ```bash NETWORK_URL="https://mainnet.helius-rpc.com/?api-key=${HELIUS_API_KEY}" # Hash of your locally built program solana-verify get-executable-hash "target/deploy/${LIBRARY_NAME}.so" # Give the buffer write time to settle on-chain before reading the buffer hash sleep 4 # Hash of the on-chain buffer account solana-verify get-buffer-hash -u "$NETWORK_URL" "$BUFFER_ADDRESS" ``` -------------------------------- ### Submit Verification Job Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Submit a verification job to confirm the on-chain program matches the GitHub source. This command may fail due to rate limits or temporary hash mismatches; retry until successful. ```bash solana-verify remote submit-job \ --program-id "$PROGRAM_ID" \ --uploader "$MULTISIG_AUTHORITY" ``` -------------------------------- ### Cleanup Temporary Keypair Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Removes the temporary keypair file used during the deployment process. ```bash rm -f "$BUFFER_KEYPAIR" echo "Cleaned up temporary buffer keypair" ``` -------------------------------- ### Type Check Workspace Source: https://github.com/zenx-labs/godl-program/blob/main/CLAUDE.md Performs a fast type check of the entire workspace without producing build artifacts. ```bash cargo check --workspace ``` -------------------------------- ### Set Buffer Authority to Multisig Source: https://github.com/zenx-labs/godl-program/blob/main/DEPLOY.md Transfers the authority of the program buffer to a specified multisig address. This allows the multisig to control program upgrades. ```bash solana program set-buffer-authority "$BUFFER_ADDRESS" \ --new-buffer-authority "$MULTISIG_AUTHORITY" \ -um ```