Tag Archive for: mining

Mining cryptocurrency, actually, isn’t profitable because hardware and electricity cost is high than mining earnings. After writing my last Altcoin mining post, some sysadmin colleagues ask me if I knew how to mine in the production server. The result is this post.

 

Before beginning to write, I want to say that I was tested in the client beast server, underused, with client consent. The server is a basic OVH Hosting Server:

Intel Xeon D-1520 – 4c/8t – 2,4GHz

And after 2 months of mining my earns was near 0,001 Etherum.

This post talks about configuring the server, installing tools and try to mine various cryptocurrencies without hanging the server. Good luck sysadmins!

Mining Ethereum in Ubuntu/Debian

Actually, Ethereum needs a lot of resources to be mined. For me, the best option actually is mine Monero (next section). Anyway, mine ethereum is possible with some number of CPUs.

You need, first of all, to account in any place that allows sending your miner funds. For ethereum you could use Minergate. Here is my referrer link: Minergate

Ethminer

The next step is to install a mining tool. For our purposes, we can use Ethminer. Ethminer isn’t easy to found and install. Some searches always show cppethereum project, but I don’t want to compile my tool, I want to download/install and mine.

After some research I found that I can do this:

We added a new repository to our system and update the repo packages list. Then install ethminer:

Cool, you have installed the mining tool, and you have your minergate account, time to mine:

And you will see how DAG begins to generate (DAG is needed to mine ETH, it’s a big file ~3,5Gb) but if you do CTRL-Z (to put your process in the background) and write exit to leave the session, Ethminer stops working.

Using Screen

But, WTF!!! I want my miner working!! Ok, we need to make a process stay work even when we go out. Ubuntu has a solution, screen command. Some Ubuntu versions have installed and others not. You can try to install it with this command:

The screen is an application that allows you to use multiple sessions inside the same window. If you write simply screen you will enter in a new session. You can leave with a keyboard shortcut or writing exit.

You can read a complete tutorial about screen here: Digitalocean tutorials Ubuntu Cloud Server

We only need to know some basic commands.

  • screen: enters in screen mode
  • exit: exits from screen
  • CTRL – a ?: Screen help window
  • CTRL – a d: Detach window
  • screen -r: return to the last screen

And what we do?

Push CTRL – a d

And we can exit the shell.

But, WTF Victor!!! Ethminer is putting all my CPUs to 100%. Mmmmm … eeeeh! yeeees!

scream girl

 

Limiting CPU Usage

I forgot to limit them! We need to limit CPU, but Ethminer hasn’t any control over CPU number or something. Then we need to install something more. Here comes cpulimit.

cpulimit allows limiting the use of one process. How it works; You need to execute the process with final &. This means that put process in the background. When you do this system says process number, for example, you can tail some log meanwhile you are continuing working:

And 6560 is the process number, we can now limit CPU use of this process:

-p is process number
-l is Total CPU, 500 are 50%, 1000 are 100%

Well, now we can put it all together:

Push CTRL – a d

And we can exit the shell.

Now, we have finally worked our miner on the server. We can exit all.

Return to miner screen

Our last … We exited all screens, but we want to return to control or stop our process inside a screen session, then we write:

And we return to our last screen.

Be careful exiting and returning, sometimes the screen creates new sessions or simply don’t want to connect to the previous screen and you will need to force entry in your miner screen.

Mining Monero

For monero XMR things change, actually, we don’t use minergate yet, we are using other pools and these pools works a little bit different. First of all, you need a Wallet.

Making our Monero Wallet

Monero Wallet is where you store your cryptocurrency. The best option is to make an account in MyMonero (my monero). When you click on Create Account MyMonero advert that is not the safest place for large amounts, but actually my riches are 0,3 XMR and I think isn’t much.

After that they show this screen with Your Private Login Key:

my monero create account mnemonic seed

Store your private key in the safest place, if you lose this mnemonic seed, you lose your moneros. This means that you need to write on paper and put it in some safe deposit box or something. I lose, you lose XMR.

Create an account and then gets your Monero Wallet address.

You will need.

Looking For New Pool

After some research, I’ve found one service for use with these tools. Minergate isn’t an option yet because the new pools I’m using give more H/s and more rewards. Actually, I’m using supportxmr.

You don’t need to register to begin to work with their pools. Simply configure your miner’s applications with the username as your wallet address …. and done. If you want to log in simply send your email as a password in the application and you could log in in supportxmr.

 

XMR-Stak for Ubuntu

XMR-Stak is a project to mine Monero. Firstly, this project, was divided in three different projects; xmr-stak-cpu, xmr-stak-nvidia, xmr-stak-amd. You could choose from one of three (depending on if you want to mine with GPU or CPU). But actually, this project was joined these three applications in only one: xmr-stak.

Ok, let’s go! The process is similar to ethminer but, in this case, without cpulimit. XMR-Stak has processor selection, you can select what processor you want to mine. I will show you. Then, go to install. Project is on GitHub:

Github fireice-uk xmr-stak

Well, login to your server and download and install:

After decompress we need to create configuration files, but xmr-stak can do it by himself, simply execute:

When you execute, xmr-stak, looks for config.txt and cpu.txt. If these files aren’t there program ask you some questions. Currency to mine, URL for pool and some more, I recommend that answer like me, excepting Username that is your monero wallet address and password, that you can write wherever you want. Is important that the password be unique because identify your instance in the pool. I have 3 machines working and the password looks like Workers t in the machine list:

supportxmr mining workers list

Then, Here are three important lines to look for:

  • Configuration stored in file ‘config.txt’
  • CPU configuration stored in file ‘cpu.txt’
  • MEMORY ALLOC FAILED: mmap failed

The two first lines say that config files are saved. Let’s see.

XMR-stak cpu.txt

In cpu.txt is where xmr-stak saves CPU configuration after system testing. Look file:

For a four (4) CPU system, xmr-stak, generates three lines, Total CPU – 1. If you read my other post you know that is important to leave 1 CPU free when mining. For this particular case, I will put only 1 CPU. Because this machine sometimes has tasks to do.

XMR-stak config.txt

this file has some other configs, for me, the important is:

You can configure to some important things like run in daemon, or activate HTTP for show reports via the web. This could be important if you are running the process on a server but is out of the scope of this post.

MEMORY ALLOC FAILED: mmap failed

This is normal, XMR-Stak needs some memory to mine and systems to have limits for only one process.

To solve this problem; open /etc/sysctl.conf and add at the end:

Then open /etc/security/limits.conf and add at the end:

You only need to leave the session and enter again and this value applies, don’t need to reboot. If you have more errors or problems you can go to:

Github fireice-uk xmr-stak

Put XMR-stak to work

Ok, easy, no?

CTRL+a d

And go to work!

XMR-Stak for Windows

When you work with Windows all is different. Simply download from here:

Download Zip Github Xmr-Stak releases

Decompress wherever you want, in some folder and just execute it, xmr-stak ask same questions the ubuntu version:

And begin to mine automatically.

Nothing more, you can disconnect from your Remote Desktop and server continue mining for you.

Don’t forget to adjust CPU number in config.txt to avoid using all CPUs in your server.

Claymore’s CryptoNote Windows CPU Miner v3.5

One of my favourites, and was the first I’ve found to mine with CPU is Claymore’s CryptoNote Windows CPU version. You can download it from here:

github nanopool Claymore-XMR-CPU-Miner releases

Decompress it and you can run with a command like that:

My command is:

But Claymore has an extra cool option. You can specify -low CPU option that increases hash rate if you have a CPU with AES-NI capability.

 

Final Words

Is easy to mine in any system, if you have patience and don’t need a lot of rewards you can easily use not used CPU. There are some more options like ccminer or CPUMiner-multi. You have also Minergate but actually, I don’t recommend that due to their low hash rate and high fee.

This altcoins mining guide is made by a beginner for beginners. The mining process is tedious and does not give wealth, but it helps us to understand the whole process and what is cryptocurrency.

 

1. What is Cryptocurrency?

Cryptocurrency is a currency that has a digital format. Usually, has no legal value. But as the founder of Bitcoin said: the value of a coin is given by the people who use it.

The cryptocurrency, like all currencies, also has its corresponding “ticket”, which would come to be the euro and dollar bills. But unlike the physical ones, the cryptocurrencies, are based on hashes (complex numbers), that would correspond to the currency or ticket.

2. What is mining?

The mining of a coin is based on the random generation of hashes from a formula. The randomly generated hash applies another formula that validates whether the hash corresponds to a coin (the ticket) or not.

I recommend reading the following article, from a guy that explains, in a practical way, how it is done by doing it by HAND. Specifically, it attempts to mine a Bitcoin:
Mining Bitcoin with Pencil and Paper

2.1 Mining Difficulty

There is a parameter inside the coin mining called difficulty. The mining difficulty increases with time as the volume of a coin created is greater. Basically, when mining, the random hashes generation formula tells you that these hashes must be between 2 points, it would be a start and an end. When you just look at two points the distance is exponentially increased and you start again. (I remind you that this are basic definitions and explanations and are only guidance).

At this point, the difficulties of the currencies are high, for that reason the mine is complex because it costs a lot to find currencies since the two points commented, are very far between them.

You can look at this entry in Bitcoin Wikipedia explaining that difficulty is:
Mining Difficulty

2.2 Mining Pool

Mine pools are servers on which many people are mining at the same time based on a position between those two points. When one of the people finds a coin, a reward is distributed on a percentage basis of time used to find it. So if in a Pool we are 3 people and 1 of them has been 5 hours mining and the other 2 have been 2.5 hours each, the percentage to be distributed is 50% for the 5 hours and 25% of the value of the coin to the other 2 people.

 

2.3 Mining Ways

There are two ways to mine. It can be mined with CPU or it can be mined with GPU.
Currently, GPU mining is much powerful, current video cards like the NVIDIA GTX Series allow for high mine power.

Personally, as my interest in mining is based more on knowledge and finally currency speculation, I am not interested in potent mine hardware. Right now I’m mining with Alienware m14x which has 8 CPUs and an NVIDIA GT555M from 3Gb.

This hardware makes:

  • 150kH/s for Ethereum
  • 60 H/s for Monero con CPU
  • 40 H/s for Monero con GPU

I have not been able to mine ETH with GPU on this machine. The reason is that to be able to mine ETH with GPU it takes 4Gb of RAM to store a file called DAG that is generated prior to the process of mining Ethereum.

 

2.4 Considerations

Well, this section is here thinking about people who say that it is not worth putting on mine. Actually, it’s worth, but it’s not worth it. If you do not have powerful Hardware it is not worth it in case you are looking for economic benefits. It’s worth it if you move other ideas. I do it for learning and for having some crypto money in my pocket. I think it is a coin that is there and that at one time or another will be regularized.

 

3. Go to Mine

To start mining you need 2 things, the hardware to mine and the software. We’re supposed to already have Hardware so let’s look at Software and Mining Platforms.

3.1 Nicehash

It is a platform on which you make available your resources and they undermine. They pay you at the end of the month in bitcoins and done. I have not played with this platform but I will not delay.
Nichenash

 

3.2 Minergate

It is the platform we use in EBAVS. If you want to register I will ask you to please enter the affiliation link, THANKS !:
Minergate

Minergate has software that runs on multiple platforms and allows us to mine by CPU or by GPU (The GPU option is not activated if you do not have a supported NVIDIA).

minergate software

 

You just have to register, download the software from its website and you can start mining.
What they do is create pools for joint mining, it is a way of mining and you receive rewards based on the number of mined Hash or efforts.

3.2.1 Minergate Tips

Minergate is not the best platform but the simplest one. In fact, there are users who have complained that it does not count everything it should. I use it for simplicity.

This platform will not let you take out your cryptocurrency if you do not reach a minimum. These minimums according to Hardware are complicated to arrive at. For ETH the minimum is 0.001 or for XMR is 0.1. You have to take into account that you must have something more because they stay a fee (small commission)

 

3.3 What currency should I mine?

Minergate supports a lot of coins, the funny thing is that the most important (except ETH) are not. I mean Bitcoin and ZCash.
The coins it supports are:

* AEON
* BCN – ByteCoin: Not to be confused with BITCOIN, I got confused. It has nothing to do with it.
* DSH – Dashcoin
* ETC – Ethereum Classic
* ETH – Ethereum
* FCN – Fantomcoin
* INF8
* MCN
* QCN
* XDN
* XMR – Monero

After researching a little, look around and there and do mine testing I stayed with ETH and XMR. Over time I was left alone with Monero (XMR). It is the cryptocurrency that more profit is taken out now and in the medium term, you can look for the change to Bitcoin or ETH.

Mining ETH is no longer profitable unless you have the last generation card. It is important that the card has 4Gb of RAM and if the RAM is GDDR5 (I think) better. The requirement of the 4Gb is because when starting to mine ETH creates a DAG (I do not know what it is) and it occupies between 3.5Gb and 3.8Gb and experts say that it is best to leave it in the RAM of the card. Current mining software does not support mines with GPU if you do not have 4GB of RAM.

If you look at the calculator of Minergate, you will see that the best currency to mine is XMR. (Set the H / s to which you create, I put 60H / s which is the minimum I do for Cryptonote).
Crytonote Calculator

I leave a screenshot of the moment in which I write these lines.

 

cryptonote exchange rate

Also, mining ZCash.

 

3.4 Mining Multicoin

There are several currencies that share the hash search formula or coin mint, Cryptonight. This allows that while we are mining one currency, another one can be mined at the same time. The process of mining is still a formula that generates Hashes and another that looks if that hash corresponds to a currency. I understand that in the process of looking at whether it is a coin you can also look at whether it is another. In Minergate we only have to select the extra currency that we want to mine:

multicoin selector

Minergate allows you to make combinations between Monero, FantomCoin and DigitalNote.

I chose FantomCoin. I do not know if it is the best option or not.

 

3.5 CPU management

This is more advice than anything else. When you are mining with CPU do not put them all, leave one free. This makes mine a bit faster and better. The explanation is simple. If you put all the CPUs to mine the operating system and other functions of the PC stop processing. They ask for permission to execute by creating a queue of instructions and inserting the basic tasks of the Operating System. In the end, the whole system becomes saturated and the mine goes much slower. If you leave 1 single CPU the PC will go more fluid and mine too. (Tested in Windows 7 and 8).

3.6 Rewards

Minergate offers two types of reward or Reward in English. PPS and PPLNS:

  • PPS: Pay Per Share: They pay by all your sends. Actually is 1%.
  • PPLNS: Pay Per Last N Shares. This is used for Ethereum. And it is paid at 1.5%. I know that only the last ones sent are used in percentage form.

 

4. Wallets

Wallets are where we keep the mined coin. It’s like the wallet we carry in our pocket. For each different currency, we will have a Wallet.

There are 2 types of Wallet. First, we installed it on our own computers and there we stored the crypto coins that they send us. The second one is Online. Minergate gives us wallets for all coins. At this moment I’m using this last system.

ATTENTION!!!! – DO NOT USE FREEWALLET, seems to be some type of scam as I read in some forum.

4. Wallets

Wallets are where we keep the mined coin. It’s like the wallet we carry in our pocket. For each different currency, we will have a Wallet.

There are 2 types of Wallet. First, we installed it on our own computers and there we stored the crypto coins that they send us. The second one is Online. Minergate gives us wallets for all coins. At this moment I’m using this last system.

Actually, I’m using three (3) different wallets to store my cryptos. Two online and one local. The local wallets have their mirror in blockchain (online too, but I want to talk local because you can delete them) to restore your money in case of an accident. Remember to store your phrase in different places.

ATTENTION!!!! – DO NOT USE FREEWALLET, seems to be some type of scam as I read in some forum.

4.1 Monero Wallet (XMR) (mymonero)

One of the most famous wallets is MyMonero. You can create an account and store your XMR there. You can access it with your browser. It’s important don’t forget your passphrase (a long phrase with 10 to 20 words). If you lose a passphrase you lose your money.

4.2 Ethereum Wallet (ETH)(Metamask)

Metamask is a browser extension that makes a local account when you can store your ETH. Like MyMonero, Metamask will make a long passphrase that you need to save in a safe place. If you lose your password or computer brokes or remove chrome you lose your ETH. With your phrase, you can restore your ETH from the blockchain.

4.3 Bitcoin Wallet (BTC)(Coinbase)

To store Bitcoins I’m using Coinbase. Coinbase is a trader web of cryptocurrency. If you want to register, please, use my referer: Coinbase
For Bitcoin donations: 1FjNpmcnmWxiCWp8cKhEkaSMFNYQwU3fES

5. Taxes

(this only applies to Spain country)

At first, I thought that “hacienda” was kept apart from the cryptocurrency, the total, is unrecognized. Nothing is further from reality. The government recognizes crypto coins as foreign exchange and is subject to the same tax.

Everything explained here (Spanish):

Bolsamania

Summary:
Hacienda understands mining as an immediate benefit and therefore tax from the outset as long as we exceed the minimum income to tax (I think remembering around 3000 € / year). In case exceeding the minimum, we must register for self-employed and declare the benefits by paying the corresponding tax (IRPF).

Spain recognizes Bitcoin and the rest of cryptocurrency like foreign exchange, therefore taxed like if we have an account in Dollars ($).

In the case of buying/selling Crypto coins through any Trader, it should be taxed to finance that will stay between 19% and 23%.

6. Interesting links

Collection of links used in this article:
Nicehash – Mining platform
Minergate – Mining platform
Righto – Mining Bitcoin with pencil and paper
Minergate Calculator – Minergate Calculator
whattomine – To calculate the energy expenditure according to the graphics card you have
My crypto buddy – View earnings for days/months view

 

7. Donations

If you want to donate to us, this is our wallet address:

BTC: 1FjNpmcnmWxiCWp8cKhEkaSMFNYQwU3fES