# ENG

## ⚙️ Installation

Requirement&#x73;**:**

* Python version 3.11.6

Downloadin&#x67;**:**

1 | Clone a repository

```
git clone https://github.com/0xStarLabs/StarLabs-MegaETH.git
```

```
cd StarLabs-MegaETH
```

2 | Create a virtual environment

```
python -m venv venv
```

```
venv\Scripts\activate
```

3 | Install dependencies

```
pip install -r requirements.txt
```

4 | Start (after customization)

```
python main.py
```

## 📁 Preparation (data folder) <a href="#podgotovka-papka-data" id="podgotovka-papka-data"></a>

Here you can find all user's data necessary for work.\
\
`private_keys.txt` - private keys from wallets. <mark style="color:yellow;">1 line = 1 key.</mark>\
`proxies.txt` - proxies. 1 line = 1 proxy, or if there are less proxies than accounts, then they will be repeated one after another to be enough for all accounts. The format of proxies is <mark style="color:yellow;">user:pass\@ip:port</mark>. <mark style="color:yellow;">ONLY HTTP proxies are supported.</mark>

## 📝 Config.yaml <a href="#config.yaml" id="config.yaml"></a>

В этой секции будет написано детально про каждую функцию в файле `config.yaml`.

{% code overflow="wrap" %}

```javascript
SETTINGS

THREADS: 1 - number of threads/simultaneous accounts the bot will do.

ATTEMPTS: 5 - in case of errors, how many times the bot will try to perform the action.

ACCOUNTS_RANGE: [0, 0] - the range of accounts to run. 
Example: [3, 6] means the bot will execute accounts starting from the third to the sixth.

EXACT_ACCOUNTS_TO_USE: [] - !Works only if ACCOUNTS_RANGE: [0, 0].
Example: [1, 3, 7] which means the bot will only execute accounts 1 3 and 7.

SHUFFLE_WALLETS: false - shuffle accounts before each run or not.
If true, the bot will execute the accounts in random order each time.

PAUSE_BETWEEN_ATTEMPTS: [0, 0] - pause in seconds between attempts to perform a single action.
Example: [3, 10] - the pause will be 3 to 10 seconds random.

PAUSE_BETWEEN_SWAPS: [0, 0] - pause in seconds between sending transactions.
Example: [3, 10] - the pause will be 3 to 10 seconds random.

RANDOM_PAUSE_BETWEEN_ACCOUNTS: [0, 0] - pause in seconds between accounts.
Example: [3, 10] - the pause will be 3 to 10 seconds random.

RANDOM_PAUSE_BETWEEN_ACTIONS: [0, 0] - pause in seconds between tasks/tasks.
Example: [3, 10] - the pause will be from 3 to 10 seconds random.

RANDOM_INITIALIZATION_PAUSE: [0, 0] - pause in seconds before each account starts.
For example, you have 10 threads, and the pause is [5, 60]
So each account will count from 5 seconds to a minute before starting.
This is used so that all accounts do not start at the same time.

SEND_TELEGRAM_LOGS: false - whether to send logs about functions to Telegram or not. true/false.

TELEGRAM_BOT_TOKEN: “12317283:lskjalsdfasdfasd-sdfadfasd” - token of the Telegram bot created in @BotFather.

TELEGRAM_USERS_IDS: [235123432] - names of telegram users to send logs to.
ATTENTION! The bot sends only to users in the ls, not in chats.
You can get your account id in the tag bot @GetChatID_IL_BOT.

WAIT_FOR_TRANSACTION_CONFIRMATION_IN_SECONDS: 120 - how many seconds to wait for transaction execution.
```

{% endcode %}

{% code overflow="wrap" %}

```javascript
FLOW

SKIP_FAILED_TASKS: false - skip uncompleted tasks or not.
If false, then the bot will stop working if it failed to complete some task.
If true, then the bot will skip the task and start doing the next one.
```

{% endcode %}

{% code overflow="wrap" %}

```javascript
FAUCET

SOLVIUM_API_KEY: xxxxxxxxxxxxxx - Solvium solver captcha key.

URL: https://t.me/solvium_crypto_bot. 
```

{% endcode %}

{% code overflow="wrap" fullWidth="false" %}

```javascript
RPCS

MEGAETH: [“https://carrot.megaeth.com/rpc”] - RPC for the network.
You can specify more than one, the bot will use the one that works.
```

{% endcode %}

{% code overflow="wrap" %}

```javascript
OTHERS

SKIP_SSL_VERIFICATION: true - skip ssl verification.
If you see errors related to SSL in the console, try to set false.

USE_PROXY_FOR_RPC: true - whether to use proxy for RPC.
```

{% endcode %}

{% code overflow="wrap" %}

```javascript
SWAPS

>>> BEBOP
BALANCE_PERCENTAGE_TO_SWAP: [5, 10] - how much percent of the balance to exchange.
SWAP_ALL_TO_ETH: false - if true, then the bot will exchange all tokens in ETH.

>>> GTE
BALANCE_PERCENTAGE_TO_SWAP: [5, 10] - сколько процентов от баланса обменивать.
SWAP_ALL_TO_ETH: true - если стоит true, тогда бот будет обменивать все токены в ETH.
SWAPS_AMOUNT: [3, 5] - количество свапов на каждый запуск бота.
```

{% endcode %}

{% code overflow="wrap" %}

```javascript
STAKINGS

>>> EKO_FINANCE:
CHANCE_FOR_MINT_TOKENS: 0 - with what chance to mines test tokens.
If it is 100, the bot will mines 4 tokens every run.
If it is 0, the bot will not mines tokens at all.
It is optimal to set 50 for a random chance.

BALANCE_PERCENTAGE_TO_STAKE: [5, 10] - what balance of tokens to deposit into steaking.
Test tokens are used for staking, not ETH.

UNSTAKE: true - whether to withdraw from steaking. 
If true, the bot will withdraw all the money from the steaking. 
```

{% endcode %}

{% code overflow="wrap" %}

```javascript
MINTS

>>> XL_MEME:

The bot can only buy tokens, it can't sell them.

BALANCE_PERCENTAGE_TO_BUY: [10, 20] - percentage of ETH balance to buy tokens with.

CONTRACTS_TO_BUY: [] - list of token contracts to buy.
If the list is empty, the bot itself will get random contracts and buy tokens.
```

{% endcode %}

The config can be customized either through a text document in the <mark style="color:yellow;">config.yaml</mark> file or through the web interface (example in the screenshot below).

In case the web config from the menu doesn't work for some reason, you can always edit it manually in the <mark style="color:yellow;">config.yaml</mark> file. You can also contact us in chat <mark style="color:yellow;"><https://t.me/StarLabsChat></mark> for help.

To start the web interface you need to run the bot with the command python main.py and select the menu item `[2] Edit config.`\
After that the bot will launch the config at URL <mark style="color:yellow;"><http://127.0.0.1:3456></mark>, which you can open in any browser on your PC and customize the config from there. By default, the bot itself opens a web browser with the desired URL.\
\&#xNAN;*<mark style="color:red;">This config and website is launched and runs locally on your PC.</mark>*\
\
After configuring the functions in the config, click the *<mark style="color:yellow;">Save Configuration</mark>* button in the top right corner of the page.

To exit the config, go back to the console and press <mark style="color:yellow;">CTRL + C</mark> several times, or just close the console.

<figure><img src="https://1229326975-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJi1Dnz98r18DXDpXAYS4%2Fuploads%2F6xyDbjcNqDQo16qyvi25%2Fimage.png?alt=media&#x26;token=859df9dd-987f-4262-aea2-dec348460a5b" alt=""><figcaption></figcaption></figure>

## 💾 Database <a href="#usage" id="usage"></a>

All work in the bot is managed directly through the database. The database is created and stored in the <mark style="color:yellow;">/data</mark> folder under the name <mark style="color:yellow;">accounts.db</mark>. You can open it manually through special programs for SQL like *DB Browser for SQLite*.

\
To start working and create a database you need to run the bot with the command `python main.py` and select the menu item <mark style="color:yellow;">\[3] 💾 Database actions</mark>. Next I will describe each of the functions.\\

\[1] 🗑 **Create/Reset Database**. The most basic function that creates a new database or overwrites an existing one. It should be used when you start the bot for the first time, or when you want to overwrite wallets, proxies, or tasks for wallets.\
\
\[2] ➕ **Generate New Tasks for Completed Wallets**. Used to generate new tasks for wallets that have completed their previous tasks. Example: it may be that some of your wallets have completed all the actions, but some of them still have unfinished tasks. In order not to overwrite ALL tasks and give part of the wallets a chance to finish their chain, you can select this feature and it will update tasks only for wallets that don't already have tasks.\
\
\[3] 📊 **Show Database Contents**. Displays the contents of the database. Wallets, proxies, tasks, etc.\
\
\[4] 🔄 **Regenerate Tasks for All Wallets**. Regenerates tasks for ALL wallets in the database.

\[5] 📝 **Add Wallets to Database**. Adds new wallets to the database. For example, you have 10 wallets in your database, you insert new wallets in <mark style="color:yellow;">data/private\_keys.txt</mark> and want to add them to the database. To avoid overwriting the entire database, you can use this function and it will simply add the new wallets to the database.

## ▶️ Usage <a href="#usage" id="usage"></a>

Before launching the bot, you need to open the <mark style="color:yellow;">tasks.py</mark> file in the main project folder and there customize the order of actions as shown in the example.

After that you can run the bot with the command `python main.py`\
\
In the menu you should select 3 and then the database settings will be opened. For the first run press `1 (Create/Reset Database)` and the bot creates a database in the data folder. ***For each key will be generated routes of actions.***\
Also in this menu you will be able to look at the remaining tasks, recreate the database, etc.

**Now you can exit the menu with button 6 and start the bot - 1.**

## ✅ Tasks

Instructions on how to switch modules in the bot\\

\
In order to switch a module, you need to find a file called tasks.py in the bot folder, open it with a code editor or a normal notepad, in the file you will see the TASKS variable that looks like this:

<figure><img src="https://1229326975-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJi1Dnz98r18DXDpXAYS4%2Fuploads%2F5CFp9Orysxca01SS5LqS%2Fimage.png?alt=media&#x26;token=fdf6e5aa-cf91-4c71-b207-b3faacb38f13" alt=""><figcaption></figcaption></figure>

<mark style="color:yellow;">**TASKS This is a list of presets, a preset is a list of modules that the bot will run.**</mark>\\

\
An example of a preset with a module inside it:

<figure><img src="https://1229326975-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJi1Dnz98r18DXDpXAYS4%2Fuploads%2FQwSLzH44kOcmO8FITK8F%2Fimage.png?alt=media&#x26;token=01cd8d00-fb6b-42f1-9116-7f1b4d147ac8" alt=""><figcaption></figcaption></figure>

As you can see FAUCET is just the name of the preset, which can be anything you want, and inside it is the “faucet” module, which is responsible for starting the faucet.\\

\
You can create your own preset just by writing any name for example:

<figure><img src="https://1229326975-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJi1Dnz98r18DXDpXAYS4%2Fuploads%2FMQt9PJqndGwQ6EoTu15J%2Fimage.png?alt=media&#x26;token=e01285dd-8776-41c2-abc5-b16a4031535f" alt=""><figcaption></figcaption></figure>

Inside it you can add which modules you want to use example dusted, total:

<figure><img src="https://1229326975-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJi1Dnz98r18DXDpXAYS4%2Fuploads%2Fr4BCDAgMHcPpR2baa3Xj%2Fimage.png?alt=media&#x26;token=ac0ced1a-1bd9-45b7-b548-48de194726f3" alt=""><figcaption></figcaption></figure>

Then to run a given preset, you copy its name and paste it into TASKS, total:

<figure><img src="https://1229326975-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJi1Dnz98r18DXDpXAYS4%2Fuploads%2FDV6Dr1pC7EQzQa8qz8AC%2Fimage.png?alt=media&#x26;token=851bce3f-1e4f-4148-b6a9-a7fd1f2c360f" alt=""><figcaption></figcaption></figure>

You can use different types of randomization in the preset. For example, square brackets will mean that the bot will choose one module from all the modules inside them, in our case either dusted or ambient

<figure><img src="https://1229326975-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJi1Dnz98r18DXDpXAYS4%2Fuploads%2Fmr52LGqk5cZC1c9N9ls1%2Fimage.png?alt=media&#x26;token=3be3da44-4144-4b32-aa30-8b6bc3811f61" alt=""><figcaption></figcaption></figure>

The parentheses mean that the bot will execute all the modules that are inside them, but in random order

<figure><img src="https://1229326975-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJi1Dnz98r18DXDpXAYS4%2Fuploads%2F1r6RRA7UCwc7B2bFoSrn%2Fimage.png?alt=media&#x26;token=1c06d6f4-9b2a-4ad7-9821-7cb2edf40558" alt=""><figcaption></figcaption></figure>

You can create as many lines as you want, just don't forget to put a comma in it

<figure><img src="https://1229326975-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJi1Dnz98r18DXDpXAYS4%2Fuploads%2FpBvVnmEi1zj9SUvnWBjP%2Fimage.png?alt=media&#x26;token=cec9e013-67e1-4722-b470-aee24c2bc571" alt=""><figcaption></figcaption></figure>
