码迷,mamicode.com
首页 > 其他好文 > 详细

dogecoind在CentOS安装参考

时间:2014-05-13 07:27:06      阅读:542      评论:0      收藏:0      [点我收藏+]

标签:des   style   class   code   c   tar   

Compiling dogecoind on CentOS

There seems to be some collective difficulty installing altcoin programs on CentOS. This shouldn‘t come as a surprise to anybody who has used CentOS on even a semi-regular basis. Compiling from source can be frustrating in its own right, but doing so on Cent can often lead to experiencing new levels of Bij!

Dogecoin (?) is but one of the many open-source cryptocurrencies that have cropped up in this new era of electronic money. Doge is a fork of LiteCoin (arguably the second most traded cryptocurrency presently) and isscrypt based instead of beingsha based like Bitcoin. You may ask yourself... "Ok, but what does this all mean?" The high-level meaning is you can still actually mine Dogecoin with your CPU or Graphics Card. You don‘t have to go out and get a specialized mining asic to have a shot at mining your own doggy coins.

If you are still confused, I recommend watching the video below. It is very informative and will tell you everything you need to know about ?oge.

Or maybe reading the Wikipedia entry and the dogecoin site.

Now, without further delay... to the moon!

Headless Dogecoind on CentOS 6.5 x86_64

Dogecoind is the daemon program for Dogecoin. The daemon allows you to interact with the dogecoin blockchain to do many different things like create a wallet, send and receive ? and even mine for new coins. The daemon usually comes in two different, but functionally identical, forms; a headless interface known as dogecoind and a graphical interface commonly referred to asdogecoin-qt. This guide will cover installing the headless version system-wide.

Dependencies

I always recommend ensuring your existing packages are up to date before installing anything new. You can install available updates withyum. If there are no updates available theupdate will inform you of such and do nothing.

yum update

Now we will install the some of the dependencies required that do not need to be compiled from source.

yum install git automake gcc gcc-c++ make curl-devel zlib-devel bzip2-devel python-devel wget

echo ‘/usr/local/lib‘ > /etc/ld.so.conf.d/usr_local_lib.conf && /sbin/ldconfig
echo ‘/usr/local/lib64‘ > /etc/ld.so.conf.d/usr_local_lib64.conf && /sbin/ldconfig

OpenSSL

The current version of OpenSSL in CentOS is 1.0.1e. This is actually pretty good for CentOS. It is only one release behind at the time of writing this. Unfortunately this versionwill not work with dogecoind. This is due to required components being excluded upstream with RedHat due to potential IP concerns. This crippled version of OpenSSL is the bane of many people trying to install many different modern programs on RHEL-Based distributions (such as CentOS). You can read all about it in thisbugzillaentry and the entries referenced within it. The version that comes with CentOS supports only two curves. The version that we are building from source supports 73.

Not caring about anything other than rolling in the ?oge; we will install the current version, in all its full-flavored glory, concurrently with the system version.

cd /usr/local/src
wget -qO- http://www.openssl.org/source/openssl-1.0.1f.tar.gz | tar xzv
cd openssl-1.0.1f
./config shared --prefix=/usr/local --openssldir=/usr/local/ssl
make && make install

Boost

Boost is a collection of C++ libraries.

cd /usr/local/src
wget -qO- http://downloads.sourceforge.net/boost/boost_1_55_0.tar.bz2 | tar xjv
cd boost_1_55_0/
./bootstrap.sh --prefix=/usr/local
./b2 install --with=all

BerkeleyDB

BerkeleyDB is a library that provides high-performance database functionality.

cd /usr/local/src
wget -qO- http://download.oracle.com/berkeley-db/db-5.1.19.tar.gz | tar xzv
cd db-5.1.19/build_unix
../dist/configure --prefix=/usr/local --enable-cxx
make && make install

Dogecoind

Again, dogecoind is the daemon used to interact with Dogecoin.

cd /usr/local/src
ldconfig
mkdir /usr/local/src/dogecoin-master
cd /usr/local/src/dogecoin-master
wget -qO- https://github.com/dogecoin/dogecoin/archive/master-1.5.tar.gz --no-check-certificate | tar xzv --strip-components 1 
cd src
make -f makefile.unix USE_UPNP=- BDB_LIB_PATH=/usr/local/lib OPENSSL_LIB_PATH=/usr/local/lib64

The system should now compile the dogecoind binary and place it in the current directory. You will most likely want tostrip debugging symbols out of the binary and move it somewhere in your$PATH. This allowsdogecoind to be easily executed without specifying the absolute path to the binary each time.

strip dogecoind
cp -a dogecoind /usr/local/bin/

Configuring Dogecoind

It seems like 99% of the cryptocurrencies use the same style configuration file. Doge is nearly functionally identical to LiteCoin. It is generally safe to use litecoin documentation when looking upconfiguration variables.

< OPTIONAL > - If you do not have a regular, non-root, user then you can create one using theuseradd command. Remember to substituteusername for the actual username you wish to create.

useradd -m -s/bin/bash username

Now you will want to assume the identity of a non-privileged user. For example, the userdoge.

su - doge

Once you‘ve assumed the identity of a non-privileged user you will want to rundogecoind.

dogecoind

You should be presented with text similar to:

Error: To use dogecoind, you must set a secure rpcpassword in the configuration file:
/home/doge/.dogecoin/dogecoin.conf
It is recommended you use the following random password:
rpcuser=dogecoinrpc
rpcpassword=<long random password>
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %s | mail -s "Dogecoin Alert" admin@foo.com

The first run creates the required directory structure and puts necessary files in place within that structure.

$ ls -R .dogecoin
.dogecoin:
blocks  chainstate  db.log  debug.log  peers.dat  wallet.dat

.dogecoin/blocks:
blk00000.dat  index

.dogecoin/blocks/index:
000003.log  CURRENT  LOCK  LOG  MANIFEST-000002

.dogecoin/chainstate:
000003.log  CURRENT  LOCK  LOG  MANIFEST-000002

We will now fetch a basic configuration file and modify it to suit our needs.

cd ~/.dogecoin
wget https://raw.github.com/dogecoin/dogecoin/master-1.5/release/dogecoin.conf

This file has nothing more than some current nodes in it so we will need to modify it some. Open~/.dogecoin/dogecoin.conf in your linux text editor of choice and add the following options:

daemon=1
server=1
rpcuser=dogecoinrpc1 (or any username you‘d like)
rpcpassword=<long random password>

There is a more complete list of available options and what they do in the Litecoin Documentation.

Additional Reading


附上 centos-install.sh

#!/bin/bash
if [ ! -x /usr/bin/wget ] ; then
echo "for some silly reason, wget is not executable. Please fix this (as root do chmod +x /usr/bin/wget) and try again"
 exit
fi
USERNAME=`whoami`
cd ~
mkdir Dogecoin
cd Dogecoin
mkdir Libraries
mkdir Trunk
mkdir Deps
cd Libraries
wget -qO- http://downloads.sourceforge.net/boost/boost_1_55_0.tar.bz2 | tar xjv
cd boost_1_55_0
./bootstrap.sh
./bjam --prefix=/home/$USERNAME/Dogecoin/Deps link=static runtime-link=static install
cd ..
wget -qO- http://www.openssl.org/source/openssl-1.0.0g.tar.gz | tar xzv
cd openssl-1.0.0g
if uname -a | grep -q x86_64 ; then
 ./Configure no-shared --prefix=/home/$USERNAME/Dogecoin/Deps --openssldir=/home/$USERNAME/Dogecoin/Deps/openssl linux-x86_64
else
 ./Configure no-shared --prefix=/home/$USERNAME/Dogecoin/Deps --openssldir=/home/$USERNAME/Dogecoin/Deps/openssl linux-generic32
fi
#make depend
make
make install
cd ..
wget -qO- http://download.oracle.com/berkeley-db/db-5.1.19.tar.gz | tar xzv
cd db-5.1.19/build_unix
../dist/configure --prefix=/home/$USERNAME/Dogecoin/Deps/ --enable-cxx
make
make install
cd ../..
mkdir dogecoin-master
cd dogecoin-master
wget -qO- https://github.com/dogecoin/dogecoin/tarball/master-1.5 --no-check-certificate | tar xzv --strip-components 1
cd src
#cp -vap ~$USERNAME/makefile.new .
cat /home/$USERNAME/makefile.new | sed s/kjj/$USERNAME/g > makefile.new
make -f makefile.new dogecoind
cp -vap dogecoind /home/$USERNAME/
cd ~

dogecoind在CentOS安装参考,布布扣,bubuko.com

dogecoind在CentOS安装参考

标签:des   style   class   code   c   tar   

原文地址:http://blog.csdn.net/expleeve/article/details/25567813

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!