Bancor Coin/bancorcoind

See bitcoind
See bitcoin/bitcoind for commands as bancorcoind is based off the same code, but with a new generation block.

install
Note: this builds bancorcoind, but not bancorcoind-qt

RHEL
yum install gcc make boost-devel db4-devel
 * 1) RHEL/CentOS 6 Dependencies
 * 1) external: miniupnpc

miniupnpc dependency: mkdir ~/.src ; cd ~/.src wget http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.8.tar.gz -O miniupnpc-1.8.tar.gz tar -zvxf miniupnpc-1.8.tar.gz cd miniupnpc-1.8 make && sudo make install PREFIX=/opt/miniupnpc-1.8
 * 1) make && make install

openssl dependency - fix 9key_error: mkdir ~/.src ; cd ~/.src wget http://www.openssl.org/source/openssl-1.0.1i.tar.gz tar -zvxf openssl-1.0.1i.tar.gz cd openssl-1.0.1i ./config --prefix=/opt/openssl-1.0.1i/ enable-ec enable-ecdh enable-ecdsa shared make clean make && sudo make install
 * 1) export LD_LIBRARY_PATH=/opt/openssl-1.0.1i/lib

fix boost lib: (/usr/bin/ld: cannot find -lboost_thread) ln -s /usr/lib64/libboost_thread-mt.so /usr/lib64/libboost_thread.so

fix libminiupnpc: (./bancorcoind: error while loading shared libraries: libminiupnpc.so.9: cannot open shared object file: No such file or directory) ln -s /usr/lib/libminiupnpc.so.9 /usr/lib64/libminiupnpc.so

make: export OPENSSL_INCLUDE_PATH=/opt/openssl-1.0.1i/include export OPENSSL_LIB_PATH=/opt/openssl-1.0.1i/lib make -f makefile.unix


 * 1) LDFLAGS="-L/opt/openssl-1.0.1i/lib" CFLAGS="-I/opt/openssl-1.0.1i/include" make -f makefile.unix

cat > /etc/ld.so.conf.d/local-openssl.conf << EOF /opt/openssl-1.0.1i/lib EOF ldconfig

Local Non-Root Build:

mkdir ~/bin mkdir ~/lib

export LD_LIBRARY_PATH=~/lib

export OPENSSL_INCLUDE_PATH="/opt/openssl-1.0.1i/include /opt/miniupnpc/usr/include" export OPENSSL_LIB_PATH="/opt/openssl-1.0.1i/lib /opt/miniupnpc/usr/include ~/lib"

ln -s /opt/openssl-1.0.1i/lib/libcrypto.so.1.0.0 ~/lib/libcrypto.so.1.0.0 ln -s /opt/openssl-1.0.1i/lib/libssl.so.1.0.0 ~/lib/libssl.so.1.0.0 ln -s /opt/miniupnpc/usr/lib/libminiupnpc.so.9 ~/lib/libminiupnpc.so.9 ln -s /usr/lib64/libboost_thread-mt.so ~/lib/libboost_thread.so # not required for final binary

cp ~/.src/bancorcoin/src/bancorcoind ~/bin ln -s ~/bin/bancorcoind ~/bin/b

ldd ~/bin/bancorcoind

---

Error: EXCEPTION: 9key_error CKey::CKey : EC_KEY_new_by_curve_name failed bancorcoin in AppInit

$ /usr/bin/openssl version OpenSSL 1.0.1e-fips 11 Feb 2013

$ /opt/openssl-1.0.1i/bin/openssl version OpenSSL 1.0.1i 6 Aug 2014

Ubuntu
apt-get install ... TODO ...
 * 1) Ubuntu Dependencies

Common
Build source: mkdir ~/.src ; cd ~/.src wget http://bancorcoin.net/downloads/bancorcoin-src.tar.gz tar -zvxf bancorcoin-src.tar.gz cd bancorcoin cd src chmod u+x leveldb/build_detect_platform # fix permission from tar file make -f makefile.unix clean make -f makefile.unix

cp bancorcoind /usr/local/bin ln -s bancorcoind /usr/local/bin/b # convenience, could also use "alias b=bancorcoind"

References:
 * HOWTO: Compile and Install litecoind on CentOS 6.4 (centos 6.2 and centos 6.3 are the same) | Sto - http://iamsto.wordpress.com/2014/01/08/howto-compile-and-install-litecoind-on-centos/

Config
$ bancorcoind   # creates folder structure $ cat >> ~/.bancorcoin/bancorcoin.conf << EOF daemon=1 rpcuser=bancorcoin rpcpassword=password123 addnode=bancorcoin.net


 * 1) rpcallowip=x.x.x.x  # needed for remote mining

EOF
 * 1) server=1
 * 2) listen=1
 * 3) rpcallowip=*
 * 4) rpcconnect=*
 * 5) rpcport=9335
 * 6) port=9336

sync status
BANCORCOIN_SYNC_CURRENT=`bancorcoind getblockcount` BANCORCOIN_SYNC_TOTAL=`curl http://bancorcoin.net/count/ 2>/dev/null` BANCORCOIN_SYNC_TOTAL=$(( $BANCORCOIN_SYNC_TOTAL / 128 )) BANCORCOIN_SYNC_PERCENT=$(( BANCORCOIN_SYNC_CURRENT * 100 / BANCORCOIN_SYNC_TOTAL )) echo "Sync status: ${BANCORCOIN_SYNC_PERCENT}% (${BANCORCOIN_SYNC_CURRENT}/${BANCORCOIN_SYNC_TOTAL})"
 * 1) !/bin/bash
 * 2) bancorcoin-sync-status
 * 1) alt: BANCORCOIN_SYNC_TOTAL=`curl http://bancorcoin.net/block/chain/Bancorcoin/q/getblockcount 2>/dev/null`