### Setup Environment and Run Tests Source: https://launch.solana.com/docs/kora/contributors/adding-a-signer Commands to install dependencies, set environment variables, and execute integration tests. ```bash # Install binaries and dependencies just install just install-ts-sdk just build-ts-sdk # Set environment variables for your service export YOUR_SERVICE_API_KEY="your_key" export YOUR_SERVICE_API_SECRET="your_secret" export YOUR_SERVICE_WALLET_ID="your_wallet" ``` ```bash # Run all integration tests (includes your new signer phase) just test-integration # Run tests with verbose output just test-integration-verbose # Run specific test phase with filter cargo run -p tests --bin test_runner -- --phases your_service ``` -------------------------------- ### Install Client Dependencies Source: https://launch.solana.com/docs/kora/getting-started/quick-start Installs necessary dependencies for the client-side demo. ```bash # From project root (kora/) cd examples/getting-started/demo/client pnpm install --ignore-workspace # use --ignore-workspace to avoid pnpm workspace conflicts ``` -------------------------------- ### Install SDK Source: https://launch.solana.com/docs/commerce-kit/quickstart/react-hooks Install the required package using pnpm. ```bash pnpm add @solana-commerce/sdk ``` -------------------------------- ### Install Development Tools Source: https://launch.solana.com/docs/solana-pay/quickstart/installation Commands to install the Solana CLI and local validator. ```bash # Solana CLI (for testing and key generation) sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)" # Local validator for testing solana-test-validator ``` -------------------------------- ### Start Protected API Source: https://launch.solana.com/docs/kora/guides/x402 Command to initialize the Protected API server. ```bash pnpm run start:api ``` -------------------------------- ### Install Headless Commerce Package Source: https://launch.solana.com/docs/commerce-kit/quickstart/payment-flows Install the required package via pnpm. ```bash pnpm add @solana-commerce/headless ``` -------------------------------- ### Start Kora Server Source: https://launch.solana.com/docs/kora/beta/jito-guide Commands to start the Kora server using the configuration files. ```bash kora --config kora.toml --rpc-url https://api.mainnet-beta.solana.com rpc start --signers-config signers.toml ``` ```bash ../scripts/start-kora.sh ``` -------------------------------- ### Install Kora and Kit dependencies Source: https://launch.solana.com/docs/kora/guides/kit-client Install the required packages using pnpm. ```bash pnpm add @solana/kora @solana/kit ``` -------------------------------- ### Verify Installation Source: https://launch.solana.com/docs/solana-pay/quickstart/installation Test script to verify the SDK is correctly installed and functional. ```typescript // test-installation.ts import { address } from "@solana/kit"; import { encodeURL } from "@solana/pay"; // Test creating a payment URL const recipient = address("FvJ8k8HhXp4a3zQyFMZd4FvEqcYdYE7gSZWxrEBRfBsB"); const url = encodeURL({ recipient, amount: 0.01, label: "Test Store", message: "Test payment" }); console.log("Solana Pay URL:", url.toString()); // Output: solana:FvJ8k8Hh...?amount=0.01&label=Test%20Store&message=Test%20payment ``` ```bash npx tsx test-installation.ts ``` -------------------------------- ### Run the Client Demo Source: https://launch.solana.com/docs/kora/beta/jito-guide Installs necessary dependencies and executes the client-side demo script in the client directory. ```bash cd examples/jito-bundles/client # Install dependencies pnpm install # Run the demo pnpm start ``` -------------------------------- ### Install Connector Package Source: https://launch.solana.com/docs/commerce-kit/quickstart/wallet-connection Install the required connector package using pnpm. ```bash pnpm add @solana-commerce/connector ``` -------------------------------- ### Install Solana Pay SDK Source: https://launch.solana.com/docs/solana-pay/quickstart/installation Commands to install the core Solana Pay SDK and kit using various package managers. ```bash # Using pnpm (recommended) pnpm add @solana/pay@beta @solana/kit # Using npm npm install @solana/pay@beta @solana/kit # Using yarn yarn add @solana/pay@beta @solana/kit ``` -------------------------------- ### signAndSendBundle cURL Example Source: https://launch.solana.com/docs/kora/beta/bundle-methods Example of submitting a bundle using cURL. ```bash curl -X POST http://localhost:8080 \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "signAndSendBundle", "params": { "transactions": ["base64Tx1", "base64Tx2"], "signer_key": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE" } }' ``` -------------------------------- ### Install Project Dependencies Source: https://launch.solana.com/docs/kora/guides/x402 Install all required Node.js dependencies for the facilitator, API, and client components. ```bash # Install dependencies for all components (facilitator, API, and client) pnpm run install:all ``` -------------------------------- ### Start Kora RPC Server Source: https://launch.solana.com/docs/kora/guides/x402 Command to initialize the Kora RPC server. ```bash pnpm run start:kora ``` -------------------------------- ### Start Facilitator Source: https://launch.solana.com/docs/kora/guides/x402 Command to initialize the Facilitator service. ```bash pnpm run start:facilitator ``` -------------------------------- ### Run Kora Server Source: https://launch.solana.com/docs/kora Start the Kora server using the test configuration. ```bash just run ``` -------------------------------- ### Create Environment File Source: https://launch.solana.com/docs/kora/getting-started/quick-start Creates an empty .env file to be populated by the setup script. ```bash # Create .env file (will be populated by setup script) touch .env ``` -------------------------------- ### Install Commerce Kit Packages Source: https://launch.solana.com/docs/commerce-kit Install the necessary packages via pnpm based on whether you need the unified meta package, UI components, or headless primitives. ```bash # Unified Commerce Meta Package pnpm add @solana-commerce/kit # Drop-in payment button (most common) pnpm add @solana-commerce/react # Wallet connection only pnpm add @solana-commerce/connector # Headless commerce primitives pnpm add @solana-commerce/headless # Solana Pay QR codes pnpm add @solana-commerce/solana-pay # React hooks for custom UIs pnpm add @solana-commerce/sdk ``` -------------------------------- ### Get Version cURL Example Source: https://launch.solana.com/docs/kora/beta/bundle-methods Example cURL request for the getVersion method. ```bash curl -X POST http://localhost:8080 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"getVersion","params":{}}' ``` -------------------------------- ### Configure .env File Source: https://launch.solana.com/docs/kora/operators/signers Example of the required environment variables for the Turnkey signer. ```bash # .env file TURNKEY_ORGANIZATION_ID="your_organization_id" TURNKEY_API_PUBLIC_KEY="your_turnkey_api_public_key" TURNKEY_API_PRIVATE_KEY="your_turnkey_api_private_key" TURNKEY_PRIVATE_KEY_ID="your_private_key_id" TURNKEY_PUBLIC_KEY="your_solana_public_key" ``` -------------------------------- ### Install Kora TypeScript SDK Source: https://launch.solana.com/docs/kora/getting-started/installation Installs the SDK and its required peer dependencies. ```bash pnpm add @solana/kora ``` ```bash pnpm add @solana/kora @solana/kit ``` ```bash pnpm add @solana/kit @solana-program/token @solana-program/compute-budget \ @solana/kit-plugin-instruction-plan @solana/kit-plugin-payer @solana/kit-plugin-rpc ``` -------------------------------- ### Start the Kora Server Source: https://launch.solana.com/docs/kora/beta/jito-guide Initializes the Kora server with the specified configuration, RPC URL, and signer settings. ```bash cd examples/jito-bundles/server kora --config kora.toml --rpc-url https://api.mainnet-beta.solana.com rpc start --signers-config signers.toml ``` -------------------------------- ### HTTP GET Request Example Source: https://launch.solana.com/docs/solana-pay/specification/version1 A standard HTTP GET request for a Solana Pay transaction. ```http GET /solana-pay?order=12345 HTTP/1.1 Host: example.com Connection: close Accept: application/json Accept-Encoding: br, gzip, deflate ``` -------------------------------- ### Start Kora Client Source: https://launch.solana.com/docs/kora/getting-started/quick-start Execute this command within the client directory to initiate the Kora client. ```bash pnpm start ``` -------------------------------- ### cURL Request Example Source: https://launch.solana.com/docs/kora/json-rpc-api/methods/get-config Example of how to invoke the getConfig method using cURL. ```bash curl -X POST http://localhost:8080 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"getConfig","params":[]}' ``` -------------------------------- ### Verify Kora Installation Source: https://launch.solana.com/docs/kora/beta/installation Check the installed version of the Kora CLI. ```bash kora --version ``` -------------------------------- ### Start Kora RPC Server Source: https://launch.solana.com/docs/kora/getting-started/quick-start Starts the Kora RPC server using the specified signers configuration. ```bash # From ./server directory kora rpc start --signers-config signers.toml ``` ```bash JUPITER_API_KEY=your_api_key kora rpc start --signers-config signers.toml ``` ```bash kora rpc --config path/to/kora.toml start --signers-config path/to/signers.toml ``` -------------------------------- ### Install Keychain Packages Source: https://launch.solana.com/docs/keychain/getting-started/typescript Install the umbrella package for all signers or select individual packages for a smaller footprint. ```bash # Umbrella package (includes all signers) pnpm add @solana/keychain # Or install individual packages pnpm add @solana/keychain-core # Core interfaces (required for custom signers) pnpm add @solana/keychain-memory # Local keypair signer pnpm add @solana/keychain-vault # HashiCorp Vault pnpm add @solana/keychain-aws-kms # AWS KMS pnpm add @solana/keychain-gcp-kms # GCP KMS pnpm add @solana/keychain-privy # Privy pnpm add @solana/keychain-turnkey # Turnkey pnpm add @solana/keychain-fireblocks # Fireblocks pnpm add @solana/keychain-cdp # Coinbase Developer Platform pnpm add @solana/keychain-crossmint # Crossmint pnpm add @solana/keychain-dfns # Dfns pnpm add @solana/keychain-openfort # Openfort pnpm add @solana/keychain-para # Para pnpm add @solana/keychain-utila # Utila # Kit client plugins (keychainSigner / keychainPayer / keychainIdentity) pnpm add @solana/keychain-kit-plugin ``` -------------------------------- ### Install Kora CLI via Cargo Source: https://launch.solana.com/docs/kora/beta/installation Install the specific beta release version directly from crates.io. ```bash cargo install kora-cli@2.2.0-beta.7 ``` -------------------------------- ### Install Solana Attestations Library Source: https://launch.solana.com/docs/attestations Commands to install the sas-lib package using common JavaScript package managers. ```bash # Using pnpm (recommended) pnpm add sas-lib # Using npm npm install sas-lib # Using yarn yarn add sas-lib ``` -------------------------------- ### cURL Request Example Source: https://launch.solana.com/docs/kora/json-rpc-api/methods/sign-transaction A command-line example using cURL to perform the signTransaction request via POST. ```bash curl -X POST http://localhost:8080 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"signTransaction","params":{"transaction":"base64EncodedTransaction"}}' ``` -------------------------------- ### Install Commerce Kit Source: https://launch.solana.com/docs/commerce-kit/quickstart/payment-button Use this command to add the required package to your project. ```bash pnpm add @solana-commerce/kit ``` -------------------------------- ### Install Kora CLI via Cargo Source: https://launch.solana.com/docs/kora/getting-started/installation Installs the Kora CLI directly from crates.io. ```bash cargo install kora-cli ``` -------------------------------- ### Project Directory Structure Source: https://launch.solana.com/docs/kora/beta/jito-guide Overview of the file structure for the Jito bundles example project. ```text jito-bundles/ ├── client/ │ ├── src/ │ │ └── index.ts # Bundle demo implementation │ └── package.json ├── server/ │ ├── kora.toml # Kora configuration with bundles enabled │ └── signers.toml # Signer configuration └── scripts/ └── start-kora.sh # Server startup script ``` -------------------------------- ### Example Environment Variables Source: https://launch.solana.com/docs/kora/contributors/adding-a-signer Define the required environment variables for the new signer in .env files. ```bash # YourService Signer Configuration YOUR_SERVICE_API_KEY=your_api_key_here YOUR_SERVICE_API_SECRET=your_api_secret_here YOUR_SERVICE_WALLET_ID=your_wallet_id_here ``` -------------------------------- ### cURL Example for estimateTransactionFee Source: https://launch.solana.com/docs/kora/json-rpc-api/methods/estimate-transaction-fee A command-line example using cURL to perform the JSON-RPC request. ```bash curl -X POST http://localhost:8080 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"estimateTransactionFee","params":{"transaction":"base64EncodedTransaction","fee_token":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}' ``` -------------------------------- ### Create Credential Instruction Example Source: https://launch.solana.com/docs/attestations/instructions/create-credential Demonstrates how to initialize a credential using the sas-lib library and execute the transaction. ```typescript import { getCreateCredentialInstruction } from "sas-lib"; const transaction = getCreateCredentialInstruction({ payer: payerSigner, credential: credentialPublicKey, authority: authoritySigner, systemProgram: systemProgramPublicKey, name: "My Credential", signers: [signer1PublicKey, signer2PublicKey] }); // Send the transaction await transaction.sendAndConfirm(); ``` -------------------------------- ### Install Solana Pay Dependencies Source: https://launch.solana.com/docs/solana-pay/quickstart/transaction-requests Required packages for setting up transaction request handling. ```bash pnpm add @solana/pay@beta @solana/kit @solana-program/system \ @solana/kit-plugin-rpc @solana/kit-plugin-payer @solana/kit-plugin-instruction-plan ``` -------------------------------- ### cURL Request Example Source: https://launch.solana.com/docs/kora/json-rpc-api/methods/get-supported-tokens Example of how to invoke the getSupportedTokens method using a cURL command. ```bash curl -X POST http://localhost:8080 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"getSupportedTokens","params":[]}' ``` -------------------------------- ### Configure gas_swap Plugin and Validation Source: https://launch.solana.com/docs/kora/beta/configuration Full configuration example for the gas_swap plugin, including required programs, allowed tokens, and margin-based pricing. ```toml [kora.plugins] enabled = ["gas_swap"] [validation] allowed_programs = [ "11111111111111111111111111111111", # System Program "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", # SPL Token Program "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb", # Token-2022 Program ] allowed_tokens = [ "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", # USDC ] [validation.price] type = "margin" margin = 0.0 ``` -------------------------------- ### Create Attestation Instruction Example Source: https://launch.solana.com/docs/attestations/instructions/create-attestation Demonstrates how to initialize the create attestation instruction and execute the resulting transaction. ```typescript import { getCreateAttestationInstruction } from "sas-lib"; const transaction = getCreateAttestationInstruction({ payer: payerSigner, authority: authoritySigner, credential: credentialPublicKey, schema: schemaPublicKey, attestation: attestationPublicKey, systemProgram: systemProgramPublicKey, nonce: noncePublicKey, data: attestationData, expiry: expiryTimestamp }); // Send the transaction await transaction.sendAndConfirm(); ``` -------------------------------- ### Install TypeScript SDK Source: https://launch.solana.com/docs/kora/beta/installation Add the beta version of the Kora SDK to your project using pnpm. ```bash pnpm add @solana/kora@beta ``` -------------------------------- ### cURL Request Example Source: https://launch.solana.com/docs/kora/json-rpc-api/methods/sign-and-send-transaction Example of invoking the signAndSendTransaction method using a cURL command. ```bash curl -X POST http://localhost:8080 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"signAndSendTransaction","params":{"transaction":"base64EncodedTransaction"}}' ``` -------------------------------- ### Run Monitoring Stack Source: https://launch.solana.com/docs/kora/operators/monitoring Start the full monitoring stack using the provided project command. ```bash # from kora root directory just run-metrics ``` -------------------------------- ### Estimate Bundle Fee cURL Example Source: https://launch.solana.com/docs/kora/beta/bundle-methods Example cURL request for the estimateBundleFee method. ```bash curl -X POST http://localhost:8080 \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "estimateBundleFee", "params": { "transactions": ["base64Tx1", "base64Tx2"], "fee_token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" } }' ``` -------------------------------- ### Install Peer Dependencies Source: https://launch.solana.com/docs/commerce-kit/quickstart/installation Install the required peer dependencies for the Solana Commerce Kit using your preferred package manager. ```bash pnpm add gill # or @solana/kit pnpm add @solana-program/token # or @solana-program/target-program pnpm add @my-program/codama-js-client ``` -------------------------------- ### signBundle cURL Example Source: https://launch.solana.com/docs/kora/beta/bundle-methods Example of invoking the signBundle method using a cURL command. ```bash curl -X POST http://localhost:8080 \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "signBundle", "params": { "transactions": ["base64Tx1", "base64Tx2"], "signer_key": "3Z1Ef7YaxK8oUMoi6exf7wYZjZKWJJsrzJXSt1c3qrDE" } }' ``` -------------------------------- ### Start Local Test Validator Source: https://launch.solana.com/docs/kora/getting-started/quick-start Launches the Solana test validator from the project root. ```bash # From project root or anywhere solana-test-validator -r ``` -------------------------------- ### Implement Rust Signer Usage Source: https://launch.solana.com/docs/keychain/adding-signers Example of initializing a custom signer using the Solana Keychain library. ```rust use solana_keychain::{Signer, SolanaSigner}; #[tokio::main] async fn main() -> Result<(), Box> { let signer = Signer::from_your_service( "your-api-key".to_string(), "your-api-secret".to_string(), "your-wallet-id".to_string(), "your-public-key".to_string(), )?; let pubkey = signer.pubkey(); println!("Public key: {}", pubkey); Ok() } ``` -------------------------------- ### Solana Pay Transfer Request Examples Source: https://launch.solana.com/docs/solana-pay/specification/version1 Example URLs for different transfer scenarios including SOL, SPL tokens, and user-prompted amounts. ```text solana:mvines9iiHiQTysrwkJjGf2gb9Ex9jXJX8ns3qwf2kN?amount=1&label=Michael&message=Thanks%20for%20all%20the%20fish&memo=OrderId12345 ``` ```text solana:mvines9iiHiQTysrwkJjGf2gb9Ex9jXJX8ns3qwf2kN?amount=0.01&spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v ``` ```text solana:mvines9iiHiQTysrwkJjGf2gb9Ex9jXJX8ns3qwf2kN?label=Michael ``` -------------------------------- ### Install Optional Dependencies Source: https://launch.solana.com/docs/solana-pay/quickstart/installation Additional packages required for transfer creation and validation, or for using client factories. ```bash pnpm add @solana-program/system @solana-program/token @solana-program/token-2022 @solana-program/memo ``` ```bash pnpm add @solana/kit-plugin-rpc @solana/kit-plugin-payer @solana/kit-plugin-instruction-plan ``` -------------------------------- ### Production Configuration Template Source: https://launch.solana.com/docs/kora/operators/configuration A complete configuration example covering authentication, caching, usage limits, and security validation policies. ```toml # Kora Paymaster Configuration # Last Updated: 2025-08-22 [kora] # Rate limiting: 100 requests per second globally rate_limit = 100 # Optional payment address (defaults to signer address(es) if not specified) # payment_address = "YourPaymentAddressPubkey11111111111111111111" [kora.auth] # Authentication (choose based on security needs) # api_key = "kora_live_sk_generate_secure_key_here" hmac_secret = "kora_hmac_minimum_32_character_secret_here" max_timestamp_age = 300 # Caching configuration (optional but recommended for production) [kora.cache] enabled = true url = "redis://localhost:6379" default_ttl = 300 # 5 minutes account_ttl = 60 # 1 minute # Usage limiting (optional, prevents abuse) [kora.usage_limit] enabled = true cache_url = "redis://localhost:6379" # Can share same Redis instance as cache max_transactions = 100 # Per-wallet limit fallback_if_unavailable = true # Don't block if Redis is down # Disable unnecessary RPC methods for security [kora.enabled_methods] liveness = true estimate_transaction_fee = true get_supported_tokens = true sign_transaction = false sign_and_send_transaction = false transfer_transaction = false get_blockhash = true get_config = true get_payer_signer = true [validation] # Use production oracle price_source = "Jupiter" # Conservative transaction limits max_allowed_lamports = 1000000 # 0.001 SOL max max_signatures = 10 # Block durable nonce transactions (security default) allow_durable_transactions = false # Minimal program allowlist (expand as needed) allowed_programs = [ "11111111111111111111111111111111", # System Program "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", # SPL Token "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", # Associated Token "AddressLookupTab1e1111111111111111111111111", # Address Lookup Table "ComputeBudget11111111111111111111111111111111", # Compute Budget "MyProgram111111111111111111111111111111111", # Add your specific program IDs here ] # Production token allowlist allowed_tokens = [ "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", # USDC "So11111111111111111111111111111111111111112", # Wrapped SOL "MyToken1111111111111111111111111111111111111111", # Add tokens your application uses ] # Payment tokens (only liquid, trusted tokens) allowed_spl_paid_tokens = [ "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", # USDC only ] # Known bad actors or compromised addresses disallowed_accounts = [ "BadActor1111111111111111111111111111111111111111", ] # Restrictive fee payer policy (recommended for production) [validation.fee_payer_policy.system] allow_transfer = false # Block SOL transfers from fee payer allow_assign = false # Block account ownership changes allow_create_account = false # Block creating accounts with fee payer funds allow_allocate = false # Block allocating space for fee payer accounts [validation.fee_payer_policy.system.nonce] allow_initialize = false # Block nonce account initialization allow_advance = false # Block nonce advancement allow_authorize = false # Block nonce authority changes allow_withdraw = false # Block nonce withdrawals [validation.fee_payer_policy.spl_token] allow_transfer = false # Critical: Block SPL transfers allow_burn = false # Block token burning allow_close_account = false # Block account closures allow_approve = false # Block token approvals ``` -------------------------------- ### Expected Deployment Output Source: https://launch.solana.com/docs/kora/operators/deployment/railway The console output indicating a successful build and container start. ```text Build time: 121.81 seconds Deploy complete Starting Container ``` -------------------------------- ### Initialize Environment Source: https://launch.solana.com/docs/kora/guides/full-demo Prepares the client environment for the demo execution. ```bash pnpm init-env ``` -------------------------------- ### HTTP GET Response Example Source: https://launch.solana.com/docs/solana-pay/specification/version1 A standard HTTP GET response containing the label and icon for the transaction. ```http HTTP/1.1 200 OK Connection: close Content-Type: application/json Content-Length: 62 Content-Encoding: gzip {"label":"Michael Vines","icon":"https://example.com/icon.svg"} ``` -------------------------------- ### Initialize Kora Project Source: https://launch.solana.com/docs/kora/getting-started/quick-start Clones the repository and navigates to the demo directory. ```bash git clone https://github.com/solana-foundation/kora cd kora git checkout v2.0.5 cd examples/getting-started/demo ``` -------------------------------- ### Install Solana Attestations Library Source: https://launch.solana.com/docs/attestations/quickstart/installation Use these commands to add the sas-lib dependency to your project using pnpm, npm, or yarn. ```bash # Using pnpm (recommended) pnpm add sas-lib # Using npm npm install sas-lib # Using yarn yarn add sas-lib ``` -------------------------------- ### Reinstall Dependencies Source: https://launch.solana.com/docs/solana-pay/quickstart/installation Commands to remove node_modules and perform a fresh install. ```bash rm -rf node_modules pnpm install ``` -------------------------------- ### Run Client Demo Source: https://launch.solana.com/docs/kora/guides/x402 Command to execute the client-side payment flow demonstration. ```bash pnpm run demo ``` -------------------------------- ### Install Solana Keychain TypeScript Package Source: https://launch.solana.com/docs/keychain Add the package to your TypeScript project using pnpm. ```bash pnpm add @solana/keychain ``` -------------------------------- ### Navigate to Demo Directory Source: https://launch.solana.com/docs/kora/guides/x402 Change the working directory to the X402 demo folder. ```bash cd examples/x402/demo ``` -------------------------------- ### View Metric Output Source: https://launch.solana.com/docs/kora/operators/monitoring Example output showing request totals, durations, and signer balances. ```text # Total requests by method and status kora_http_requests_total{method="signTransaction",status="200"} 42 kora_http_requests_total{method="signTransaction",status="400"} 3 # Request duration (in seconds) by method kora_http_request_duration_seconds{method="signTransaction"} 0.045 # Signer balances (for multi-signer setups) signer_balance_lamports{signer_name="primary_signer",signer_pubkey="4gBe...xyz"} 500000000 signer_balance_lamports{signer_name="backup_signer",signer_pubkey="7XyZ...abc"} 300000000 ``` -------------------------------- ### Install Solana Pay package Source: https://launch.solana.com/docs/commerce-kit/quickstart/solana-pay Use this command to add the Solana Pay package to your project dependencies. ```bash pnpm add @solana-commerce/solana-pay ``` -------------------------------- ### cURL Request Example Source: https://launch.solana.com/docs/kora/json-rpc-api/methods/transfer-transaction Execute a transferTransaction request using the cURL command-line tool. ```bash curl -X POST http://localhost:8080 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"transferTransaction","params":{"amount":1000000,"token":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","source":"sourcePublicKey","destination":"destinationPublicKey"}}' ``` -------------------------------- ### Clone Kora Repository Source: https://launch.solana.com/docs/kora/beta/jito-guide Commands to clone the repository and navigate to the Jito bundles example directory. ```bash git clone https://github.com/solana-foundation/kora.git cd kora/examples/jito-bundles ``` -------------------------------- ### Install Solana Keychain Rust Crate Source: https://launch.solana.com/docs/keychain Add the dependency to your Rust project using cargo. ```bash cargo add solana-keychain ``` -------------------------------- ### Execute Full Demo Source: https://launch.solana.com/docs/kora/guides/full-demo Runs the complete gasless transaction demonstration from the client directory. ```bash # From the client directory pnpm full-demo ``` -------------------------------- ### Initialize Railway Project Source: https://launch.solana.com/docs/kora/operators/deployment/railway Set up a new Railway project within the current directory. ```bash railway init ``` -------------------------------- ### Setup Keypairs Source: https://launch.solana.com/docs/kora/beta/jito-guide Generates a sender keypair and retrieves the Kora payer signer address. ```typescript async function setupKeys(client: KoraClient) { console.log("\n[2/4] Setting up keypairs"); const senderKeypair = await generateKeyPairSigner(); console.log(" → Sender:", senderKeypair.address); const { signer_address } = await client.getPayerSigner(); console.log(" → Kora signer address:", signer_address); return { senderKeypair, signer_address }; } ``` -------------------------------- ### Run Kora with YourService Signer Source: https://launch.solana.com/docs/kora/contributors/adding-a-signer Start the Kora RPC service using the specified signer configuration file. ```bash kora rpc start --signers-config signers.toml ``` -------------------------------- ### Example Pull Request Structure Source: https://launch.solana.com/docs/keychain/adding-signers Use this template when submitting a new signer integration to ensure all requirements are met. ```markdown feat(signer): add YourService signer integration Adds support for YourService as a signing backend. - [X] Code compiles without warnings (`just build`) - [X] Code is formatted/linting passes (`just fmt`) - [X] Add comprehensive tests with wiremock - All tests pass (`just test`) - [X] Implemented SolanaSigner trait for YourServiceSigner - [X] Added feature flag 'your_service' - [X] HTTPS enforced, HTTP timeouts configured - [X] Added to README.md supported backends table Closes #1337 ``` -------------------------------- ### Initialize Environment Source: https://launch.solana.com/docs/kora/getting-started/quick-start Runs the environment initialization script to generate keypairs and fund test accounts. ```bash # From ./client directory pnpm init-env ``` -------------------------------- ### Kora Server Configuration Output Source: https://launch.solana.com/docs/kora/getting-started/quick-start Example of the expected JSON output confirming the Kora server is running and correctly configured. ```json Kora Config: { fee_payer: 'Df2UmGQH86TBDsub7XZoSAo7KZa1ZJZr2w1PL1APUjjU', validation_config: { max_allowed_lamports: 1000000, max_signatures: 10, allowed_programs: [ '11111111111111111111111111111111', 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL', 'AddressLookupTab1e1111111111111111111111111', 'ComputeBudget11111111111111111111111111111111' ], allowed_tokens: [ 'usdCAEFbouFGxdkbHCRtMTcN7DJHd3aCmP9vqjLgmAp' ], allowed_spl_paid_tokens: [ 'usdCAEFbouFGxdkbHCRtMTcN7DJHd3aCmP9vqjLgmAp' ], disallowed_accounts: [], price_source: 'Mock', fee_payer_policy: {...}, price: { type: 'margin', margin: 0 } }, enabled_methods: { ... } } } Blockhash: C8W8d5w2H4jKXyFg5CEBoiaPvEpJ1am7xLxZ3fym4a2g ``` -------------------------------- ### Direct RPC Queries with useArcClient Source: https://launch.solana.com/docs/commerce-kit/quickstart/react-hooks Example of using useArcClient to fetch an account balance via the shared RPC client. ```typescript import { useArcClient } from "@solana-commerce/sdk"; import { getSharedRpc } from "@solana-commerce/sdk/core/rpc-manager"; import { address } from "@solana/kit"; function AccountBalance() { const { network, wallet } = useArcClient(); const [balance, setBalance] = useState(null); useEffect(() => { if (!wallet.address) return; const rpc = getSharedRpc(network.rpcUrl); async function fetchBalance() { const result = await rpc.getBalance(wallet.address).send(); setBalance(result); } fetchBalance(); }, [wallet.address, network.rpcUrl]); if (!wallet.address) return
Connect wallet to see balance
; return
Balance: {(Number(balance) / 1e9).toFixed(4)} SOL
; } ``` -------------------------------- ### HTTP POST Request Example Source: https://launch.solana.com/docs/solana-pay/specification/version1 A standard HTTP POST request containing the user's account address. ```http POST /solana-pay?order=12345 HTTP/1.1 Host: example.com Connection: close Accept: application/json Accept-Encoding: br, gzip, deflate Content-Type: application/json Content-Length: 57 {"account":"mvines9iiHiQTysrwkJjGf2gb9Ex9jXJX8ns3qwf2kN"} ``` -------------------------------- ### Define GET Response Body Source: https://launch.solana.com/docs/solana-pay/specification/version1 The required JSON structure for a successful GET request response. ```json { "label": "