# EMC CLI Download and Mining

## 1. EMC CLI Download

### Visit the EMC test network

Visit EMC Test Network: <https://earn.emc.network/>

### Connect wallet

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FhF5IzkUTE9S6GK7cKTZy%2FWinCLI_019.jpeg?alt=media&#x26;token=dffbecf0-efc8-46ae-9c47-ce2ccd93a660" alt=""><figcaption></figcaption></figure>

As shown in the above figure, click **\[Connect Walllet]** to proceed.

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FR6Jqua1oOJAlTfvA6ccO%2FWinCLI_020.jpeg?alt=media&#x26;token=d247cca4-99b9-4e29-b50b-c1119c49f84a" alt=""><figcaption></figcaption></figure>

From the pop-up window, select your preferred wallet from the list on the left. Next, in the wallet plugin interface, complete the steps in the wallet Chrome extension: "**Connect**" -> "**Authorize**" -> "**Sign**".

**Note:** During the wallet connection process, follow the prompt to switch to the EMC Testnet network (Visit [EMC Testnet RPC Information](https://docs.emc.network/emc-testnet/emc-airdrop-guidelines/wallet-setup/method-2-manual-configuration/emc-testnet-network-rpc-information)).

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2F498UTtYaNeOUuGt1aHLk%2FWinCLI_021.jpeg?alt=media&#x26;token=edf1a7a4-42bf-4b8d-8449-aff134fc2ca0" alt=""><figcaption></figcaption></figure>

Once connected, you can view your points and use an invitation code to invite friends.

#### Install and Operate EMC CLI Program

After the wallet connection is completed, you can proceed and click the **\[Install**] button in the image and select **\[CLI]** from the dropdown list.

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FU6wio14EpxP8PgOhbwYQ%2FWinCLI_022.jpeg?alt=media&#x26;token=2cd6bf90-b520-45f7-bb51-cb4e656b5163" alt=""><figcaption></figcaption></figure>

Choose **\[Windows]** for the download and installation.

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2Frd58OdM0yvwgrEYy4Zvs%2FWinCLI_023.jpeg?alt=media&#x26;token=b1be245b-f69c-4ccf-b2cb-373ae252b116" alt=""><figcaption></figcaption></figure>

As shown above, select **\[Windows]** for download and installation.<br>

### EMC CLI Files

Locate the "**EMC\_Miner\_Windows"** folder on your local device. The file structure is shown below:

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2Fv6fGEcEO4gqXbIi1ChTc%2FWinCLI_024.jpeg?alt=media&#x26;token=48d7c0cd-9b38-49f5-8ce9-b2973585fc9c" alt=""><figcaption></figcaption></figure>

<mark style="color:red;">`emc_miner_cli.exe`</mark> The command line program for EMC testnet mining；

<mark style="color:red;">`run_cli_help.cmd`</mark> Runs the command to view the help documentation；

<mark style="color:red;">`run_cpu_only.cmd`</mark> Runs the command to enable CPU-only mining；

<mark style="color:red;">`run_gpu_only.cmd`</mark> Runs the command to enable GPU-only mining；

## 2. EMC CLI Mining Operations

AI mining modes:

* <mark style="color:purple;">Basic mining</mark>
* <mark style="color:purple;">Advanced mining</mark>

### Basic Mining

Basic mining lets you choose between CPU-only or GPU-only mining.

### **EMC CLI CPU-Only Mining**

Run<mark style="color:red;">`run_cpu_only.cmd`</mark>，right-click, and select **"Run as Administrator"**

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2F7hw7pqAhaRLzGkIXsUZV%2FWinCLI_025.jpeg?alt=media&#x26;token=513723bf-b92e-45b6-b21a-b4df031ba11c" alt=""><figcaption></figcaption></figure>

Enter your private key to start CPU mining. EMC CLI automatically detects your hardware, initializes, and connects to the node. The information shown confirms successful CPU mining and rewards earned.

**Note：**

1. Before running <mark style="color:red;">**`run_cpu_only.cmd`**</mark>, make sure the address has enough Gas fees (see the section on getting Gas fees). Otherwise, errors will occur, and mining won't start.
2. To view your CPU mining rewards, go to the EMC testnet explorer and enter your mining address.
3. To stop mining, press <mark style="color:red;">**`Ctrl + C`**</mark> in the command terminal and enter <mark style="color:red;">**`Y`**</mark>to confirm.

### **EMC CLI GPU Mining**

Run <mark style="color:red;">**`run_gpu_only.cmd`**</mark>, right-click, and select "**Run as Administrator."** In the command terminal, enter your private key.

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2F8OCYenb8d8q3gHCmqqt4%2FWinCLI_026.jpeg?alt=media&#x26;token=66a4782b-f25b-4a62-a720-5fb887c3c202" alt=""><figcaption></figcaption></figure>

As shown in the image, before starting GPU mining, ensure that the Windows version of Docker is successfully installed and the Docker service is running. Otherwise, mining cannot proceed.

**Note:**

1. Before running <mark style="color:red;">`run_cpu_only.cmd`</mark>, ensure that the address has sufficient gas fees (access the gas fee allocation section). Otherwise, an error will occur, preventing successful mining.
2. To clearly understand and verify CPU mining earnings, enter your mining address in the EMC testnet browser to check.
3. During mining, press <mark style="color:red;">`Ctrl + C`</mark> in the command line terminal to stop mining. In the command prompt that appears, enter <mark style="color:red;">`Y`</mark> to confirm the termination operation.

#### EMC CLI Advanced Mining

EMC CLI advanced mining supports simultaneous CPU and GPU mining, as well as enabling multi-threaded mining.

**`emc_miner_cli` Command Line Parameters**

First, locate the parent directory of the <mark style="color:red;">`emc_miner_cli.exe`</mark> program, for example: <mark style="color:red;">`"D:\EMC_Miner_Windows-1.5.0\EMC_Miner_Windows\"`</mark>. Then, in the CMD terminal, enter the relevant commands as shown in the image:

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FP8w2RFl01FK1eNTdF3uu%2FWinCLI_027.jpeg?alt=media&#x26;token=2caa53e5-c878-4dbc-a695-675b15205112" alt=""><figcaption></figcaption></figure>

Refer to the help documentation by entering the following command:

```powershell
emc_miner_cli.exe -h
```

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FhPmUUdmId5htwoOLVyl5%2FWinCLI_028.jpeg?alt=media&#x26;token=b904a078-7688-4248-811c-7ce330bd1cac" alt=""><figcaption></figcaption></figure>

**Description** :

* `cpu_enable` : Enable or disable CPU mining.
* `cpu_thread` Specifies the number of CPU threads to use.
* `gpu_enable` : Enable or disable GPU mining.
* `- gpu_model` : Specify the GPU serial number to use.
* `gpu_thread` Specifies the number of GPU threads to use.
* `miner_private` : Your wallet private key (required).

#### **EMC CLI Advanced CPU Mining**

Default CPU miningIn the CMD client, enter the following command and press the **Enter key**:

```powershell
emc_miner_cli.exe --cpu_enable=true --gpu_enable=false --miner_private=<your_wallet_private_key>
```

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FmQinxzs56lrTZZIK1guJ%2FWinCLI_029.jpeg?alt=media&#x26;token=1b2d3769-6049-4421-81a6-4b169ccf1f87" alt=""><figcaption></figcaption></figure>

As shown in the image above, the default CPU mining is successful.

#### **Multi-threaded CPU Mining**

In the CMD client, enter <mark style="color:red;">`wmic`</mark> to check the number of CPU cores and threads on the computer:

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FT61wcHZQTqhokuyk0aPd%2FWinCLI_030.jpeg?alt=media&#x26;token=29643288-2ddc-4591-b074-6c4aa3a9f568" alt=""><figcaption></figcaption></figure>

The image shows that the local computer's CPU has 24 cores and 32 threads. Then, enter the mining command and press the Enter key:

```powershell
emc_miner_cli.exe --cpu_enable=true --gpu_enable=false --cpu_thread=counts --miner_private=your wallet private key
```

* **Description** :
  * <mark style="color:red;">`Number of threads`</mark>: Set according to the number of your CPU cores (for example, use `10` threads).
  * <mark style="color:red;">`Your wallet private key`</mark>: Replace with your actual wallet private key

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FUydk91qOKktSBssaFvYn%2FWinCLI_031.jpeg?alt=media&#x26;token=d62aef47-93ac-49d3-a188-d278102ffb70" alt=""><figcaption></figcaption></figure>

The figure shows that EMC CLI successfully mined CPU with 10 threads.<br>

#### **EMC CLI Advanced GPU Mining**

**Specify GPU serial number for mining**

For devices with multiple graphics cards installed, EMC CLI supports specifying a GPU serial number for mining.

\
**View GPU serial number**

Before starting GPU mining, you need to check the available GPU serial numbers in your computer.In the CMD terminal, enter the following command and press the **Enter key**:

```powershell
emc_miner_cli.exe -g
```

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2Fm7CgCFLYdohwfQ067vDI%2FWinCLI_032.jpeg?alt=media&#x26;token=8f62041d-a28a-44f2-b75c-299d2eaf3979" alt=""><figcaption></figcaption></figure>

**Specify GPU mining**In the cmd end point, enter the following:

```powershell
emc_miner_cli.exe --cpu_enable=false --gpu_enable=true --gpu_model=<GPU_number> --miner_private=<your_wallet_private_key>
```

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FZYfh4ltBb5ukPMExKPjZ%2FWinCLI_033.jpeg?alt=media&#x26;token=cbd99cd6-4398-46d7-9ace-3ef7066c01f4" alt=""><figcaption></figcaption></figure>

As shown in the above figure, GPU 1 is designated for mining.

**Note:**

Before starting mining, ensure that the Docker Engine is running. Otherwise, the following error occurs:

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FNmA6BHOd0h9upHZbXlHt%2FWinCLI_034.jpeg?alt=media&#x26;token=5c573693-ab37-4714-b619-5d8628e2fc1b" alt=""><figcaption></figcaption></figure>

**Multi-threaded GPU mining**

At the cmd end point, enter the mining command and **press Enter** :

```powershell
emc_miner_cli.exe --cpu_enable=false --gpu_enable=true --gpu_model=<GPU_serial_number> --gpu_thread=<number_of_threads> --miner_private=<your_wallet_private_key>
```

* **Description** :
  * <mark style="color:red;">`GPU serial number`</mark> : The selected GPU serial number.
  * <mark style="color:red;">`Number of threads`</mark> : The number of threads allocated to the GPU mining task (e.g., using `4` threads).
  * <mark style="color:red;">`Your wallet private key`</mark> : Replace with your actual wallet private key

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FCCz4PB0JxvWWwM6ugQAP%2FWinCLI_035.jpeg?alt=media&#x26;token=4a2b2d8e-350e-432e-a4a3-07eaac28bcf0" alt=""><figcaption></figcaption></figure>

As shown in the above figure, specify graphics card 1 and start 4 processes for GPU mining.<br>

**EMC CLI CPU and GPU Dual Mining**

To improve overall mining efficiency, EMC CLI supports multi-threaded participation in both CPU and GPU mining simultaneously.In the CMD terminal, enter the mining command and press the **Enter key**:

```powershell
emc_miner_cli.exe --cpu_thread=<number_of_threads> --gpu_model=<GPU_serial_number> --gpu_thread=<number_of_threads> --miner_private=<your_wallet_private_key>
```

* **Description** :
  * <mark style="color:red;">`GPU serial number`</mark> : The selected GPU serial number.
  * <mark style="color:red;">`Line CPU thread count`</mark> : The number of threads allocated to the CPU mining task (e.g., using <mark style="color:red;">`10`</mark> threads).
  * <mark style="color:red;">`Number of line GPU threads`</mark> : The number of threads allocated to the GPU mining task (e.g., using <mark style="color:red;">`4`</mark> threads).
  * <mark style="color:red;">`Your wallet private key`</mark> : Replace with your actual wallet private key

<figure><img src="https://4040577148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRh2Ej6T3BJ4HfxcHvbyU%2Fuploads%2FvwgydZ3sz5DvvWQNl739%2FWinCLI_036.jpeg?alt=media&#x26;token=cdfedd12-ee6f-49b2-859c-4b7254534358" alt=""><figcaption></figcaption></figure>

As shown in the image above, specify GPU 1 and allocate 4 processes for GPU mining and 10 processes for CPU mining.


---

# 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.emc.network/emc-testnet/emc-airdrop-guidelines/testnet-tutorial-guide/windows-cli-tutorial/emc-cli-download-and-mining.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.
