Following on from some recent research into Cryptocurrencies, I’ve been looking at the somewhat unique Huntercoin. It claims to be a so-called “human mine-able” cryptocurrency.
I’m not so much interested at the moment in actually playing what I presume is some kind of online game for mining the coins, as I see there is a core peer-to-peer client that can run on Linux, and I presume is a fork of Bitcoin anyway.
As with many of these emerging altcoin projects, this one too has a very sketchy compile guide, and since my preferred OS is Ubuntu 16.04 LTS Server 64-bit there’s unlikely to be anything else as up to date as what I’m about to leave right here.
I’m starting with a fresh Ubuntu 16.04 Server running on VMWare hypervisor, in my case a standard 2 x CPU, 2048 Gb RAM, 48 GB HDD spec machine.
Whatever hardware you choose is up to you, if you just run the huntercoind just to keep a full copy of the blockchain and maybe even do some transactions, you’ll get by with any old machine.
I’m not doing any mining here, so I don’t have any advice for running GPU’s or anything like that.
Anyway, my new Ubuntu server is just a straight default install with only OpenSSH added to begin with, and set a static IP address because I’ll be port forwarding from my firewall later, and I do the usual updating things like:
sudo apt-get update && sudo apt-get -y upgrade && sudo reboot
Now to get started…
Step 1. Install required libraries
While getting Huntercoin up and running for the first time, I made careful note of all the required libraries you’ll need for a successful build – here they are:
sudo apt-get install build-essential libssl-dev libboost-all-dev
And there are a couple more, this next one took me a while to find for Ubuntu 16.04 when I kept getting this compile time error:
/usr/bin/ld: cannot find -lgthread-2.0
collect2: error: ld returned 1 exit status
Makefile:118: recipe for target ‘huntercoind’ failed
make: *** [huntercoind] Error 1
This error had me searching high and low for ‘gthread’ and ‘libg’ and all sorts of things, and even ‘libqt4-dev’ (but I hate installing that one because of all the X11 dependencies) until I found this:
sudo apt-get install libglib2.0-dev
This next one is also required, “libdb” which is actually the Berkeley DB library. When compiling bitcoin-core and other forks of bitcoin this one can be a problem and you need to use the older 4.8 version – but installing this one (which is 5.3 in Ubuntu 16.04) appears to work just fine. It you are wanting to move any *.dat files between systems though, this might be an issue (I explain more about this in my Namecoin build).
sudo apt-get install libdb++-dev
Step 2. Download the huntercoin source
Now it’s time to fetch (or should I say clone) the latest source from the Github repository.
cd ~ git clone https://github.com/chronokings/huntercoin.git
Because I’m using a dedicated machine only for Huntercoin in this case, I’m not going to bother moving the source to somewhere like /usr/src or /usr/local/src as I know some people like to do. It just sits in my home folder on this server.
You should end up with something like this. In the /src folder is where we’ll be building.
Step 3. Compiling huntercoind
You’ve done all the groundwork, now it’s time to build!
cd ~/huntercoin/src make
That’s pretty much it, there is not “make install” like you might expect, so to make the shiny new huntercoind binary (mine was version 1.3.01) available I did this.
sudo ln -s ~/huntercoin/src/huntercoind /usr/local/bin/huntercoind
Step 4. Test huntercoind
You should now be able to start the huntercoind in daemon mode with:
Unlike some other crypto core clients, this one doesn’t seem to mind running without any configuration file at all, and it will happily start up.
You can check the progess of what it’s doing with:
tail -f ~/.huntercoin/debug.log
(Use Ctrl+C to exit it)
Feel free to have a look at some of the other commands you can issue.
Once it has created the .huntercoin file in your home directory, I would recommend stopping it gracefully and downloading the blockchain in advance to same some time.
Step 4. Download blockchain (optional)
Your hundercoind core client is going to take a while once you fire it up as it begins to ask the peer-to-peer network for all the blocks in the blockchain. This process can literally take days.
My up and running Huntercoin client has around 12 GB of blockchain data in the ~/.huntercoin/ folder to give you some idea. Letting your huntercoind client retrieve this in many individual P2P requests is inefficient (but arguably more failsafe from a security point of view if you’re really paranoid).
So, if you want to shortcut this process you can download an archive of the blockchain database in advance from here: http://chain.huntercoin.org/
I can’t speak for the legitimacy of it, so make sure you follow the instructions and check the SHA256 hashes that have also been signed with a PGP key.
Once you have downloaded the zip file, simply unzip all the files into your .huntercoin folder and overwrite any other files.
Step 5. Port forward at your Firewall
If you’re doing this from a standard home gateway/router chances are this has been taken care of via the UPNP protocol, but if not you’ll need to port-forward TCP externally on Port 8398 to the internal IP of your Huntercoin box.
I’ll leave you with the rest, feel free to comment below. Happy Hunting. Or something.