In this tutorial we add the xmrig cpu miner to smOS. It’ll be helpful if you have a basic understanding of linux cli. I have a tutorial here Linux CLI (Command Line Interface) primer for beginners — Steemit
I won’t cover how to ssh here. See my bminer tutorial for that. Here is how to secure ssh for smOS https://steemit.com/mining/@greerso/securing-ssh-for-smos.
sudo apt-get install git build-essential cmake libuv1-dev libmicrohttpd-devgit clone https://github.com/xmrig/xmrig.git
cd xmrig-2.4.4
mkdir build
cd build
cmake ..
make
sudo mkdir /root/miner_org/xmrig-2.4.4&&sudo mv xmrig /root/miner_org/xmrig-2.4.4/
sudo chmod +x /root/miner_org/xmrig-2.4.4/xmrig
sudo nano /root/miner_org/xmrig-2.4.4/config.json
and paste the following text replacing your own preferences:
{
"algo": "cryptonight", // cryptonight (default) or cryptonight-lite
"av": 0, // algorithm variation, 0 auto select
"background": true, // true to run the miner in the background
"colors": true, // false to disable colored output
"cpu-affinity": null, // set process affinity to CPU core(s), mask "0x3" for cores 0 and 1
"cpu-priority": null, // set process priority (0 idle, 2 normal to 5 highest)
"donate-level": 1, // donate level, mininum 1%
"log-file": null, // log all output to a file, example: "c:/some/path/xmrig.log"
"max-cpu-usage": 75, // maximum CPU usage for automatic mode, usually limiting factor is CPU cache not this option.
"print-time": 60, // print hashrate report every N seconds
"retries": 5, // number of times to retry before switch to backup server
"retry-pause": 5, // time to pause between retries
"safe": false, // true to safe adjust threads and av settings for current CPU
"syslog": false, // use system log for output messages
"threads": null, // number of miner threads
"pools": [
{
"url": "us-east.cryptonight-hub.miningpoolhub.com:20596", // URL of mining server
"user": "greerso.Trio_CPU", // username for mining server
"pass": "x", // password for mining server
"keepalive": true, // send keepalived for prevent timeout (need pool support)
"nicehash": false // enable nicehash/xmrig-proxy support
}
],
"api": {
"port": 3333, // port for the miner API https://github.com/xmrig/xmrig/wiki/API
"access-token": null, // access token for API
"worker-id": null // custom worker-id for API
}
}
Exit nano and save.
[ctrl+x]
y
[enter]
"background": false and run the command
sudo /root/miner_org/xmrig-2.4.4/xmrig
You will see the miner output to the screen.
[ctrl]+c
to cancelsudo nano /lib/systemd/system/xmrig.service
paste the following text
[Unit]
Description=XMRig Daemon
After=network.target
[Service]
Type=forking
GuessMainPID=no
ExecStart=/root/miner_org/xmrig-2.4.4/xmrig -c /root/miner_org/xmrig-2.4.4/config.json -B
Restart=always
User=miner
[Install]
WantedBy=multi-user.target
Exit nano and save.
[ctrl+x]
y
[enter]
sudo systemctl daemon-reload
sudo systemctl enable xmrig.service
sudo systemctl start xmrig.service
You can control the service with the following commands
sudo systemctl status xmrig # Get status of service
sudo systemctl stop xmrig # Stop the service
sudo systemctl restart xmrig # restart the service
The cpu miner will not be able to be monitored via simplemining.net but it does have an api accessible on the port specified in the config.json file.