# PoW - CPU Mining

{% hint style="info" %}
**The CPU mining phase has ended.** [**PoS - Staking**](/guides/wallet/pos-staking.md) **and** [**Masternodes**](/guides/wallet/masternodes.md) **are currently active.**
{% endhint %}

## What is CPU Mining? <a href="#what-is-cpu-mining" id="what-is-cpu-mining"></a>

**CPU mining** is a process of adding transaction records to the public ledger of cryptocurrency by performing necessary calculations with **Central Processing Unit (CPU)**. CPU is a part of computer that provides computing power for execution of operations performed by software installed on that computer.&#x20;

Merge's wallet supports CPU mining of MERGE until block 57,601.

Source: <https://en.bitcoinwiki.org/wiki/CPU_mining>​

## Setup CPU Mining <a href="#setup-cpu-mining" id="setup-cpu-mining"></a>

### Merge Wallet

Follow the next steps:

1. Open the wallet.
2. Go to Tools > Debug console.
3. Type **`setgenerate true "X"`**

Where "X" is the number of CPU cores you are running on your machine.

Example: setgenerate true 2 \
This is for a machine having 2 CPU cores.

### CPU Miner

You will need to have a MERGE address in your possession in order to benefit from the CPU Miner application. See [Wallet](/guides/wallet.md) to get a Merge wallet and take your MERGE address from "Receiving addresses...":

<div align="left"><img src="/files/-LUfX97ZWbdTfF23dqTM" alt="Receiving addresses..."></div>

Also, you will need to choose a pool to mine with. There are details of suitable pools in the #merge-pool channel in [Discord](http://discord.projectmerge.org). The pools generally provide the essential parameters you will need for the CPU Miner. Some tweaking of the values might be necessary.

#### Linux

These instructions assume familiarity with the command line and some Linux competence. The below has been tested on an Ubuntu 16 based system.

Follow the next steps:

1. Install dependencies:

   ```bash
   sudo apt-get update && sudo apt-get upgrade
   sudo apt-get install automake autoconf pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev make g++
   ```
2. Download CPU Miner's source code, compile and build the miner:

   ```bash
   git clone https://github.com/ProjectMerge/cpuminer-merge.git
   cd cpuminer-merge
   ./build.sh
   ```
3. If you want the miner to be generally available on your machine, then:

   ```bash
   sudo make install
   ```
4. Run the CPU Miner:\
   Either from the `cpuminer-merge` directory by:

   ```
   ./cpuminer -a argon2m -o <your chosen pool> -u <your MERGE address> <any other parms recommended by your chosen pool> <any other parms>
   ```

   or, if installed system-wide or any other location in your path:

   ```
   cpuminer -a argon2m -o <your chosen pool> -u <your MERGE address> <any other parms recommended by your chosen pool> <any other parms>
   ```

   For example:

   ```
   ./cpuminer -a argon2m -o stratum+tcp://stratum.icemining.ca:4240 -u MTqTm4KQq9dbxrtLgpzpxDLZnbR18nHKsp -p c=MERGE
   ```

   which uses values for the icemining pool. This is NOT a recommendation, just a known working example. Be **VERY** careful to use the correct receiving address. If you get it wrong, the rewards will still be sent there and you will never see them!

#### Windows

Follow the next steps:

1. Download the CPU Miner: <https://github.com/ProjectMerge/cpuminer-merge/releases/download/release/cpuminer-merge-win64.zip>
2. Unzip and extract the folder **`cpuminer-merge-win64`**
3. Open "Windows Command Prompt" or any other console you use and navigate to folder **`cpuminer-merge-win64`**
4. Using the console, run the CPU miner:&#x20;

   ```bash
   cpuminer.exe -a argon2m -o <your chosen pool> -u <your MERGE address> <any other parms recommended by your chosen pool> <any other parms>
   ```

   For example:

   ```
   cpuminer.exe -a argon2m -o stratum+tcp://pool.hashpool.eu:2811 -u MTZjwpSoJ95Hzj99iNyQAh8xbfk92B7sCG -p x
   ```

   which uses values for the hashpool pool. This is NOT a recommendation, just a known working example. Be **VERY** careful to use the correct receiving address. If you get it wrong, the rewards will still be sent there and you will never see them!

## Stop CPU Mining <a href="#stop-cpu-mining" id="stop-cpu-mining"></a>

### Merge Wallet

Follow the next steps:

1. Open the wallet.
2. Go to Tools > Debug console.
3. Type **`setgenerate false`**

### CPU Miner

#### Linux

Type \<Ctrl> + c on the console to end the miner.

#### Windows

Close "Windows Command Prompt" window or the console you are using to run the miner.


---

# 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://kb.projectmerge.org/guides/wallet/pow-cpu-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.
