### Install and Configure Jito Solana Validator (Bash) Source: https://context7.com/stockpilelabs/awesome-solana-oss/llms.txt Provides instructions for setting up a Jito Solana validator, including cloning the repository, building from source using provided scripts, and configuring the validator with essential parameters like identity, ledger path, RPC port, entrypoint, genesis hash, and tip payment/distribution programs. ```bash # Clone Jito Solana git clone https://github.com/jito-foundation/jito-solana cd jito-solana # Build from source ./scripts/cargo-install-all.sh # Configure validator solana-validator \ --identity validator-keypair.json \ --ledger /mnt/ledger \ --rpc-port 8899 \ --entrypoint entrypoint.mainnet-beta.solana.com:8001 \ --expected-genesis-hash 5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d \ --tip-payment-program-pubkey T1pyyaTNZsKv2WcRAB8oVnk93mLJw2XzjtVYqCsaHqt \ --tip-distribution-program-pubkey 4R3gSG8BpU4t19KYj8CfnbtRpnT8gtk4dvTHxVRwc2r7 ``` -------------------------------- ### Parse Transaction with Xray (TypeScript) Source: https://context7.com/stockpilelabs/awesome-solana-oss/llms.txt Demonstrates how to parse a Solana transaction using the Xray library from Helius Labs. This example shows how to fetch transaction details by its signature and an RPC endpoint, and then log the transaction type and any associated token transfers or NFT events. It requires the `@helius-labs/xray` package. ```typescript import { parseTransaction } from '@helius-labs/xray'; const parsedTx = await parseTransaction({ transactionSignature: 'your_tx_signature', rpcEndpoint: 'https://api.mainnet-beta.solana.com', }); console.log('Transaction type:', parsedTx.type); console.log('Token transfers:', parsedTx.tokenTransfers); console.log('NFT events:', parsedTx.nftEvents); ``` -------------------------------- ### Configure and Run Lite RPC (Bash) Source: https://context7.com/stockpilelabs/awesome-solana-oss/llms.txt This bash script demonstrates the steps to clone, build, configure, and run the Lite RPC service for faster Solana transaction processing. It involves cloning the repository, compiling the code, setting environment variables for connection addresses and RPC URL, and finally executing the service. ```bash # Clone and build Lite RPC git clone https://github.com/blockworks-foundation/lite-rpc cd lite-rpc cargo build --release # Configure connection export LITE_RPC_WS_ADDR=127.0.0.1:8900 export LITE_RPC_HTTP_ADDR=127.0.0.1:8899 export RPC_URL=https://api.mainnet-beta.solana.com # Run the service ./target/release/lite-rpc ``` -------------------------------- ### Place Order with Openbook V2 (Rust) Source: https://context7.com/stockpilelabs/awesome-solana-oss/llms.txt This Rust code snippet illustrates how to place an order on an Openbook V2 market. It utilizes the anchor_lang crate and the openbook_v2 state module. The function requires context including the market, user, and open orders account. ```rust use anchor_lang::prelude::*; use openbook_v2::state::Market; pub fn place_order( ctx: Context, side: Side, price_lots: i64, max_base_lots: i64, ) -> Result<()> { let market = &mut ctx.accounts.market.load_mut()?; market.place_order( &ctx.accounts.user, side, price_lots, max_base_lots, ctx.accounts.open_orders.key(), )?; Ok(()) } ``` -------------------------------- ### Connect Wallet with Phantom Adapter (TypeScript) Source: https://context7.com/stockpilelabs/awesome-solana-oss/llms.txt This snippet demonstrates how to set up wallet connection for a dApp using Phantom Wallet Adapter within the Solana ecosystem. It requires @solana/wallet-adapter-base, @solana/wallet-adapter-react, and @solana/wallet-adapter-wallets. ```typescript import { WalletAdapterNetwork } from '@solana/wallet-adapter-base'; import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react'; import { PhantomWalletAdapter } from '@solana/wallet-adapter-wallets'; const wallets = [new PhantomWalletAdapter()]; const network = WalletAdapterNetwork.Mainnet; {/* Your dApp components */} ``` -------------------------------- ### Create Compressed NFT Collection with Bubblegum (TypeScript) Source: https://context7.com/stockpilelabs/awesome-solana-oss/llms.txt Illustrates the process of creating a compressed NFT (cNFT) collection using the Bubblegum library from Metaplex. It covers the creation of a merkle tree and then minting a cNFT within that collection, specifying metadata, owner, and creator details. It requires the `@metaplex-foundation/umi` and `@metaplex-foundation/mpl-bubblegum` packages. ```typescript import { createTree, mintV1 } from '@metaplex-foundation/mpl-bubblegum'; import { generateSigner } from '@metaplex-foundation/umi'; // Create merkle tree const merkleTree = generateSigner(umi); await createTree(umi, { merkleTree, maxDepth: 14, maxBufferSize: 64, }).sendAndConfirm(umi); // Mint compressed NFT await mintV1(umi, { leafOwner: owner.publicKey, merkleTree: merkleTree.publicKey, metadata: { name: 'My cNFT', uri: 'https://example.com/metadata.json', sellerFeeBasisPoints: 500, collection: { key: collectionMint, verified: false }, creators: [{ address: creator, verified: true, share: 100 }], }, }).sendAndConfirm(umi); ``` -------------------------------- ### Create Recurring Payment Stream with Trusts Protocol (TypeScript) Source: https://context7.com/stockpilelabs/awesome-solana-oss/llms.txt Demonstrates how to create a recurring payment stream using the Trusts Protocol. This involves specifying the recipient, amount, interval, duration, and the token mint. It utilizes the `@trusts/protocol` library. ```typescript import { TrustsProtocol } from '@trusts/protocol'; const trust = await TrustsProtocol.create({ recipient: recipientPublicKey, amount: 1000000, // lamports interval: 86400, // 1 day in seconds duration: 30, // 30 payments tokenMint: USDC_MINT, }); console.log(`Trust created: ${trust.address.toBase58()}`); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.