Bitcoin Forum
July 06, 2022, 06:26:48 AM *
News: Latest Bitcoin Core release: 23.0 [Torrent]
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Alternate cryptocurrencies / Altcoin Discussion / [XPM] Primecoin High Performance Linux Compilation Guide on: July 19, 2013, 02:50:16 PM
Here are some Linux compiling instructions for my high performance version of Primecoin. There are plenty of other guides out there but none of them seem to address all the issues. Now I'm writing my own guide. This should be the definitive guide on how to compile Primecoin on Linux. Commands need to be entered exactly as they appear, so copy and pasting is recommended.

Link to the main high performance thread:

Another guide written by eCoinomist is available here:

Please note that if you are new to Linux, it's best to stick with one guide. Mixing the instructions from different guides may produce errors later.

Tested with the following Linux distributions:
 - Ubuntu 13.04
 - CentOS 6.4

Step 1. Installing the required dependencies

Using apt-get with latest Ubuntu 13.04:
sudo apt-get install -y build-essential m4 libssl-dev libdb++-dev libboost-all-dev libminiupnpc-dev

The 'sudo' command requires you to type the password for the current user. If you don't have sudo working, you need to manually switch to root with 'su' before running those commands.

Warning: If you have installed a specific version such as libdb5.3++-dev before, then don't install the meta-package libdb++-dev which may pull a different version.

Alternative for CentOS users:
su -c 'yum install gcc-c++ m4 openssl-devel db4-devel boost-devel'

Step 2. Compiling GMP

Latest version supports all the new CPUs.

rm -rf gmp-5.1.2.tar.bz2 gmp-5.1.2
tar xjvf gmp-5.1.2.tar.bz2
cd gmp-5.1.2
./configure --enable-cxx
sudo make install

The configure script will attempt to automatically detect the host CPU and enable the best optimizations for it.

Step 2b. Compiling OpenSSL (for CentOS and Fedora users)

This step is only required if you're using CentOS. Red Hat has removed support for elliptic curve cryptography from the OpenSSL it supplies.

rm -rf openssl-1.0.1e.tar.gz openssl-1.0.1e
tar xzvf openssl-1.0.1e.tar.gz
cd openssl-1.0.1e
./config shared --prefix=/usr/local --libdir=lib
sudo make install

Step 2c. Compiling miniupnpc (for CentOS users)

rm -rf miniupnpc-1.6.20120509.tar.gz
tar xzvf miniupnpc-1.6.20120509.tar.gz
cd miniupnpc-1.6.20120509
sudo INSTALLPREFIX=/usr/local make install

Step 3. Compiling primecoind

rm -rf primecoin-0.1.2-hp12.tar.bz2 primecoin-0.1.2-hp12
wget -O primecoin-0.1.2-hp12.tar.bz2
tar xjvf primecoin-0.1.2-hp12.tar.bz2
cd primecoin-0.1.2-hp12/src
cp makefile.unix
sed -i -e 's/$(OPENSSL_INCLUDE_PATH))/$(OPENSSL_INCLUDE_PATH) \/usr\/local\/include)/'
sed -i -e 's/$(OPENSSL_LIB_PATH))/$(OPENSSL_LIB_PATH) \/usr\/local\/lib)/'
sed -i -e 's/$(LDHARDENING) $(LDFLAGS)/$(LDHARDENING) -Wl,-rpath,\/usr\/local\/lib $(LDFLAGS)/'
make -f
strip primecoind
sudo cp -f primecoind /usr/local/bin/

The last line will install the primecoind binary to /usr/local/bin.

CentOS users: Use the following 'make' command instead:
make -f BOOST_LIB_SUFFIX=-mt

Step 4. Configuration

Create a configuration file:

mkdir -p .primecoin
echo 'server=1
sievesize=1000000' > .primecoin/primecoin.conf
sed -i -e "s/SOME_SECURE_PASSWORD/`< /dev/urandom tr -cd '[:alnum:]' | head -c32`/" .primecoin/primecoin.conf

You may optinally customize the configuration file. The last line puts a random password in the configuration file automatically, so you don't need to change anything if you're only sending RPC commands from localhost.

Type these commands to create an auto-restart script:

echo '#!/bin/bash
export PATH="/usr/local/bin:$PATH"
killall --older-than 10s -q run-primecoind primecoind
function background_loop
        while :; do
                primecoind >/dev/null 2>&1
                sleep 1
background_loop &' > run-primecoind
chmod +x run-primecoind

CentOS users may want to remove the 'killall' command from this script because the version that comes with CentOS does not support the --older-than option.

And for convenience, create a stopping script:

echo '#!/bin/bash
killall -q run-primecoind
primecoind stop' > stop-primecoind
chmod +x stop-primecoind

Step 5. Starting mining

Simply type the following to start mining:

It will take a while for it to sync up with the network. The script will continue running in the background, automatically restarting primecoind if it crashes.

Step 6. Monitoring the progress

Checking that the primecoind process is runnning:
ps xuf |grep primecoind

RPC commands can be sent to the daemon like this:
primecoind getprimespersec
primecoind listtransactions
primecoind getinfo
primecoind getmininginfo
primecoind getdifficulty

Any combination of these can be used with the 'watch' command like this:
watch 'primecoind getinfo && primecoind listtransactions'

Press Ctrl + C to terminate the watch command.

You can also look at the output in debug.log:
grep primemeter ~/.primecoin/debug.log

If you want to see those in real-time, try this:
tail -f ~/.primecoin/debug.log |grep primemeter

Step 7. Stopping mining

Run the stop script:
2  Alternate cryptocurrencies / Announcements (Altcoins) / [XPM] [ANN] Primecoin High Performance | HP14 released! on: July 13, 2013, 10:36:06 PM
This is Primecoin High Performance, a Primecoin wallet with high-performance CPU miner built-in. Only solo mining is supported. For pooled mining, see The main Primecoin thread is here.

Notice: CPU mining is no longer profitable. If you have a recent AMD GPU, you can try the following miners:
Open Source XPM Pool + GPU Miner (aka. madPrimeMiner) (with updates by eXtremal)
Claymore XPM (PrimeCoin) GPU Miner

 * Extended sieve algorithm
 * Cache-friendly segmented sieve
 * Adjustable sieve parameters
 * Mining threads use GMP for faster bignum arithmetic

Recent changes:
Changes in -hp14 (ann):
 * Huge CPU mining speedup. Up to 73% higher chains/day on Intel's Haswell.
 * Developer fee is now 1% (-donationpercentage defaults to 1.0).
 * Sieve now uses the BTS instruction (same as RapidPrime miner).
 * Added compile-time support for using BMI2 instructions on Haswell.
 * Added compile-time support for SSE2 and AVX2 bitwise operations.
 * New extended sieve algorithm similar to rdebourbon's beta4 code.
 * New default values for the tuning parameters:
   . sievefilterprimes defaults to 14000 (up from 7849)
   . sievesize defaults to 1376256 (up from 917504)
   . sieveextensions defaults to 10 (up from 9)
 * Lots of other minor improvements.

Changes in -hp13 (ann):
 * Binaries compiled with OpenSSL 1.0.1g which addresses the Heartbleed vulnerability
 * Faster blockchain download

Changes in -hp12 (ann):
 * IMPORTANT: Fix for multiple machines doing the same work if wallet is shared.
 * New chain statistics in debug.log.
 * Removed 'primespersec' from the output of getmininginfo.
 * Removed 'chainspermin' metric.
 * Replaced -sievepercentage parameter with -sievefilterprimes.
 * New parameter -l1cachesize for specifying the size of sieve segments.
 * Added new blocks/day metric which tries to estimate how many blocks will be found at current difficulty.
 * Better automatic adjustment of primorial factor.
 * New parameter -primorial for manual adjustment of primorial.
 * Implemented early support for v0.2 proposal (needs to be enabled with -miningprotocol=2).
 * David's fix for getwork.
 * Updated to Bitcoin v0.8.6 codebase.
 * Improved the checking of BiTwin chain candidates. As a consequence, short BiTwin chains (1 or 2 primes) are now counted correctly in the mining statistics. Primes/h is now much higher due to this.
 * The Qt application is now titled Primecoin High Performance.
 * Fixes for Mac OS X and the Clang compiler.
 * Revised default sieve parameters.
 * Added an automatic donation feature when a new block is found. The -donationpercentage allows a percentage of the block reward to be donated to an address. E.g. passing the command-line parameter -donationpercentage=1.5 will donate 1.5% of every block to the developer. Alternatively, this value can be set in primecoin.conf. Also, the default address can be changed using -donationaddress.

Changes in -hp11: (ann)
 * Fixed a bug in the BiTwin filter that was inflating the chains/day estimate and reducing the chances of finding a block (thanks to rdebourbon).
 * Slightly improved the accuracy of the prime probability estimate with regards to the 'sieveextensions' parameter.
 * Changed the default value of 'sieveextensions' to 9.
 * Other small fixes and improvements from cabin.

Changes in -hp10: (ann)
 * Major rewrite of the sieve to support extending the sieve (originally implemented by jh000).
 * Added a new parameter 'sieveextensions' which controls how many times the sieve is extended.
 * Removed the problematic and unnecessary fast-division test.
 * Changed the value of nL1CacheElements to 224000 which is slightly faster (thanks to nushor on IRC).
 * The 'roundsievepercentage' parameter is gone. The round primorial is now automatically adjusted.
 * New RPC command 'listtopprimes' by Sunny.

Windows x64 binaries
SHA1SUM: 2610f99d0087bc799050fcbe02482e556df19ae1

Windows x86 binaries
SHA1SUM: d205da20b41d9eebe9c415144efe13a7efa652b5

Linux x64 and x86 binaries
SHA1SUM: 254087afc81dc054f48e7b1db1957c6cd2dabea6

Mac OS X binaries
SHA1SUM: 240af66fbf07d3a0b85c386a62faefe8d6afc592

Warning to Linux users: My binaries are linked against Berkeley DB 4.8.30. If you have compiled from source before, the database format may be incompatible if you linked against a different version of Berkeley DB. Sunny King's original binaries are linked against Berkeley DB 4.8.24, which should be compatible with my version. Always make sure to backup the database and your wallet before switching builds.

Source code (.tar.bz2)
SHA1SUM: ea772deda9d3a1d3ced99ba5858ec888d869667c

Source code (Git)

Please use the SourceForge link for downloading the source code to ease the load on the repository.

Older releases are stored on SourceForge:


[Tutorial] Primecoin Getting Started and Basic Commands
**Quick Guide!** - How to mine Primecoin
[XPM] Primecoin High Performance Linux Compilation Guide


Sample config file for automatic mining:
# Enable JSON-RPC commands to be received

# Username and password for JSON-RPC

# IP restriction for JSON-RPC

# Start mining automatically

# An extra seednode to help getting connected to the network

# Tuning parameters

# Donate 1% of found blocks by uncommenting the following line

Save the file as primecoin.conf in %APPDATA%\Primecoin (for Windows users), $HOME/.primecoin (for Linux users), or $HOME/Library/Application Support/Primecoin (for Mac OS X users).


Q: How many blocks should I expect to find?
A: My current formula for turning chains/day into blocks/day is as follows:
blocks/day = chains/day * (0.97 * (1 - fracDiff) + 0.03)
Here fracDiff is the fractional part of the mining difficulty (i.e. fracDiff = diff - floor(diff)). The 'getmininginfo' command will show both the chains/day value and the difficulty.

Q: Is this compatible with the original client? Can I replace primecoin-qt/primecoind with this release?
A: Yes, the Windows builds should be compatible with the original client. It uses Berkeley DB version 4.8 so the database format should be the same.

Q: Why is the client crashing with the following message?
Assertion failed!
File: src/checkqueue.h, line 171
Expression: pqueue->nTotal == pqueue-> nIdle
A: This is a known bug which is present both in this version and the original Primecoin wallet. A workaround is to use a script or a cron job to automatically restart the wallet.

Q: How can I fix the client crashing on every startup?
A: Try deleting all database files except wallet.dat.

Q: Where is the config file located?
A: Windows users: The configuration file should be located in the %APPDATA%\Primecoin folder.
Linux users: The configuration file is located in your $HOME/.primecoin folder.
Mac OS X users: The configuration file is located in your $HOME/Library/Application Support/Primecoin folder.
The configuration file is not created by default. If it does not exist, simply create a new text file and save it as primecoin.conf.

Q: What are the optimal sieve parameters?
A: The default values should be good for most people. If you want to further optimize them, adjust them one-by-one and compare chains/day.

Q: Why is my performance worse on Linux?
A: This version relies on libgmp to do most of the complex calculations. Make sure your libgmp is up-to-date. Old versions do not support newer CPUs. I suggest compiling your own libgmp from latest source code for maximum performance.

Q: Why has my prime rate dropped after updating?
A: There are two common cases why primes/s can drop:
1. You downloaded the 32-bit version which is slower. Use the 64-bit version if possible.
2. Network difficulty has changed. Prime rate goes down when the integer part of the difficulty changes (i.e. going from 8.xx to 9.xx). It's a feature of the mining algorithm and nothing can be done about it.
Otherwise please make a post wiith system information (especially CPU model), operating system version and miner version.

Q: What is the chains/day estimate?
A: Short version:
Longer version:

Q: How do I solve a problem with the client not being able to synchronize or connect to any nodes?
A: Try adding this line to your primecoin.conf file:

Also check that your firewall allows outgoing connections to other nodes. You may also allow incoming connections if you want. The default port used by Primecoin is 9911 (TCP).
3  Alternate cryptocurrencies / Altcoin Discussion / [ANN][YBC] Ybcminer GPU miner for Ybcoin on: July 03, 2013, 08:01:58 PM
By popular demand, here is a GPU miner for Ybcoin, a Chinese clone of Yacoin. This is a copy of my Yacminer that supports the different launch date of Ybcoin. I'm not going to support this miner. It may get updated as an afterthought.

Ybcoin English announcement thread

My Yacminer is here:

Sample settings for 7790:
--scrypt -w 128 --lookup-gap 2 -I 20 --thread-concurrency 8000 -g 1
Hash rate is 1.092 Mh/s with N = 32. I also recommend setting -s 1 because block times may get pretty fast.

Windows x64 version!A5sBWSxS!NXD1lV3VXShb5qptZdRcWQ3kxzh0HhA4XX0mmXaEw9E

Windows x86 version!pp1BQRCS!bjzee1Ith5A904Miczc9qmlQvTpLMUE_BNUg1HdfugA

Source code (.tar.xz)!B9VAFDpR!PqCudWcxMggO2SxMmXnNPnmGwA8cQFMLYySgp6gA_fw

Source code (.tar.bz2)!ptFmiR5K!BmnvcxKdE1VXGpE6xj3cOBNR3m9xj2Z4TkXPbd2qzFU

Ybcoin donations can be sent to YQDziKgPKkoWnnrRS8wqxUF9yisRq1bMmS
4  Alternate cryptocurrencies / Mining (Altcoins) / [ANN][YAC] Yacminer GPU miner for Yacoin on: July 01, 2013, 04:31:57 PM
This is a modified version of cgminer that supports mining Yacoins. This release includes my latest OpenCL scrypt-chacha kernel (v7) and a fix for share difficulty calculation. No more spam about blocks being found all the time.

Original version by hanzac

 - Faster OpenCL kernel
 - Fixed share difficulty calculation
 - Rebased off of cgminer 3.3.1

Changes in -yac2:
 - Fixed network errors caused by too many sockets when pool supports long polling

Good sample settings for a 7790 (with N = 2048):
yacminer --scrypt -w 128 --lookup-gap 2 -I 17 --thread-concurrency 8000 -g 1 -o -u username -p password

Parameters work similarly as in normal scrypt mining except that more memory is needed depending on the N parameter currently used by the network. Try to find a maximal value for thread concurrency. Set worksize (-w) to 256 for HD 7000 series and 64 for older cards. Experiment with different values for lookup gap if you have your card has lots of cores. Increase intensity until you start seeing HW errors.

More settings have also been posted in the old thread.


Windows x64 version!B10C3TZT!M6ZLMwG-QHKSJxVPMnWHb2A171la6qFpsOuNfSrhGyI

Windows x86 version!twsQwbaB!X8zL0wqsfGeO-ujuFZx62D6PmHY4D9HT82-qJ0McYME

Source code (.tar.xz)!Ip9CVICS!UJ7dRj9qdV2aAVtcEWFgj06YIlEWHgOMg0g0F1R2IWM

Source code (.tar.bz2)!p8VhxLRS!V-xBLn_IJgMh1RlZZWYppRrjhbh6ax1Wbzlljnba6Nw

Linux compilation
tar xJvf yacminer-3.3.1-yac2.tar.xz
cd yacminer-3.3.1-yac2
CFLAGS="-march=native -O2 -pipe" ./configure --enable-scrypt
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!