# Infinite loop version (EASY)

{% hint style="info" %} <mark style="color:blue;">**Having a node is requiered, read our guides :**</mark> \
[<mark style="color:blue;">VPS</mark> ](/eng/expert-guides/how-to-mint-vps/inscription-wallet-on-a-vps.md)<mark style="color:blue;">or</mark> [<mark style="color:blue;">WINDOWS</mark>](/eng/expert-guides/how-to-mint-vps/inscription-wallet-on-windows.md)
{% endhint %}

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.

{% hint style="success" %} <mark style="color:green;">**Splitting UTXO is requiered for the script below:**</mark><br>

<mark style="color:green;">Splitting UTXOs allows you to process multiple transactions concurrently, enhancing the efficiency of the minting process.</mark>

<mark style="color:green;">To split your UTXOs, use the command:</mark>

```bash
node . wallet split <count>
```

<mark style="color:green;">Replace</mark> <mark style="color:green;"></mark><mark style="color:green;">`<count>`</mark> <mark style="color:green;"></mark><mark style="color:green;">with the number of splits you want to make.</mark> \ <mark style="color:green;">**We recommend splitting into 50 UTXOs for optimal results.**</mark>
{% endhint %}

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

{% hint style="info" %} <mark style="color:blue;">**If using a VPS:**</mark> \ <mark style="color:blue;">To create the NAME\_OF\_YOUR\_BASH\_FILE</mark><mark style="color:blue;">`.sh`</mark><mark style="color:blue;">, you can run the following command:</mark> \ <mark style="color:blue;">`nano`</mark> <mark style="color:blue;"></mark><mark style="color:blue;">NAME\_OF\_YOUR\_BASH\_FILE</mark><mark style="color:blue;">`.sh`</mark>\
\ <mark style="color:blue;">**If using WINDOWS:**</mark> \ <mark style="color:blue;">Simply create the NAME\_OF\_YOUR\_BASH\_FILE</mark><mark style="color:blue;">`.sh`</mark> <mark style="color:blue;"></mark><mark style="color:blue;">with any text editor.</mark>
{% endhint %}

And copy the following script:&#x20;

```bash
#!/bin/bash

# Check that 3 arguments are passed; otherwise, exit the script
if [ "$#" -ne 3 ]; then
    echo "Illegal number of parameters"
    echo "Usage: NAME_OF_YOUR_BASH_FILE.sh 0 YOUR_WALLET TICKER"
    exit 1
fi

count=0
max_count=4
target_address=$2
token_name=$3

while true; do
    while [ $count -lt $max_count ]; do
        echo "Current count: $count"
        # Replace 50 by the limit amount of your desired token, below 50 is for FIWB TICKER
        node . drc-20 mint "$target_address" "$token_name" 50 12
        remaining=$((max_count - count))
        echo "Counts left: $remaining"
        sleep 5  # Sleep for 5 seconds
        ((count++))
    done
    rm pending-txs.json
    sleep 5
    node . wallet sync
    sleep 5    
    node . wallet sync
    sleep 600
    count=0
done
```

{% hint style="danger" %} <mark style="color:red;">**You'll need to replace :**</mark> \ <mark style="color:red;">\<NAME\_OF\_YOUR\_BASH\_FILE.sh> : With the name of your .bash file, e.g : bulk-fiwb.sh</mark>\ <mark style="color:red;">\<YOUR WALLET> : With the wallet that will receive the inscriptions</mark>\ <mark style="color:red;">\<TICKER> : With the token you want to mint, e.g : fiwb</mark>\ <mark style="color:red;">\<AMOUNT> : With the max limit amount per mint of this ficker, e.g : 50 (for fiwb)</mark>
{% endhint %}

### Launch the bash files on your node :

#### VPS :

1. Allow the VPS to launch the bash files with the following command :

```sh
chmod +x NAME_OF_YOUR_BASH_FILE.sh
```

2. Start the script :&#x20;

```sh
/NAME_OF_YOUR_BASH_FILE.sh 1000 <WALLET> <TICKER>
```

#### Windows :

1. Start the script:

```sh
 bash NAME_OF_YOUR_BASH_FILE.sh 1000 <WALLET> <TICKER>
```

{% hint style="info" %} <mark style="color:blue;">We assume that you have placed the</mark> <mark style="color:blue;"></mark><mark style="color:blue;">`NAME_OF_YOUR_BASH_FILE.sh`</mark> <mark style="color:blue;"></mark><mark style="color:blue;">file at the root of the</mark> <mark style="color:blue;"></mark><mark style="color:blue;">`inscription-wallet`</mark> <mark style="color:blue;"></mark><mark style="color:blue;">folder.</mark>
{% endhint %}

### 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.

#### 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.

{% hint style="warning" %} <mark style="color:orange;">**This script won't stop until you decide to shut down the process by yourself.**</mark>
{% endhint %}

**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!**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.doginals.academy/eng/expert-guides/how-to-quick-mint-infinity/infinite-loop-version-easy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
