How to solo mine Safex Cash with my computer

The key difference between pool mining and solo mining is that for pool mining, you earn a pro rata share of each block found by the pool, based on your hashrate contribution, whereas for solo mining, you are working on your own to find blocks, but when you do find one, you receive the entire block reward.

Longterm, both pool mining and solo mining should mathematically give you very similar returns.

However, with solo mining, you also help to support the decentralisation of the Safex blockchain network by running a node.

Running a node comes with additional responsibilities: you need to stay up-to-date with project development and ensure your node is the latest code version, performing updates as soon as practicable after code updates are released by the development team.

THIS IS IMPORTANT!!

Failure to keep your node updated can be detrimental to the Safex blockchain network, and can also invalidate your mining hashes. Please consider your ability to stay current with project development when considering solo mining, or simply running a node.

Currently, there is only the option to CPU mine. If you have a high-end CPU (eg. Ryzen 9 3900X), you will get a much higher hashrate using safex-rig, rather than mining directly within the node.

Code for GPU mining is not currently available.

Depending on your computer-skill level, you have several options for solo mining. It is recommended that you take your computing skills into consideration when looking at the various solo mining options available.

WARNING: Do NOT mine to an exchange address, as they may not credit to your exchange account.

Ubuntu

  • Node

If in Desktop mode, start a Terminal window.

For people looking to maximise their hashrate, you could try the hugepages and swapfile changes provided by @Cyberian in his Improve your Hashrate on Virtual Machines

Whilst the instructions were written for a Virtual Machine, these adjustments should also boost hashrate on a home mining rig, assuming you have sufficient RAM and HDD space available to accommodate the configuration changes.

screen -S daemon
sudo apt-get update && sudo apt-get upgrade -y
wget https://github.com/safex/safexcore/releases/download/6.0.0/safexd-linux-6.0.0
mv safexd-linux-6.0.0 safexd
chmod +x safexd
./safexd

Allow blockchain to sync.

start_mining YOUR_WALLET_ADDRESS T

where T = # of threads you want mining.

To detach the screen and allow it continue running without the Terminal window open, type

 CTRL+SHIFT+A
 CTRL+SHIFT+D

To return to the screen, start a Terminal window and type

screen -r daemon
  • Node + Miner

If in Desktop mode, start a Terminal window.

For people looking to maximise their hashrate, you could try the hugepages and swapfile changes provided by @Cyberian in his Improve your Hashrate on Virtual Machines

Whilst the instructions were written for a Virtual Machine, these adjustments should also boost hashrate on a home mining rig, assuming you have sufficient RAM and HDD space available to accommodate the configuration changes.

screen -S daemon
sudo apt-get update && sudo apt-get upgrade -y
wget https://github.com/safex/safexcore/releases/download/6.0.0/safexd-linux-6.0.0
mv safexd-linux-6.0.0 safexd
chmod +x safexd
./safexd

Allow blockchain to sync.

While the blockchain syncs, create a new screen window

CTRL+SHIFT+A
CTRL+SHIFT+C

To move between the two screens, use

CTRL+SHIFT+A
CTRL+SHIFT+"

In the second screen,

Edit 30/1/2020: follow https://github.com/xmrig/xmrig/wiki/Build

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

Let it build the xmrig executable

The preferred way to configure the miner is the JSON config file as it is more flexible and human friendly. The command line interface does not cover all features, such as mining profiles for different algorithms. Important options can be changed during runtime without miner restart by editing the config file or executing API calls.

Create your config.json file in the same location.

 sudo nano config.json

Copy and paste the following, changing YOUR_WALLET_ADDRESS to your address

{
    "api": {
        "id": null,
        "worker-id": null
    },
    "http": {
        "enabled": false,
        "host": "127.0.0.1",
        "port": 0,
        "access-token": null,
        "restricted": true
    },
    "autosave": true,
    "version": 1,
    "background": false,
    "colors": true,
    "randomx": {
        "init": -1,
        "numa": true
    },
    "cpu": {
        "enabled": true,
        "huge-pages": true,
        "hw-aes": null,
        "priority": null,
        "memory-pool": false,
        "max-threads-hint": 100,
        "asm": true,
        "argon2-impl": null,
        "cn/0": false,
        "cn-lite/0": false
    },
    "opencl": {
        "enabled": false,
        "cache": true,
        "loader": null,
        "platform": "AMD",
        "cn/0": false,
        "cn-lite/0": false
    },
    "cuda": {
        "enabled": false,
        "loader": null,
        "nvml": true,
        "cn/0": false,
        "cn-lite/0": false
    },
    "donate-level": 0,
    "donate-over-proxy": 1,
    "log-file": null,
    "pools": [
        {
            "algo": "rx/sfx",
            "coin": null,
            "url": "127.0.0.1:17402",
            "user": "YOUR_WALLET_ADDRESS",
            "pass": "x",
            "rig-id": null,
            "nicehash": false,
            "keepalive": false,
            "enabled": true,
            "tls": false,
            "tls-fingerprint": null,
            "daemon": true,
            "daemon-poll-interval":1000,
            "self-select": null
        }
    ],
    "print-time": 60,
    "health-print-time": 60,
    "retries": 5,
    "retry-pause": 5,
    "syslog": false,
    "user-agent": null,
    "watch": true
}

Once your node has syncronized, then you can start your miner with

 ./xmrig

Win 7/10

  • Node

In your preferred location, create a new folder: safexcore

In your Antivirus software, add the safexcore folder to your Exclusion List

Download the latest binary release of safexcore from the safex GitHub repository and save it to your safexcore folder.

Current: https://github.com/safex/safexcore/releases/download/6.0.0/safexd-windows-6.0.0.exe

When the dowload completes, windows will automatically prompt you to Discard . Click the dropdown to the right and select Keep .

Navigate to your safexcore folder. Your new file should be the only file in the folder.

On the file, right click - Properties and Unblock in the General tab.

Click on the Compatibility tab and tick the Checkbox beside “Run this program as an Administrator”.

Apply & OK

You can now launch the program and the blockchain will begin to syncronize.

This will take some time, depending upon your computer speed and internet connection. Once synchronised, you can begin mining.

start_mining YOUR_WALLET_ADDRESS T

where T = # of threads you want mining.

  • Node + Miner

In your preferred location, create a new folder: safexcore

In your Antivirus software, add the safexcore folder to your Exclusion List

Download the latest binary release of safexcore from the safex GitHub repository and save it to your safexcore folder.

Current: https://github.com/safex/safexcore/releases/download/6.0.0/safexd-windows-6.0.0.exe

When the dowload completes, windows will automatically prompt you to Discard . Click the dropdown to the right and select Keep .

Navigate to your safexcore folder. Your new file should be the only file in the folder.

On the file, right click - Properties and Unblock in the General tab.

Click on the Compatibility tab and tick the Checkbox beside “Run this program as an Administrator”.

Apply & OK

You can now launch the program and the blockchain will begin to syncronize.

This will take some time, depending upon your computer speed and internet connection.

Edit (23/12/2019): As of xmrig v5.4.0, the RandomSFX algorithm has been included in the official xmrig code.

Release info can be found at: https://github.com/xmrig/xmrig/releases

Trusted community member and long-time Safex Discord Moderator, @Astralite, has built a Windows 7/10 executable of the custom safex-rig version of xmrig. Please bear in mind, this is NOT an official Safex release, but many members of the Safex community are already using this build without issue.

Once the file finishes downloading, Windows may prompt you to Discard the file. The dropdown to the right of Discard allows you to select Keep.

Extract the files from the .zip (remember, password is safex )

Then rename the solo.json to config.json

Open (edit) the newly named config.json and add your wallet address in the “user” section.

Save the file.

Next, right click on the safex-rig file and select Properties .

You may find that Windows has Blocked the file from running. Select Unblock .

Next, go to the Compatibility tab and tick the checkbox beside Run this program as an administrator .

Click Apply , then OK .

Now simply run the safex-rig file by double clicking it.

Mac

  • Node

Download the current release: https://github.com/safex/safexcore/releases/download/6.0.0/safexd-osx-6.0.0

Start the program and allow the blockchain to synchronize.

This will take some time, depending upon your computer speed and internet connection. Once synchronised, you can begin mining.

start_mining YOUR_WALLET_ADDRESS T

where T = # of threads you want mining.

  • Node + Miner

As above, but dont start_mining

Edit (23/12/2019): As of xmrig v5.4.0, the RandomSFX algorithm has been included in the official xmrig code.

3 Likes

Hi,
I used to mine sfx with xmr-rig, and I am pretty familiar with how it works.
I see the new xmrig has been updated to contain RandomSFX.
I went to github to get the windows compiled version 5.4.0, and I see 3 different zip files. I downloaded all 3 because I wasn’t sure which one I needed.
They are…
xmrig-5.4.0-msvc-win64
xmrig-5.4.0-gcc-win64
xmrig-5.4.0-msvc-cuda10_1-win64
All 3 of them look similar, and look like they could be run once unzipped. The cuda10 is a much bigger file than the other 2.
Can someone tell me the difference? I plan to experiment with all of them anyway, but was wondering the real difference between them and also which one I should actually be using.
Thanks to anyone who can answer and help!!
-VR4

UPDATE:
I figured it out. They are just built with different compilers.
GCC is usually best for 32 bit
MSVC (Microsoft visual c++) is usually best for 64 bit
The larger cuda10 version adds GPU support for AMD and NVIDIA GPUs.

2 Likes

It’s the 20th of January- just checking if the CPU miner is working for Windows 10.
I’m getting a “connection refused” error.

Also does this work w/ GPUs now? I’ve been reading and catching up all day, however there is very little info out rn.

Thanks- long time lurker here- finally signed up. Been watching Daniel since 2016? When he launched this. Looks like I came back at a good time- although it seems very quiet around here.

-YourHalo

1 Like

@yourhalo you can check out this: https://github.com/xmrig/xmrig

They have added support for SFX (Safex Cash)

The CPU GUI miner is in progress and should be there for your fingertips imminently.

CPUs dominate GPUs in this algorithm though, so it is more recommended to mine with CPU though nothing wrong with contributing GPU power at all.

Most of the community is active on the discord chat room, but I do encourage using the forums so the informations sticks.

anyway here is a discord sign up link: https://discord.gg/y4dqJm6

Try pool How to pool mine Safex Cash with my computer

Edited OP - updated to v6 safexd GitHub links

And how to do this? Trying to connect xmrig to safexd like here, but

error: "Internal error: failed to create block template", code: -5

Sounds to me like a wrong algo / cnvariant in the config. What config have you set?

Like here described

{
    "api": {
        "id": null,
        "worker-id": null
    },
    "http": {
        "enabled": false,
        "host": "127.0.0.1",
        "port": 0,
        "access-token": null,
        "restricted": true
    },
    "autosave": true,
    "version": 1,
    "background": false,
    "colors": true,
    "randomx": {
        "init": -1,
        "numa": true
    },
    "cpu": {
        "enabled": true,
        "huge-pages": true,
        "hw-aes": null,
        "priority": null,
        "memory-pool": false,
        "max-threads-hint": 100,
        "asm": true,
        "argon2-impl": null,
        "cn/0": false,
        "cn-lite/0": false
    },
    "opencl": {
        "enabled": false,
        "cache": true,
        "loader": null,
        "platform": "AMD",
        "cn/0": false,
        "cn-lite/0": false
    },
    "cuda": {
        "enabled": false,
        "loader": null,
        "nvml": true,
        "cn/0": false,
        "cn-lite/0": false
    },
    "donate-level": 0,
    "donate-over-proxy": 1,
    "log-file": null,
    "pools": [
        {
            "algo": "rx/sfx",
            "coin": null,
            "url": "127.0.0.1:17402",
            "user": "YOUR_WALLET_ADDRESS",
            "pass": "x",
            "rig-id": null,
            "nicehash": false,
            "keepalive": false,
            "enabled": true,
            "tls": false,
            "tls-fingerprint": null,
            "daemon": true,
            "daemon-poll-interval":1000,
            "self-select": null
        }
    ],
    "print-time": 60,
    "health-print-time": 60,
    "retries": 5,
    "retry-pause": 5,
    "syslog": false,
    "user-agent": null,
    "watch": true
}

Sorry for late reply. Yes i have the same. Think that directly mining to daemon is not supported for sfx, ive read somewhere only monero, that would be because the blocktemplate is different. So eiter that or the block template / algo was changed after it was added to xmrig and it was never updated

oh, some time ago I used this method to mine wownero and xolentum, but i’m using xmrig in cli mode, not by .json file. And it’s works.
But, Zephyr, for example, can’t use this method too.

1 Like