### Get Arweave Pricing Information with arloader Source: https://context7.com/calebeverett/arloader/llms.txt Demonstrates how to query the Arweave network for current pricing information using the arloader library. It covers fetching the price for a specific byte size, retrieving base and incremental price terms for bundling, and checking the count of pending transactions. This example uses the default Arweave node and tokio for asynchronous execution. ```rust use arloader::Arweave; #[tokio::main] async fn main() -> Result<(), arloader::error::Error> { let arweave = Arweave::default(); // Get price for specific byte size let bytes = 1024 * 1024; // 1 MB let (winstons, usd_per_ar, usd_per_sol) = arweave.get_price(&bytes).await?; println!("Price for 1 MB: {} winstons", winstons); println!("USD per AR: ${:.2}", usd_per_ar.to_f32_lossy() / 100.0); println!("USD per SOL: ${:.2}", usd_per_sol.to_f32_lossy() / 100.0); // Get base and incremental price terms let (base, incremental) = arweave.get_price_terms(1.0).await?; println!("Base price (256KB): {} winstons", base); println!("Incremental (per 256KB): {} winstons", incremental); // Get pending transaction count let pending = arweave.get_pending_count().await?; println!("Pending transactions: {}", pending); Ok(()) } ``` -------------------------------- ### Upload Files Programmatically with arloader Source: https://context7.com/calebeverett/arloader/llms.txt Demonstrates how to upload multiple files programmatically using the arloader library. It includes steps for initializing the Arweave client, defining files, getting price terms with a reward multiplier, chunking files into bundles, and finally uploading these bundles. Dependencies include tokio for async operations and standard library path manipulation. ```rust use arloader::{Arweave, commands::*}; use arloader::status::OutputFormat; use std::path::PathBuf; use url::Url; #[tokio::main] async fn main() -> Result<(), arloader::error::Error> { let arweave = Arweave::from_keypair_path( PathBuf::from("/path/to/ar-keypair.json"), Url::parse("https://arweave.net/").unwrap(), ).await?; // Define files to upload let paths_iter = (0..10).map(|i| PathBuf::from(format!("assets/{}.png", i))); // Get price terms with reward multiplier let reward_mult = 1.5; let price_terms = arweave.get_price_terms(reward_mult).await?; // Chunk files into bundles (100 MB default) let bundle_size = 100_000_000u64; let path_chunks = arweave.chunk_file_paths(paths_iter, bundle_size)?; // Upload bundles let log_dir = Some(PathBuf::from("./status/")); let output_format = OutputFormat::Display; command_upload_bundles( &arweave, path_chunks, log_dir, None, // optional tags reward_mult, &output_format, 5, // buffer size for concurrent requests ).await?; Ok(()) } ``` -------------------------------- ### Metaplex Items JSON Structure Source: https://github.com/calebeverett/arloader/blob/master/docs/upload_nfts_steps.md Example of the JSON structure generated by the write-metaplex-items command, used for configuring Candy Machine items. ```json { "0": { "link": "uri link", "name": "name", "onChain": false }, "1": { "link": "uri link", "name": "name", "onChain": false } } ``` -------------------------------- ### Get Transaction Status with Arloader Source: https://github.com/calebeverett/arloader/blob/master/README.md Retrieves the confirmation status of a specific Arweave transaction, such as a manifest transaction. This command is useful for monitoring the progress and confirmation of transactions on the Arweave network. ```bash arloader get-status ``` -------------------------------- ### Create Data Items for Bundles with arloader Source: https://context7.com/calebeverett/arloader/llms.txt Shows how to create data items suitable for bundling using the arloader library. This process involves specifying file paths and optional tags, then using the library to generate data items and subsequently a bundle in binary format along with its manifest. Dependencies include tokio and serde_json for pretty printing the manifest. ```rust use arloader::{Arweave, bundle::DataItem, transaction::{Tag, FromUtf8Strs}}; use std::path::PathBuf; use url::Url; #[tokio::main] async fn main() -> Result<(), arloader::error::Error> { let arweave = Arweave::from_keypair_path( PathBuf::from("/path/to/ar-keypair.json"), Url::parse("https://arweave.net/").unwrap(), ).await?; // Create data items from file paths let paths = vec![ PathBuf::from("assets/0.png"), PathBuf::from("assets/1.png"), PathBuf::from("assets/2.png"), ]; let tags: Vec> = vec![]; // Content-Type auto-detected let data_items = arweave.create_data_items_from_file_paths( paths, tags, ).await?; // Create bundle from data items let (bundle_binary, manifest) = arweave.create_bundle_from_data_items(data_items)?; println!("Bundle size: {} bytes", bundle_binary.len()); println!("Manifest: {}", serde_json::to_string_pretty(&manifest)?); Ok(()) } ``` -------------------------------- ### Create and Sign Arweave Transactions with arloader Source: https://context7.com/calebeverett/arloader/llms.txt Illustrates the low-level API for creating and signing Arweave transactions using the arloader library. This involves reading file data, defining custom tags, obtaining price terms, creating the transaction, signing it, and finally posting it to the Arweave network. It requires a keypair file and specifies the Arweave node URL. ```rust use arloader::{Arweave, transaction::{Base64, Tag, FromUtf8Strs}}; use std::path::PathBuf; use url::Url; #[tokio::main] async fn main() -> Result<(), arloader::error::Error> { let arweave = Arweave::from_keypair_path( PathBuf::from("/path/to/ar-keypair.json"), Url::parse("https://arweave.net/").unwrap(), ).await?; // Read file data let data = std::fs::read("path/to/file.png")?; // Create custom tags let tags = vec![ Tag::::from_utf8_strs("Content-Type", "image/png")?, Tag::::from_utf8_strs("App-Name", "MyApp")?, ]; // Get price terms let price_terms = arweave.get_price_terms(1.0).await?; // Create transaction let transaction = arweave.create_transaction( data, Some(tags), None, // last_tx (fetched automatically if None) price_terms, false, // auto_content_tag (we provided Content-Type manually) ).await?; // Sign transaction let signed_transaction = arweave.sign_transaction(transaction)?; // Post transaction let (id, reward) = arweave.post_transaction(&signed_transaction).await?; println!("Uploaded! Transaction ID: {}", id); println!("Reward: {} winstons", reward); Ok(()) } ``` -------------------------------- ### Initialize Arweave Client in Rust Source: https://context7.com/calebeverett/arloader/llms.txt Initializes an Arweave client in Rust using the `arloader` library. It demonstrates creating a client from a keypair file and using a default client, typically for SOL payments. ```rust use arloader::Arweave; use std::path::PathBuf; use url::Url; #[tokio::main] async fn main() -> Result<(), arloader::error::Error> { // Create Arweave client from keypair file let arweave = Arweave::from_keypair_path( PathBuf::from("/path/to/ar-keypair.json"), Url::parse("https://arweave.net/").unwrap(), ).await?; // Or use default client (for SOL payments with default keypair) let default_arweave = Arweave::default(); Ok(()) } ``` -------------------------------- ### Create Manifest File with Arloader Source: https://github.com/calebeverett/arloader/blob/master/README.md Generates a manifest file used by Arweave gateways to provide relative paths to uploaded files. This command consolidates paths from bundle status JSON files, uploads a consolidated manifest to Arweave, and saves a manifest file with the transaction ID to the specified log directory. Access to files is then provided via the manifest ID and relative file paths. ```bash arloader upload-manifest ``` -------------------------------- ### Upload Files with SOL using Arloader Source: https://github.com/calebeverett/arloader/blob/master/README.md Uploads files to Arweave, utilizing SOL for transaction fees. This process involves creating bundles, obtaining transaction signatures via an API after SOL payment confirmation, and then directly uploading the signed transaction to the arweave.net gateway. ```bash arloader upload --with sol --ar-default-keypair ``` -------------------------------- ### Upload Assets and Manifests Source: https://github.com/calebeverett/arloader/blob/master/docs/upload_nfts_steps.md Uploads local JSON metadata files to Arweave and creates a manifest for the uploaded files. The manifest upload supports a reward multiplier for transaction processing. ```shell arloader upload *.json arloader upload-manifest arloader_ --reward-multiplier 2 ``` -------------------------------- ### Generate Metaplex Items Configuration Source: https://github.com/calebeverett/arloader/blob/master/docs/upload_nfts_steps.md Creates a JSON file containing links formatted for the Metaplex Candy Machine configuration. Requires file paths to metadata and the corresponding manifest path. ```shell arloader write-metaplex-items --manifest-path --link-file ``` -------------------------------- ### Upload GLB Files with Arloader Source: https://github.com/calebeverett/arloader/blob/master/docs/multiple_asset_files.md Uploads all .glb files in the current directory to Arweave. This command requires Solana keypair path, enables Solana integration, uses the default Arweave keypair, and sets a bundle size and reward multiplier. ```bash arloader upload *.glb --sol-keypair-path ~/.config/solana/wallet.json --with-sol --ar-default-keypair --bundle-size 100 --reward-multiplier 2 ``` -------------------------------- ### Estimate Upload Cost with SOL using Arloader Source: https://github.com/calebeverett/arloader/blob/master/README.md Estimates the cost of uploading files to Arweave using SOL for transaction fees. This command allows users to gauge the expense before committing to an upload, providing transparency in transaction costs when using SOL. ```bash arloader estimate --with-sol ``` -------------------------------- ### Upload Manifest with Arloader Source: https://github.com/calebeverett/arloader/blob/master/docs/multiple_asset_files.md Uploads a manifest file generated by Arloader, linking previously uploaded assets. This command requires a manifest ID, Solana keypair path, enables Solana integration, uses the default Arweave keypair, and sets a reward multiplier. ```bash arloader upload-manifest arloader_EsBWe5NTZ8E --sol-keypair-path ~/.config/solana/wallet.json --with-sol --ar-default-keypair --reward-multiplier 2 ``` ```bash arloader upload-manifest arloader_l00ydMAOy7E --sol-keypair-path ~/.config/solana/wallet.json --with-sol --ar-default-keypair --reward-multiplier 2 ``` ```bash arloader upload-manifest arloader_XPlkYp5zadw --sol-keypair-path ~/.config/solana/wallet.json --with-sol --ar-default-keypair --reward-multiplier 2 ``` -------------------------------- ### Upload PNG Files with Arloader Source: https://github.com/calebeverett/arloader/blob/master/docs/multiple_asset_files.md Uploads all .png files in the current directory to Arweave. This command requires Solana keypair path, enables Solana integration, uses the default Arweave keypair, and sets a reward multiplier. ```bash arloader upload *.png --sol-keypair-path ~/.config/solana/wallet.json --with-sol --ar-default-keypair --reward-multiplier 2 ``` -------------------------------- ### Upload Arweave Manifest File Source: https://context7.com/calebeverett/arloader/llms.txt Creates and uploads a manifest file to Arweave, enabling access to files by name relative to the manifest ID. Supports options for specifying log directories, Arweave keypair paths, reward multipliers, and SOL payments. ```bash # Upload manifest for bundled files arloader upload-manifest path/to/arloader_/ \ --ar-keypair-path /path/to/ar-keypair.json # Upload manifest with increased reward for faster confirmation arloader upload-manifest path/to/arloader_/ \ --ar-keypair-path /path/to/ar-keypair.json \ --reward-multiplier 2.0 # Upload manifest paying with SOL arloader upload-manifest path/to/arloader_/ \ --with-sol \ --sol-keypair-path /path/to/sol-keypair.json \ --ar-default-keypair ``` -------------------------------- ### Update Metadata Files Source: https://github.com/calebeverett/arloader/blob/master/docs/upload_nfts_steps.md Updates metadata JSON files with links from a manifest file. Supports flags for updating image keys and animation URLs, and toggling between ID-based and file-path-based links. ```shell arloader update-metadata --manifest-path --update-image --update-animation-url --link-file ``` -------------------------------- ### Upload JSON Metadata Files with Arloader Source: https://github.com/calebeverett/arloader/blob/master/docs/multiple_asset_files.md Uploads all .json metadata files in the current directory to Arweave. This command requires Solana keypair path, enables Solana integration, uses the default Arweave keypair, and sets a reward multiplier. ```bash arloader upload *.json --sol-keypair-path ~/.config/solana/wallet.json --with-sol --ar-default-keypair --reward-multiplier 2 ``` -------------------------------- ### Verify Arloader Transaction Status Source: https://github.com/calebeverett/arloader/blob/master/docs/upload_nfts_steps.md Commands to check the confirmation status of uploaded assets or manifests. It is recommended to wait for at least 25 confirmations before proceeding with NFT creation. ```shell arloader update-status arloader_ arloader get-status ``` -------------------------------- ### Write Metaplex Items JSON for Candy Machine Source: https://context7.com/calebeverett/arloader/llms.txt Generates a JSON file formatted for Metaplex Candy Machine from uploaded metadata and manifest information. Supports using file-path based links for asset references. ```bash # Write metaplex items from uploaded metadata arloader write-metaplex-items path/to/my/metadata/*.json \ --manifest-path path/to/metadata/manifest_.json # Use file-path based links arloader write-metaplex-items path/to/my/metadata/*.json \ --manifest-path path/to/metadata/manifest_.json \ --link-file ``` -------------------------------- ### View Metadata Manifest Structure Source: https://github.com/calebeverett/arloader/blob/master/README.md Displays the JSON structure of the generated metadata manifest, which maps local files to their corresponding Arweave URIs. This file is automatically created in the arloader directory after the upload process. ```json { "0.json": { "id": "ScU9mEuKBbPX5o5nv8DZkDnZuJbzf84lyLk-uLVDqNk", "files": [ { "uri": "https://arweave.net/ScU9mEuKBbPX5o5nv8DZkDnZuJbzf84lyLk-uLVDqNk", "type": "application/json" }, { "uri": "https://arweave.net/fo9P3OOq78REajk48vFWbKfIhw6mDzgjANQIh3L7Njs/0.json", "type": "application/json" } ] }, "1.json": { "id": "8APeQ5lW0-csTcBaGdPBDLAL2ci2AT9pTn2tppGPU_8", "files": [ { "uri": "https://arweave.net/8APeQ5lW0-csTcBaGdPBDLAL2ci2AT9pTn2tppGPU_8", "type": "application/json" }, { "uri": "https://arweave.net/fo9P3OOq78REajk48vFWbKfIhw6mDzgjANQIh3L7Njs/1.json", "type": "application/json" } ] } } ``` -------------------------------- ### Update NFT Metadata with Arweave Asset Links Source: https://context7.com/calebeverett/arloader/llms.txt Updates metadata JSON files with links to assets uploaded to Arweave via a manifest. It can update specific keys like 'image' or 'animation_url' and supports using file-path based links instead of ID-based links. ```bash # Update metadata files with asset links (updates image key) arloader update-metadata path/to/my/assets/*.png \ --manifest-path path/to/manifest_.json \ --update-image # Update animation_url key for video/animation assets arloader update-metadata path/to/my/assets/*.mp4 \ --manifest-path path/to/manifest_.json \ --update-animation-url # Use file-path based links instead of ID-based links arloader update-metadata path/to/my/assets/*.png \ --manifest-path path/to/manifest_.json \ --update-image \ --link-file ``` -------------------------------- ### Check Arweave Wallet Balance and Upload Capacity Source: https://context7.com/calebeverett/arloader/llms.txt Checks the balance of an Arweave wallet in Winstons and estimates the amount of data that can be uploaded based on current AR prices. It can check a specific keypair file or a wallet address. ```bash # Check balance of keypair wallet arloader balance --ar-keypair-path /path/to/ar-keypair.json # Check balance of a specific wallet address arloader balance ``` -------------------------------- ### Write Metaplex Items with Arloader Source: https://github.com/calebeverett/arloader/blob/master/docs/multiple_asset_files.md Writes Metaplex-compatible items to JSON metadata files, linking them to the uploaded manifest. This command requires the path to the manifest JSON file. ```bash arloader write-metaplex-items *.json --manifest-path arloader_XPlkYp5zadw/manifest_lHEHx4S-m21EVHXkLYJZjyGqwAXk4Xmn1HR5Mjk55zd.json ``` -------------------------------- ### Update Metadata with Animation URL using Arloader Source: https://github.com/calebeverett/arloader/blob/master/docs/multiple_asset_files.md Updates the metadata for .glb files to include an animation URL, linking to the uploaded manifest. This command requires the path to the manifest JSON file. ```bash arloader update-metadata *.glb --manifest-path arloader_EsBWe5NTZ8E/manifest_2LpuzxUYEmKl5huvPChgoZ3YcAKNnpUoh-Jyq1EoB-9.json --update-animation-url ``` -------------------------------- ### Arweave Transaction Submission Without Bundles Source: https://github.com/calebeverett/arloader/blob/master/README.md The `--no-bundle` flag can be used with `estimate` and `upload` commands to create individual Arweave transactions instead of bundled ones. This generates separate status objects in the log directory, which can then be updated and reported on. ```bash arloader estimate --no-bundle ``` ```bash arloader upload --no-bundle ``` ```bash arloader update-status ``` ```bash arloader status-report ``` -------------------------------- ### List Arweave Transaction Statuses by Confirmation Count Source: https://context7.com/calebeverett/arloader/llms.txt Lists Arweave transaction statuses, filtered by a specified maximum number of confirmations. This is useful for identifying transactions that require further confirmation or have reached a desired confirmation level. ```bash arloader list-status path/to/status/ --max-confirms 25 ``` -------------------------------- ### Update Metadata with Image URL using Arloader Source: https://github.com/calebeverett/arloader/blob/master/docs/multiple_asset_files.md Updates the metadata for .png files to include an image URL, linking to the uploaded manifest. This command requires the path to the manifest JSON file. ```bash arloader update-metadata *.png --manifest-path arloader_l00ydMAOy7E/manifest_rJiNPRYtu-tsMYP5wyDU4L-4Qu8HFaL2QMHn7Oq1BGn.json --update-image ``` -------------------------------- ### Verify Transaction Status Source: https://github.com/calebeverett/arloader/blob/master/README.md Command to check the confirmation status of Arweave transactions. It is recommended to ensure at least 25 confirmations before proceeding with token creation. ```bash arloader update-nft-status ``` -------------------------------- ### Check Pending Arweave Transactions Source: https://github.com/calebeverett/arloader/blob/master/README.md This command allows you to monitor the current number of pending transactions on the Arweave network. It prints the count every second for one minute, helping you assess network congestion. ```bash arloader pending ``` -------------------------------- ### Adjust Arweave Transaction Reward Multiplier Source: https://github.com/calebeverett/arloader/blob/master/README.md Use the `--reward-multiplier` flag with `estimate` or `upload` commands to increase the reward for your Arweave transactions. This is useful when network congestion is high, ensuring your transaction is processed faster. The multiplier can be a float between 0.0 and 3.0. ```bash arloader estimate --reward-multiplier 1.5 ``` ```bash arloader upload --reward-multiplier 2.0 ``` -------------------------------- ### Re-upload Transactions with Arloader Source: https://github.com/calebeverett/arloader/blob/master/README.md Re-uploads Arweave transactions that may not have confirmed or have a low confirmation count. It checks file statuses against a log directory and filters based on specified statuses and maximum confirmations. This command is useful for ensuring all uploaded data is properly confirmed on the Arweave network. ```bash arloader reupload --log-dir --statuses --max-confirmations ``` ```bash arloader reupload my/images/*.jpeg --log-dir my/images/arloader_hehQJu-RJpo --statuses NotFound Pending ``` ```bash arloader reupload my/images/*.jpeg --log-dir my/images/arloader_hehQJu-RJpo --max-confirms 25 ``` -------------------------------- ### View Metaplex Candy Machine Item Mapping Source: https://github.com/calebeverett/arloader/blob/master/README.md Shows the JSON format for Metaplex Candy Machine items generated by Arloader. This mapping links local item indices to their on-chain metadata status. ```json { "0": { "link": "uri link", "name": "name", "onChain": false }, "1": { "link": "uri link", "name": "name", "onChain": false } } ``` -------------------------------- ### Monitor Arweave Pending Transactions Source: https://context7.com/calebeverett/arloader/llms.txt Displays the count of pending transactions on the Arweave network, updating periodically. This helps in monitoring network congestion and optimizing upload timing. ```bash # Display pending transaction count for 60 seconds arloader pending ``` -------------------------------- ### Re-upload Failed or Under-Confirmed Arweave Transactions Source: https://context7.com/calebeverett/arloader/llms.txt Re-uploads Arweave transactions that have failed or have insufficient confirmations. It supports filtering by status (e.g., NotFound, Pending) and minimum confirmation count, with options to specify log directories and Arweave keypair paths. ```bash # Re-upload transactions with NotFound status arloader reupload path/to/my/files/*.png \ --log-dir path/to/arloader_/ \ --statuses NotFound \ --ar-keypair-path /path/to/ar-keypair.json # Re-upload transactions with fewer than 25 confirmations arloader reupload path/to/my/files/*.png \ --log-dir path/to/arloader_/ \ --max-confirms 25 \ --ar-keypair-path /path/to/ar-keypair.json # Re-upload with increased reward arloader reupload path/to/my/files/*.png \ --log-dir path/to/arloader_/ \ --statuses NotFound Pending \ --reward-multiplier 2.0 \ --ar-keypair-path /path/to/ar-keypair.json ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.