|
| 1 | +--- |
| 2 | +title: How to solo mine with XMRig |
| 3 | +--- |
| 4 | + |
| 5 | +## Requirements |
| 6 | +### Wallet |
| 7 | + |
| 8 | +Before starting, you'll need to have a Monero Wallet configured. |
| 9 | + |
| 10 | +You have to use the Primary wallet address for mining - _Subaddresses and integrated addresses are not supported._ |
| 11 | + |
| 12 | +### Node |
| 13 | + |
| 14 | +**Optional:** Solo mining using XMRig can be configured to use ZMQ to avoid polling the node. To use ZMQ instead of polling add the following to your monerod config file or startup flags: |
| 15 | + |
| 16 | + --zmq-pub tcp://127.0.0.1:18083 |
| 17 | + |
| 18 | +**Example** |
| 19 | + |
| 20 | + ./monerod --zmq-pub tcp://127.0.0.1:18083 --out-peers 32 --in-peers 64 --add-priority-node=p2pmd.xmrvsbeast.com:18080 --add-priority-node=nodes.hashvault.pro:18080 --disable-dns-checkpoints --enable-dns-blocklist |
| 21 | + |
| 22 | + |
| 23 | +### XMRig |
| 24 | + |
| 25 | +You'll need to download or compile XMRig. |
| 26 | + |
| 27 | +You can download XMRig from: [XMRig.com](https://xmrig.com/download) |
| 28 | + |
| 29 | +## Configuring XMRig |
| 30 | + |
| 31 | +XMRig can be run using a config file or startup flags: |
| 32 | + |
| 33 | +**Note:** remove the parameter for `daemon-zmq-port` if your node does not have it enabled. |
| 34 | + |
| 35 | +=== "Config" |
| 36 | + There is a wizard on [XMRig.com](https://xmrig.com/wizard#result). |
| 37 | + |
| 38 | + Modify the pool section of your config file: |
| 39 | + ``` json |
| 40 | + "pools": [ |
| 41 | + { |
| 42 | + "enabled": true, |
| 43 | + "url": "127.0.0.1:18081", |
| 44 | + "user": "XMR_WALLET_ADDRESS", |
| 45 | + "daemon": true, |
| 46 | + "daemon-zmq-port": 18083, |
| 47 | + } |
| 48 | + ], |
| 49 | + ``` |
| 50 | + See the [official docs](https://xmrig.com/docs/miner/config). |
| 51 | + |
| 52 | +=== "Flags" |
| 53 | + |
| 54 | + Add the following flags to your xmrig startup: |
| 55 | + |
| 56 | + ``` |
| 57 | + --daemon -o 127.0.0.1:18081 -u XMR_WALLET_ADDRESS --daemon-zmq-port 18083 |
| 58 | + ``` |
| 59 | + |
| 60 | + See the [official docs](https://xmrig.com/docs/miner/command-line-options). |
| 61 | + |
| 62 | +## Running XMRig |
| 63 | + |
| 64 | +=== "Config" |
| 65 | + === "Linux / macOS" |
| 66 | + |
| 67 | + ``` |
| 68 | + ./xmrig -c config.json |
| 69 | + ``` |
| 70 | + For higher hashrates on Linux and macOS, you'll need to run with `sudo`. |
| 71 | + |
| 72 | + === "Windows" |
| 73 | + |
| 74 | + ``` |
| 75 | + xmrig.exe -c config.json |
| 76 | + ``` |
| 77 | + For higher hashrates on Windows, you'll need to edit properties to run as administrator |
| 78 | + |
| 79 | + |
| 80 | +=== "Flags" |
| 81 | + === "Linux / macOS" |
| 82 | + |
| 83 | + ``` |
| 84 | + ./xmrig --daemon -o 127.0.0.1:18081 -u XMR_WALLET_ADDRESS --daemon-zmq-port 18083 |
| 85 | + ``` |
| 86 | + For higher hashrates on Linux and macOS, you'll need to run with `sudo`. |
| 87 | + |
| 88 | + === "Windows" |
| 89 | + |
| 90 | + ``` |
| 91 | + xmrig.exe --daemon -o 127.0.0.1:18081 -u XMR_WALLET_ADDRESS --daemon-zmq-port 18083 |
| 92 | + ``` |
| 93 | + For higher hashrates on Windows, you'll need to edit properties to run as administrator |
| 94 | + |
| 95 | +{% include 'mining_footer' %} |
| 96 | + |
| 97 | +Adapted from [monero-site](https://github.com/monero-project/monero-site/blob/ee03c625e6257f25ac8f1d2d2ba57ec2891f48d2/_i18n/en/resources/user-guides/mine-to-pool.md) |
0 commit comments