3.0.3 • Published 2 months ago

solana-bulk-transfer v3.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

Solana Batch Transfer Script Updates

Update Overview

This document provides a summary of two optimization updates made to the Solana batch transfer script.

Update

  • Error Handling: Added more detailed error handling to provide more information when transactions fail.
  • Logging: Implemented logging functionality to track the transaction process and outcomes.
  • Configuration File: Introduced a configuration file to manage private keys and transfer targets, enhancing security and flexibility.
  • Transaction Confirmation: Added checks for transaction confirmation status to ensure successful submission to the blockchain.

  • Configuration Validation: Ensured all necessary information in the configuration file is complete and valid.

  • Enhanced Security: Avoided direct use of private keys in the code, instead introducing them through environment variables or external secure storage.
  • Transaction Building Optimization: Implemented logic to create multiple transactions in batches for a large number of transfers to avoid transactions being too large.
  • Transaction Status Monitoring: Added monitoring of transaction status after sending until final confirmation.

Update

Balance Check Before Transactions

  • Implemented a balance check to ensure the sender's account has sufficient funds to cover the total transfer amounts and transaction fees.

Real-Time Transaction Feedback

  • Added real-time feedback on the status of transactions, providing updates until each transaction is confirmed or fails.

Retry Mechanism

  • Introduced an automatic retry mechanism for transactions that fail due to network issues or other non-permanent errors.

Memory Usage Optimization

  • Optimized memory usage for handling large numbers of transfers, particularly during transaction construction.

Dynamic Configuration File Loading

  • Allowed users to specify the configuration file path via command-line arguments, rather than hardcoding it within the script.

Concurrent Batch Processing

  • Utilized Promise.all to process multiple transfers in parallel, improving efficiency.

Summary Report

  • Provided a summary report after all transfers are completed, detailing the number of successful and failed transfers.

Security Enhancements

  • Encouraged the use of environment variables for sensitive information such as private keys, avoiding direct storage in the codebase.

Usage

To use the updated script:

  1. Install the necessary dependencies.
  2. Set up the .env file with the PRIVATE_KEY variable.
  3. Adjust the config.json file with the desired transfer targets.
  4. Run the script with the optional command-line argument for the config file path.

Security Tips

  • Do not store private keys directly in the code repository.
  • Use environment variables or a secure key management system to handle private keys.
  • Ensure the .env file is not committed to the version control system.

How to Use

  1. Install necessary dependencies, such as @solana/web3.js and dotenv.
  2. Create a .env file and set the PRIVATE_KEY environment variable.
  3. Adjust the transfer targets in the config.json file as needed.
  4. Run the script to perform batch transfers.

Support

Thank you for using our Solana batch transfer script!