Infinite loop version (MEDIUM)

Having a node is requiered, read our guides : VPS

In this guide, we will walk through the process of setting up a script for quick minting DRC-20 tokens. This script will automate the process of minting, making it more efficient and user-friendly.

Splitting UTXO is requiered for the script below:

Splitting UTXOs allows you to process multiple transactions concurrently, enhancing the efficiency of the minting process.

To split your UTXOs, use the command:

node . wallet split <count>

Replace <count> with the number of splits you want to make. We recommend splitting into 50 UTXOs for optimal results.

You'll need to install bc dependencies for the calculations / colors features:

sudo apt-get update
sudo apt-get install bc

The script won't work properly if bc isn't installed.

Below is a shell script that you can use for this purpose:

Simply launch the command:

nano YOUR_BULK_FILENAME.sh

And copy the following script:

#!/bin/bash

#check that 3 arguments are passed in otherwise exit
if [ "$#" -ne 3 ]; then
    echo "Illegal number of parameters"
    echo "Usage: <YOUR_BULK_FILENAME.sh> 0 <YOUR WALLET> <TICKER>"
    exit 1
fi

count=0
max_count=4
total_transactions=0
total_cost_doge=0
total_cost_usd=0
target_address=$2
token_name=$3
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
while true; do
    while [ $count -lt $max_count ]; do
        echo "Current count: $count"
        node . drc-20 mint "$target_address" "$token_name" <AMOUNT> 12
        remaining=$((max_count - count))
        echo "Counts left: $remaining"
        sleep 5  # Sleep for 5 seconds
        ((count++))
        ((total_transactions+=12))  # Add 12 to the total transactions count
        total_cost_doge=$(echo "$total_transactions * 0.031" | bc)
        total_cost_usd=$(echo "$total_transactions * 0.07 * 0.031" | bc)
    done
    echo -e "${GREEN}Total transactions sent: $total_transactions${NC}"
    printf "${RED}Total cost in DOGE: %.2f${NC}\n" $total_cost_doge
    printf "${RED}Total cost in USD: %.2f${NC}\n" $total_cost_usd
    rm pending-txs.json
    sleep 5
    node . wallet sync
    sleep 5    
    node . wallet sync
    sleep 600
    count=0
done

You'll need to replace : <YOUR_BULK_FILENAME.sh> : With the name of your .bash file, e.g : bulk-fiwb.sh <YOUR WALLET> : With the wallet that will receive the inscriptions <TICKER> : With the token you want to mint, e.g : fiwb <AMOUNT> : With the max limit amount per mint of this ficker, e.g : 50 (for fiwb)

Don't forget to run the following command once your .sh file is created!

chmod +x YOUR_BULK_FILENAME.sh

To start the bulk, just launch the following command :

/YOUR_BULK_FILENAME.sh 1000 <WALLET> <TICKER>

You can now go to sleep, the node will handle the rest ! 👏

Understanding the Script

The Basics

The script uses a while loop to automate the minting process. Inside the loop, a series of commands are executed, and after each cycle, the script sleeps for a certain amount of time before the next cycle begins.

Parameters

At the beginning of the script, we check to ensure that three arguments are passed when you call the script. If not, an error message is displayed, and the script exits. These arguments are:

  1. A zero (0) - This is a placeholder for future use.

  2. Your wallet address - This is where the minted tokens will be sent.

  3. The token name - The token you are minting.

Variables

Several variables are used to manage the minting process, track the total transactions, and calculate the total cost in DOGE and USD. These are count, max_count, total_transactions, total_cost_doge, and total_cost_usd.

Looping and Minting

In the main loop of the script, the node . drc-20 mint "$target_address" "$token_name" 50 12 command is run to mint the tokens. The count variable tracks the number of times this command has run, and remaining calculates how many more times it will run before reaching max_count.

Updating and Syncing

After reaching max_count, the script removes the pending-txs.json file and syncs the wallet by running node . wallet sync. The script then sleeps for 600 seconds (10 minutes) before starting the next cycle.

This script won't stop until you decide to shut down the process by yourself.

Colors

Colors are used to make the output more readable. Transactions sent are displayed in green, while the total cost in DOGE and USD is shown in red.

Note: To use this script, you need to install Git Bash for Windows. For VPS, you just need to use a terminal.

Enjoy your quick minting journey!