# How to mine RandomSFX with my computer

**URL:** <https://forum.safex.org/t/how-to-mine-randomsfx-with-my-computer/6704>\
**Category:** Mining\
**Created:** [December 1, 2019, 11:50am UTC](https://forum.safex.org/t/how-to-mine-randomsfx-with-my-computer/6704 "2019-12-01T11:50:04Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rich.bate](https://forum.safex.org/user_avatar/forum.safex.org/rich.bate/32/2123_2.png) [@Rich.bate](https://forum.safex.org/u/Rich.bate)\
**Post date:** [December 1, 2019, 11:50am UTC](https://forum.safex.org/t/how-to-mine-randomsfx-with-my-computer/6704/1 "2019-12-01T11:50:04Z")

</div>

![how-to-mine](https://forum.safex.org/uploads/default/original/2X/0/049d98a81ca7687dc9031c57a0b4eec4d17af8cd.jpeg)

_This is a work in progress article whilst we’re making the necessary tools and changes for you to mine the new RandomSFX mining algorithm._

–

**Background**  
RandomSFX is a variation of the [RandomX algorithm](https://github.com/tevador/RandomX) which enables more people than ever before to compete in the mining of Safex Cash.

The algorithm is designed to remove the threat of ASICs and hash rental services that make the network uncompetitive for everyday miners. You could say that the design of [RandomX is so inefficient](https://eng.ambcrypto.com/monero-the-efficiency-of-the-inefficient-randomx/), that it’s not cost effective, or maybe not even possible to design ASIC chips to mine RandomX coins.

–

**Tools of the trade**  
Because RandomSFX is a modified version of RandomX, it’s not currently supporting in the usual mining softwares (XMRig, XMR-Stak, etc).

Therefore, the team has built a [custom fork of XMRig called Safex-Rig](https://github.com/safex/safex-rig) which supports CPU, AMD and Nvidia mining.

Compile guides can be found here: [https://github.com/safex/safex-rig/wiki/Build](https://github.com/safex/safex-rig/wiki/Build) - Note, make sure you’re cloning `git clone https://github.com/safex/xmrig.git` and not the one in the wiki (we’ve still to make the necessary editorial changes, but everything else remains the same).

If you’re already familiar with XMRig, the commands are exactly the same. The only thing you will need to consider is the specific algorithm for Safex which is `rx/sfx`.

–

**Building Safex-Rig Miner - Ubuntu**  
At the time of writing this, there are no pre-compiled binaries of the Safex-Rig mining software. You will need to compile your own copy of our special fork of XMRig, called [Safex-Rig](https://github.com/safex/safex-rig).

[Building Safex-Rig](https://github.com/safex/safex-rig) is the same process as cloning and building the XMRig repository.

```
sudo apt-get install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev
git clone https://github.com/safex/safex-rig.git
cd xmrig && mkdir build && cd build
cmake ..
make

```

–

**Building Safex-Rig Miner - Windows**  
Building in Windows is a little more complicated than Ubuntu. Full instructions can be found here:

> **[Windows Build](https://github.com/xmrig/xmrig/wiki/Windows-Build)**
>
> RandomX, KawPow, CryptoNight and GhostRider unified CPU/GPU miner and RandomX benchmark - xmrig/xmrig

Note: Make sure you swap any reference to the XMRig github with our repo instead `https://github.com/safex/safex-rig`

–

**Safex Cash Testnet Pool**  
A temporary testnet mining pool has been set up for you to test your Safex-Rig miner configuration. A few things to note:

- This is a testnet pool, and the SFX you mine on here has no value
- You need to mine to a testnet address. An example Testnet address is `SFXtzS2TXfSZu4XJh8sRNsF7iqe66dWX8NByr3CGDwM45Bo8tbsNuwffaTbjSr6Eqd9ihBB3WmTB3ftS4aNqDz9EMapGkh6FJKG`
- You need to set your algorithm to `rx/sfx` to mine RandomSFX
- You will NEED to be using the Safex-Rig build to mine RandomSFX as it is not yet implemented in the main XMRig software.

–

**Pool mining with Safex-Rig - Ubuntu**  
As menitoned, Safex-Rig runs in the same fashion as XMRStak. To mine from a Safex Cash pool with the new miner, the only major configuration option you need to ensure is set is the mining algorithm choice - `rx/sfx`.

Example configuration to mine the RandomSFX testnet pool:

`./xmrig -o 95.179.231.236:5555 -u SFXtzS2TXfSZu4XJh8sRNsF7iqe66dWX8NByr3CGDwM45Bo8tbsNuwffaTbjSr6Eqd9ihBB3WmTB3ftS4aNqDz9EMapGkh6FJKG -a rx/sfx`

-o = Pool URL, in this instance it’s the testnet pool IP address, but could be pool.safexnews.net:5555 in the future.

-u = Your Safex Cash address, in this instance it’s a testnet address. You would use your normal Safex address once RandomSFX is on the mainnet.

-a = Algorithm, set to `rx/sfx`. Depending on the pool you use, sometimes you don’t need to explicitly set the algorithm as it will auto-detect. This is just a failsafe to ensure it works correctly.

–

**TO DO/WRITE**

- Solo Mining - Node
- Solo Mining - Node + Safex-Rig
- 1 Click Miner App
- Updated Safex Cash mining pool list
- Computer hardware performance chart

**Change log**

- Added preliminary testnet pool details [01/12/2019]
- Added details about compiling Safex-Rig miner [01/12/2019]
- Added miner config details for Safex-Rig [01/12/2019]

---

<div class="post-metadata">

**Author:** ![d3llweb](https://forum.safex.org/letter_avatar_proxy/v4/letter/d/3ec8ea/32.png) [@d3llweb](https://forum.safex.org/u/d3llweb)\
**Post date:** [December 4, 2019, 1:43am UTC](https://forum.safex.org/t/how-to-mine-randomsfx-with-my-computer/6704/2 "2019-12-04T01:43:42Z")

</div>

Need help in setting up my miner in a Windows system. If you are close to coming up with a more detailed step by step instructions, or if it’s not suppose to work yet at this time, you can ignore this reply. I can wait for the instructions or when it’s ready. Otherwise, I’d appreciate some help. (Disclaimer: I don’t have any coding background but I was able to setup mining Ethereum two years ago and had been mining safex via XMRig for sometime now.)

I’m following the instructions from the link you included in the article for Windows system ([https://github.com/xmrig/xmrig/wiki/Windows-Build](https://github.com/xmrig/xmrig/wiki/Windows-Build)) but I’m stuck on the following:

CMake build:

```auto
mkdir build
cd build
cmake .. -G "Unix Makefiles" -DXMRIG_DEPS=c:/xmrig-deps/gcc/x64
make

```

MSYS2 is returning the error “bash: cmake: command not found” - see picture below

Also, I’m mining with NVIDIA GPUs and I downloaded the CUDA plugin but have no idea on what to do with those files. Do I copy the files to the “safex-rig” folder (I cloned the binaries)?

I don’t even see an executable file (\*.exe) inside the safex-rig folder. How do I even run the miner? (is that what the MSYS2 steps are for? to run the miner?). Hoping for enlightenment!

 ![configuring safex miner](https://forum.safex.org/uploads/default/original/2X/5/5ebcbe6357bdfab4eea5cc0b5112586975520a1b.png)

---

<div class="post-metadata">

**Author:** ![Greetzkenny](https://forum.safex.org/letter_avatar_proxy/v4/letter/g/34f0e0/32.png) [@Greetzkenny](https://forum.safex.org/u/Greetzkenny)\
**Post date:** [December 4, 2019, 6:54pm UTC](https://forum.safex.org/t/how-to-mine-randomsfx-with-my-computer/6704/3 "2019-12-04T18:54:34Z")

</div>

Looks like you are missing CMake on the path. It’s a program you can download for free. Sorry, I don’t have time to elaborate any further, I also still have to run everything.

---

<div class="post-metadata">

**Author:** ![Rob](https://forum.safex.org/user_avatar/forum.safex.org/rob/32/2453_2.png) [@Rob](https://forum.safex.org/u/Rob)\
**Post date:** [December 5, 2019, 4:55am UTC](https://forum.safex.org/t/how-to-mine-randomsfx-with-my-computer/6704/4 "2019-12-05T04:55:10Z")

</div>

@Rich.bate

OK I tried to follow the directions for MSYS on windows building of XMR-rig (safex port of it)

All ok till the cmake & build  
I even downloaded the dependencies and put them into the referenced directory (c:/xmrig-deps)

So

```auto
cd build 
cmake .. -G "Unix Makefiles" -DXMRIG_DEPS=c:/xmrig-deps/gcc/x64
make

```

cmake has no output and “make” simply says _No targets specified and no makefile found_

Which is what I’d expect from those directions but is no good for building this

---

<div class="post-metadata">

**Author:** ![Rob](https://forum.safex.org/user_avatar/forum.safex.org/rob/32/2453_2.png) [@Rob](https://forum.safex.org/u/Rob)\
**Post date:** [December 5, 2019, 4:55am UTC](https://forum.safex.org/t/how-to-mine-randomsfx-with-my-computer/6704/5 "2019-12-05T04:55:53Z")

</div>

> [@d3llweb](#):
>
> MSYS2 is returning the error “bash: cmake: command not found” - see picture below

you need to do

```auto
pacman -S cmake

```

---

<div class="post-metadata">

**Author:** ![d3llweb](https://forum.safex.org/letter_avatar_proxy/v4/letter/d/3ec8ea/32.png) [@d3llweb](https://forum.safex.org/u/d3llweb)\
**Post date:** [December 5, 2019, 3:37pm UTC](https://forum.safex.org/t/how-to-mine-randomsfx-with-my-computer/6704/6 "2019-12-05T15:37:11Z")

</div>

I did “pacman -S cmake” but “make” still says _No targets specified and no makefile found_

It must be missing another step.  
The safex-rig is located at C:\Users\d3LLMiner\Documents\GitHub\safex-rig  
I also downloaded the CMake program that Greetzkenny suggested and is at C:\Program Files\CMake (but I don’t think I need this)  
Thanks for the help.

 ![cmake](https://forum.safex.org/uploads/default/original/2X/c/c31bbf679627a8fde59f2efa2d681e2a2542394c.png)

---

<div class="post-metadata">

**Author:** ![Greetzkenny](https://forum.safex.org/letter_avatar_proxy/v4/letter/g/34f0e0/32.png) [@Greetzkenny](https://forum.safex.org/u/Greetzkenny)\
**Post date:** [December 5, 2019, 4:11pm UTC](https://forum.safex.org/t/how-to-mine-randomsfx-with-my-computer/6704/7 "2019-12-05T16:11:37Z")

</div>

Hi,

As I was unaware of what MINGW actually is, you are right, you don’t need to download CMake yourself.  
As we speak, I am running the “make” command, so if something fails after that, I have no solution for that (yet).

What I did:

1. I downloaded the zip file from [https://github.com/safex/safex-rig/archive/master.zip](https://github.com/safex/safex-rig/archive/master.zip).
2. I unpacked the zipfile somewhere (as far as I know, you can unzip wherever you want).
3. I downloaded MINGW and started “C:\msys64\msys2\_shell.cmd -mingw64” (note that I’m running the command with a parameter, which is what happens when I run a shortcut that was created while installing MINGW.
4. I run these commands as given:

```auto
pacman -Sy
pacman -S mingw-w64-x86_64-gcc
pacman -S make
pacman -S mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-pkg-config

```

1. I put my MINGW64 shell to point at the directory where I unzipped the Safex-rig-master. Thus: I was currently in the directory that contains folders like “src”, “.gitignore”, “scripts”, “package.json”, “README.MD”, etc.
2. This directory also contains “CMakeLists.txt”. I opened it with Notepad ++.
3. As per [https://www.ourtecads.com/2019/10/how-to-fix-hwloc-issue-when-running.html](https://www.ourtecads.com/2019/10/how-to-fix-hwloc-issue-when-running.html), I changed line 5 from ON to OFF:  
`option(WITH_HWLOC "Enable hwloc support" OFF)`
4. I then followed these commands:

```auto
mkdir build
cd build
cmake .. -G "Unix Makefiles" -DXMRIG_DEPS=c:/xmrig-deps/gcc/x64
make

```

1. I created a config.json in the exact same folder where my xmrig.exe lives (in the “build” folder). I used this example ([https://github.com/safex/safex-rig/blob/master/src/config.json](https://github.com/safex/safex-rig/blob/master/src/config.json)) and I inserted my own wallet address.

2. I also followed the first two answers of this page: [https://stackoverflow.com/questions/28907304/cc1-exe-system-error-libwinpthread-1-dll-missing-but-it-isnt](https://stackoverflow.com/questions/28907304/cc1-exe-system-error-libwinpthread-1-dll-missing-but-it-isnt)

3. I now have a working xmrig.exe.

---

<div class="post-metadata">

**Author:** ![Alex2](https://forum.safex.org/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@Alex2](https://forum.safex.org/u/Alex2)\
**Post date:** [December 5, 2019, 7:44pm UTC](https://forum.safex.org/t/how-to-mine-randomsfx-with-my-computer/6704/8 "2019-12-05T19:44:11Z")

</div>

Test net starts ./x mr igo 95.179.231.236:5555-u Sfxtzs2txfszu4xjh8srnsf7iqe66dwx8nbyr3cgdwm45bo8tbsnuffatbjsr6eqd9ihbb3wmtb3fts4anqdz9emapgkh6fjkg-a rx/sfx but on pool pool. safexnews. net:4444 no

 ![sfx](https://forum.safex.org/uploads/default/original/2X/4/4102043f44549e342b28e24122d83a9cc78ee8a5.jpeg)

---

<div class="post-metadata">

**Author:** ![aussiesloth](https://forum.safex.org/user_avatar/forum.safex.org/aussiesloth/32/2080_2.png) [@aussiesloth](https://forum.safex.org/u/aussiesloth)\
**Post date:** [December 5, 2019, 7:49pm UTC](https://forum.safex.org/t/how-to-mine-randomsfx-with-my-computer/6704/10 "2019-12-05T19:49:25Z")

</div>

The pool is currently offline for maintenance

---

<div class="post-metadata">

**Author:** ![Rob](https://forum.safex.org/user_avatar/forum.safex.org/rob/32/2453_2.png) [@Rob](https://forum.safex.org/u/Rob)\
**Post date:** [December 5, 2019, 10:29pm UTC](https://forum.safex.org/t/how-to-mine-randomsfx-with-my-computer/6704/11 "2019-12-05T22:29:43Z")

</div>

> [@Greetzkenny](#):
>
> cmake .. -G “Unix Makefiles” -DXMRIG\_DEPS=c:/xmrig-deps/gcc/x64 make

Done the rest and these do not do anything except make says nothing to do

---

<div class="post-metadata">

**Author:** ![d3llweb](https://forum.safex.org/letter_avatar_proxy/v4/letter/d/3ec8ea/32.png) [@d3llweb](https://forum.safex.org/u/d3llweb)\
**Post date:** [December 6, 2019, 4:06am UTC](https://forum.safex.org/t/how-to-mine-randomsfx-with-my-computer/6704/12 "2019-12-06T04:06:55Z")

</div>

> [@Greetzkenny](#):
>
> Hi,
> 
> As I was unaware of what MINGW actually is, you are right, you don’t need to download CMake yourself.  
> As we speak, I am running the “make” command, so if something fails after that, I have no solution for that (yet).
> 
> What I did:
> 
> 1. I downloaded the zip file from [https://github.com/safex/safex-rig/archive/master.zip](https://github.com/safex/safex-rig/archive/master.zip).
> 2. I unpacked the zipfile somewhere (as far as I know, you can unzip wherever you want).
> 3. I downloaded MINGW and started “C:\msys64\msys2\_shell.cmd -mingw64” (note that I’m running the command with a parameter, which is what happens when I run a shortcut that was created while installing MINGW.
> 4. I run these commands as given:
> 
> ```auto
> pacman -Sy
> pacman -S mingw-w64-x86_64-gcc
> pacman -S make
> pacman -S mingw-w64-x86_64-cmake
> pacman -S mingw-w64-x86_64-pkg-config
> 
> ```
> 
> 1. I put my MINGW64 shell to point at the directory where I unzipped the Safex-rig-master. Thus: I was currently in the directory that contains folders like “src”, “.gitignore”, “scripts”, “package.json”, “README.MD”, etc.
> 2. This directory also contains “CMakeLists.txt”. I opened it with Notepad ++.
> 3. As per [https://www.ourtecads.com/2019/10/how-to-fix-hwloc-issue-when-running.html](https://www.ourtecads.com/2019/10/how-to-fix-hwloc-issue-when-running.html), I changed line 5 from ON to OFF:  
> `option(WITH_HWLOC "Enable hwloc support" OFF)`
> 4. I then followed these commands:
> 
> ```auto
> mkdir build
> cd build
> cmake .. -G "Unix Makefiles" -DXMRIG_DEPS=c:/xmrig-deps/gcc/x64
> make
> 
> ```
> 
> 1. I created a config.json in the exact same folder where my xmrig.exe lives (in the “build” folder). I used this example ([https://github.com/safex/safex-rig/blob/master/src/config.json](https://github.com/safex/safex-rig/blob/master/src/config.json)) and I inserted my own wallet address.
> 
> 2. I also followed the first two answers of this page: [https://stackoverflow.com/questions/28907304/cc1-exe-system-error-libwinpthread-1-dll-missing-but-it-isnt](https://stackoverflow.com/questions/28907304/cc1-exe-system-error-libwinpthread-1-dll-missing-but-it-isnt)
> 
> 3. I now have a working xmrig.exe.

Awesome! Followed everything to the letter and got a working xmrig.exe CPU mining.  
Now I do have 5 Nvidia GTX 1070s in my mining rig.  
I believe I was able to install the CUDA add-on correctly but now I need some guidance with the config.json. I ‘enabled’ CUDA but I’m receiving an error CUDA disabled (no device detected)

Anybody has one I can use as a template? Thanks.

 ![working cpu](https://forum.safex.org/uploads/default/original/2X/1/122bee1a81bfe24d4030522fbab6e28cdedcfb71.png)
