Bitcoin Forum
September 22, 2018, 02:31:12 AM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
  Home Help Search Donate Login Register  
  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:
https://bitcointalk.org/index.php?topic=255782.0

Another guide written by eCoinomist is available here:
http://ecoinomist.com/xpm-primecoin-mining-guide-on-linux

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:
Code:
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:
Code:
su -c 'yum install gcc-c++ m4 openssl-devel db4-devel boost-devel'

Step 2. Compiling GMP

Latest version supports all the new CPUs.

Code:
cd
rm -rf gmp-5.1.2.tar.bz2 gmp-5.1.2
wget http://mirrors.kernel.org/gnu/gmp/gmp-5.1.2.tar.bz2
tar xjvf gmp-5.1.2.tar.bz2
cd gmp-5.1.2
./configure --enable-cxx
make
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.

Code:
cd
rm -rf openssl-1.0.1e.tar.gz openssl-1.0.1e
wget ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/openssl-1.0.1e.tar.gz
tar xzvf openssl-1.0.1e.tar.gz
cd openssl-1.0.1e
./config shared --prefix=/usr/local --libdir=lib
make
sudo make install

Step 2c. Compiling miniupnpc (for CentOS users)

Code:
cd
rm -rf miniupnpc-1.6.20120509.tar.gz
wget http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.6.20120509.tar.gz
tar xzvf miniupnpc-1.6.20120509.tar.gz
cd miniupnpc-1.6.20120509
make
sudo INSTALLPREFIX=/usr/local make install

Step 3. Compiling primecoind

Code:
cd
rm -rf primecoin-0.1.2-hp12.tar.bz2 primecoin-0.1.2-hp12
wget http://sourceforge.net/projects/primecoin-hp/files/0.1.2-hp12/primecoin-0.1.2-hp12.tar.bz2/download -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 makefile.my
sed -i -e 's/$(OPENSSL_INCLUDE_PATH))/$(OPENSSL_INCLUDE_PATH) \/usr\/local\/include)/' makefile.my
sed -i -e 's/$(OPENSSL_LIB_PATH))/$(OPENSSL_LIB_PATH) \/usr\/local\/lib)/' makefile.my
sed -i -e 's/$(LDHARDENING) $(LDFLAGS)/$(LDHARDENING) -Wl,-rpath,\/usr\/local\/lib $(LDFLAGS)/' makefile.my
make -f makefile.my
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:
Code:
make -f makefile.my BOOST_LIB_SUFFIX=-mt

Step 4. Configuration

Create a configuration file:

Code:
cd
mkdir -p .primecoin
echo 'server=1
gen=1
rpcallowip=127.0.0.1
rpcuser=primecoinrpc
rpcpassword=SOME_SECURE_PASSWORD
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:

Code:
cd
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
        done
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:

Code:
cd
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:
Code:
./run-primecoind

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:
Code:
ps xuf |grep primecoind

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

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

Press Ctrl + C to terminate the watch command.

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

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

Step 7. Stopping mining

Run the stop script:
Code:
./stop-primecoind
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 beeeeer.org. 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

Features:
 * 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
http://sourceforge.net/projects/primecoin-hp/files/0.1.2-hp14/primecoin-0.1.2-hp14-winx64.zip/download
http://download.muuttuja.org/primecoin/primecoin-hp/0.1.2_hp14/primecoin-0.1.2-hp14-winx64.zip
SHA1SUM: 2610f99d0087bc799050fcbe02482e556df19ae1

Windows x86 binaries
http://sourceforge.net/projects/primecoin-hp/files/0.1.2-hp14/primecoin-0.1.2-hp14-winx86.zip/download
http://download.muuttuja.org/primecoin/primecoin-hp/0.1.2_hp14/primecoin-0.1.2-hp14-winx86.zip
SHA1SUM: d205da20b41d9eebe9c415144efe13a7efa652b5

Linux x64 and x86 binaries
http://sourceforge.net/projects/primecoin-hp/files/0.1.2-hp14/primecoin-0.1.2-hp14-linux.tar.bz2/download
http://download.muuttuja.org/primecoin/primecoin-hp/0.1.2_hp14/primecoin-0.1.2-hp14-linux.tar.bz2
SHA1SUM: 254087afc81dc054f48e7b1db1957c6cd2dabea6

Mac OS X binaries
http://sourceforge.net/projects/primecoin-hp/files/0.1.2-hp14/Primecoin-HP-Qt-0.1.2-hp14.dmg/download
http://download.muuttuja.org/primecoin/primecoin-hp/0.1.2_hp14/Primecoin-HP-Qt-0.1.2-hp14.dmg
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)
http://sourceforge.net/projects/primecoin-hp/files/0.1.2-hp14/primecoin-0.1.2-hp14.tar.bz2/download
http://download.muuttuja.org/primecoin/primecoin-hp/0.1.2_hp14/primecoin-0.1.2-hp14.tar.bz2
SHA1SUM: ea772deda9d3a1d3ced99ba5858ec888d869667c

Source code (Git)
https://bitbucket.org/mikaelh/primecoin-hp
https://github.com/mikaelh2/primecoin

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

Older releases are stored on SourceForge:
https://sourceforge.net/projects/primecoin-hp/files/

Tutorials

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

Configuration

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

# Username and password for JSON-RPC
rpcuser=primecoinrpc
rpcpassword=PASSWORD

# IP restriction for JSON-RPC
rpcallowip=127.0.0.1

# Start mining automatically
gen=1

# An extra seednode to help getting connected to the network
seednode=primeseed.muuttuja.org

# Tuning parameters
#sievesize=1376256
#sievefilterprimes=14000
#sieveextensions=10

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

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).

FAQ

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: https://bitcointalk.org/index.php?topic=255782.msg2847844#msg2847844
Longer version: https://bitcointalk.org/index.php?topic=255782.msg2848092#msg2848092

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:
Code:
seednode=primeseed.muuttuja.org

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
https://bitcointalk.org/index.php?topic=243046.0

My Yacminer is here:
https://bitcointalk.org/index.php?topic=247782.0

Usage:
Sample settings for 7790:
Code:
--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
https://mega.co.nz/#!A5sBWSxS!NXD1lV3VXShb5qptZdRcWQ3kxzh0HhA4XX0mmXaEw9E
http://download.muuttuja.org/yacoin/ybcoin/ybcminer/3.3.1-yac2/ybcminer-3.3.1-yac2-windows-x64.zip

Windows x86 version
https://mega.co.nz/#!pp1BQRCS!bjzee1Ith5A904Miczc9qmlQvTpLMUE_BNUg1HdfugA
http://download.muuttuja.org/yacoin/ybcoin/ybcminer/3.3.1-yac2/ybcminer-3.3.1-yac2-windows-x86.zip

Source code (.tar.xz)
https://mega.co.nz/#!B9VAFDpR!PqCudWcxMggO2SxMmXnNPnmGwA8cQFMLYySgp6gA_fw
http://download.muuttuja.org/yacoin/ybcoin/ybcminer/3.3.1-yac2/ybcminer-3.3.1-yac2.tar.xz

Source code (.tar.bz2)
https://mega.co.nz/#!ptFmiR5K!BmnvcxKdE1VXGpE6xj3cOBNR3m9xj2Z4TkXPbd2qzFU
http://download.muuttuja.org/yacoin/ybcoin/ybcminer/3.3.1-yac2/ybcminer-3.3.1-yac2.tar.bz2

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
https://bitcointalk.org/index.php?topic=232241.0

Changes:
 - 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

Usage:
Good sample settings for a 7790 (with N = 2048):
Code:
yacminer --scrypt -w 128 --lookup-gap 2 -I 17 --thread-concurrency 8000 -g 1 -o http://mining.pool.net:8706 -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.

Downloads

Windows x64 version
https://mega.co.nz/#!B10C3TZT!M6ZLMwG-QHKSJxVPMnWHb2A171la6qFpsOuNfSrhGyI
http://download.muuttuja.org/yacoin/yacminer/3.3.1-yac2/yacminer-3.3.1-yac2-windows-x64.zip

Windows x86 version
https://mega.co.nz/#!twsQwbaB!X8zL0wqsfGeO-ujuFZx62D6PmHY4D9HT82-qJ0McYME
http://download.muuttuja.org/yacoin/yacminer/3.3.1-yac2/yacminer-3.3.1-yac2-windows-x86.zip

Source code (.tar.xz)
https://mega.co.nz/#!Ip9CVICS!UJ7dRj9qdV2aAVtcEWFgj06YIlEWHgOMg0g0F1R2IWM
http://download.muuttuja.org/yacoin/yacminer/3.3.1-yac2/yacminer-3.3.1-yac2.tar.xz

Source code (.tar.bz2)
https://mega.co.nz/#!p8VhxLRS!V-xBLn_IJgMh1RlZZWYppRrjhbh6ax1Wbzlljnba6Nw
http://download.muuttuja.org/yacoin/yacminer/3.3.1-yac2/yacminer-3.3.1-yac2.tar.bz2

Linux compilation
Code:
wget http://download.muuttuja.org/yacoin/yacminer/3.3.1-yac2/yacminer-3.3.1-yac2.tar.xz
tar xJvf yacminer-3.3.1-yac2.tar.xz
cd yacminer-3.3.1-yac2
CFLAGS="-march=native -O2 -pipe" ./configure --enable-scrypt
make
Pages: [1]
Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!