For how to install Bitcoind in CentOS6.4, see

Source: Internet
Author: User

Rpm Mode

Rpm-ivh http://linux.ringingliberty.com/bitcoin/el6/x86_64/bitcoin-release-1-6.noarch.rpm
Yum install bitcoin-server

CentOS5 reference

OK let's get this tutorial section started off with one. now mind you I didn't write this tutorial, it was writen by "Michael Erwin Steurer" and posted on the otherbitcoin forum. problem is it was hard to find and it's in PDF format, don't like that myself ha

So I am going to post it here to get the tutorials section up and running. plus, I also fixed a problem someone on the other forum was having with gthread not being installed and working, I will post that at the end of the tutorial.

Now I HAVE tested this myself just 10 minutes ago on a CentOS 5.5 system with the most recent of everything, including the most recent download ofbitcoin. So it works. Let's start:

We keep everything in our home directory under ~ /Bitcoin/. We do not make any changes
To system parameters or system libraries and therefore no root privileges are required.

That above statement was from the original, root priviledges WILL be required if you have the problem with gthread, which most VPS machines shoshould have. this is because you will have to install gthread using yum, so root is needed in this case or sudo power.
 

PADDING); PADDING-BOTTOM: 10px; MARGIN: 0px; PADDING-TOP: 10px; FONT-STYLE: italic; BACKGROUND-COLOR: rgb (255,244,229); background-clip: initial; border-top-left-radius: 4px 4px; border-top-right-radius: 4px 4px; border-bottom-right-radius: 4px 4px; border-bottom-left-radius: 4px 4px; background-origin: initial "> # mkdir Bitcoin
# Cd Bitcoin
# Mkdir Libraries
# Mkdir Trunk
# Mkdir Deps
Libraries

Boost, Get the Library from here:
Http://sourceforge.net/projects/boost/files/boost/1.46.1/boost_1_46_1.tar.gz

Put it into the directory ~ /Bitcoin/Libraries/and execute the following commands (write the parameters for the bjam command in one line ).

There was an error in the prefix line below, I removed it, the author had an extra Bitcoin/in there.
# Cd Libararies
# Tar-xzvf boost_000046_1.tar.gz
# Cd boost_000046_1
#./Bootstrap. sh
#./Bjam -- prefix =.../../Deps link = static runtime-link = static install
OpenSSL, Get the Library from here:
Http://www.openssl.org/source/openssl-1.0.0d.tar.gz

And put it into the directory ~ /Bitcoin/Libraries/, extract it and determine the system architecture.
# Tar-xzvf openssl-1.0.0d.tar.gz
# Cd openssl-1.0.0d
# Uname-
If the ouput of the last command contains
X86_64 x86_64 x86_64 GNU/Linux
You have a 64-bit computer architecture and if it contains
I686 i686 i386 GNU/Linux
You have a 32-bit computer architecture.

Execute one of the following./Con gure commands according to the architecture

64-bit architecture
#./Configure -- prefix = ~ /Bitcoin/Deps -- openssldir = ~ /Bitcoin/Deps/openssl linux-x86_64
32-bit architecture
#./Configure -- prefix = ~ /Bitcoin/Deps -- openssldir = ~ /Bitcoin/Deps/openssl linux-generic32
Get a list with all supported ubuntures
#./Configure -- prefix = ~ /Bitcoin/Deps -- openssldir = ~ /Bitcoin/Deps/openssl
Finally, compile and install.
Make & make install
Berkeley DB, Get the Library from here:
Http://freshmeat.net/projects/berkeleydb

And put it into the directory ~ /Bitcoin/Libraries/and compile it
# Tar-xzvf db-5.1.19.tar.gz
# Cd db-5.1.19
# Cd build_unix
# ../Dist/configure -- prefix = ~ /Bitcoin/Deps/-- enable-cxx
# Make & make install
Bitcoin

Get the BitCoin sources from the webpage or check it out from the Git repository and put
It into the directory ~ /Bitcoin/Trunk/
# Git clone https://github.com/bitcoin/bitcoin.git Trunk
That was the GIT command, now you can download also from here:

BitCoin homepage:
Http://www.bitcoin.org/

BitCoin GIT:
Https://github.com/bitcoin/bitcoin

Or SourceForge page, you want to download the latest version and the src version to compile your self:
Http://sourceforge.net/projects/bitcoin/files/Bitcoin/

I personally got mine from the SF page

To download and compile from SF, use wget, issue these commands:
# Cd ~ /Bitcoin/Trunk
# Wget sf_link
# Tar-xf bitcoin *
# Cd bitcoin-0.3.23/src
Replace sf_link with your download link and 0.3.23 with the version you downloaded.

Create a new fille ~ /Bitcoin/Trunk/makefi le. centos and add the lines as follows.
# Begin
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Distributed under the MIT/X11 software license, see the accompanying
# File license.txt or http://www.opensource.org/licenses/mit-license.php.

CXX = g ++

DEPSDIR =/root/Bitcoin/Deps

INCLUDEPATHS =-I "$ (DEPSDIR)/include"
LIBPATHS =-L "$ (DEPSDIR)/lib"

Wxshortdepaths = $ (shell wx-config -- cxxflags)
WXLIBS = $ (shell wx-config -- libs)

USE_UPNP =

DEFS =-DNOPCH-DFOURWAYSSE2-DUSE_SSL

LIBS =-dead_strip \
-Wl,-Bstatic \
$ (DEPSDIR)/lib/libdb_cxx-5.1.a \
-Mtl $ (DEPSDIR)/lib/libboost_system.a \
-Mtl $ (DEPSDIR)/lib/libboost_thread.a \
-Mtl $ (DEPSDIR)/lib/libboost_filesystem.a \
-Mtl $ (DEPSDIR)/lib/libboost_program_options.a \
$ (DEPSDIR)/lib/libdb_cxx.a \
$ (DEPSDIR)/lib/libssl. \
$ (DEPSDIR)/lib/libcrypto. \
-L ssl \
-L crypto \
-Wl,-Bdynamic \
-L gthread-2.0 \
-L z \
-L dl


Ifdef USE_UPNP
LIBS + =-l miniupnpc
DEFS + =-DUSE_UPNP = $ (USE_UPNP)
Endif

DEBUGFLAGS =-g-d1_wxdebug __
CXXFLAGS =-O2-Wno-invalid-offsetof-Wformat $ (DEBUGFLAGS) $ (DEFS) $ (INCLUDEPATHS)
HEADERS = headers. h strlcpy. h serialize. h uint256.h \
Util. h key. h bignum. h base58.h script. h \
Db. h net. h irc. h main. h rpc. h uibase. h \
Ui. h noui. h init. h


OBJS = obj/util. o \
Obj/script. o \
Obj/db. o \
Obj/net. o \
Obj/irc. o \
Obj/main. o \
Obj/rpc. o \
Obj/init. o \
Cryptopp/obj/sha. o \
Cryptopp/obj/cpu. o

All: bitcoind

Obj/%. o: %. cpp $ (HEADERS)
$ (CXX)-c $ (CXXFLAGS) $ (wxshortdepaths)-DGUI-o $ @ $ <

Cryptopp/obj/%. o: cryptopp/%. cpp
$ (CXX)-c $ (CXXFLAGS)-O3-o $ @ $ <

Bitcoin: $ (OBJS) obj/ui. o obj/uibase. o
$ (CXX) $ (CXXFLAGS)-o $ @ $ (LIBPATHS) $ ^ $ (WXLIBS) $ (LIBS)

Obj/nogui/%. o: %. cpp $ (HEADERS)
$ (CXX)-c $ (CXXFLAGS)-o $ @ $ <

Bitcoind: $ (OBJSbj/% = obj/nogui/%)
$ (CXX) $ (CXXFLAGS)-o $ (LIBS)


Clean:
-Rm-f obj/*. o
-Rm-f obj/nogui/*. o
-Rm-f cryptopp/obj/*. o
-Rm-f headers. h. gch
-Rm-f bitcoin
-Rm-f bitcoind

# End
The spaces that you see are not spaces, they are TABS, one single tab to be exact since make is picky about this make sure you use tabs not spaces.

Change the Value DEPSDIR according to your Deps/directory.

Finally, compile the sources in ~ /Bitcoin/Trunk directory. This also depends on where you extracted the files from the source file to and from, you want to be in the SRC directory if you downloaded from SF instead of GIT.
Make-f makefile. centos bitcoind
Now for those of you with this error when you make:
Cannot find-lgthread-2.0

You need to install glib2-devel, that is the LIB that contains gthread for CentOS, you can do this issueing this command as root or sudo:
Yum install glib2-devel.i386

For that you might need the extras repositories from CentOS, you can find instructions on how to install the extra repos here:
Http://wiki.centos.org/AdditionalResources/Repositories/RPMForge

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.