/libbitcoin

libbitcoin asynchronous C++ library for Bitcoin

Primary LanguageC++OtherNOASSERTION

All files in this repository fall under the license specified in LICENSE
The project is licensed as AGPL with a lesser clause. It may be used within
a proprietary project, but the core library and any changes to it must be
published online. Source code for this library must always remain free for
everybody to access.

You will need:

  - GCC 4.7 or newer
  - Boost 1.48 or newer
  - OpenSSL 0.9 or newer
  - LevelDB

The './configure' command in the install instructions below.
'configure' accepted a --prefix switch. Use this if you want to install the

Use `pkg-config --cflags --libs libbitcoin' for getting compile/build
parameters.

For the blockchain database, set the max open files limit higher.
The default limit on most Linux systems is too low.

  $ ulimit -n 4096

Ubuntu Instructions
===================

*Ubuntu Precise Pangolin requires libboost1.48-all-dev instead of libboost-all-dev

  $ sudo apt-get install build-essential autoconf libtool libboost-all-dev pkg-config libcurl4-openssl-dev libleveldb-dev
  $ autoreconf -i
  $ ./configure --enable-leveldb
  $ make
  $ sudo make install

'./configure' accepts a --prefix switch. This is useful if you prefer to
install libbitcoin to a local directory instead.

  $ ./configure --enable-leveldb --prefix /home/genjix/usr/
  $ make
  $ make install

Then add these environment variables to the end of your ~/.bashrc to point
software to your local installation. Otherwise software will have trouble
finding the libbitcoin install.

  export LD_LIBRARY_PATH=~/usr/lib/
  export PKG_CONFIG_PATH=~/usr/lib/pkgconfig/

pkg-config can be invoked to get the neccessary compile and build flags.

  $ pkg-config --cflags --libs libbitcoin

Start with the examples/ to see a few sample programs:

  $ cd examples/
  $ make
  # Play around with private keys.
  $ ./priv
  # Initialize a new LevelDB blockchain database.
  $ mkdir database
  $ ./initchain database/
  # Run the fullnode example (validates blocks and transactions).
  $ ./fullnode

Mac OSX Instructions
====================

To build on Mac OSX, you will need to download and compile your own boost,
leveldb and protobuf using gcc 4.7 before building libbitcoin. Then set the
following environment variables before running the build process.

  CC=/usr/local/bin/gcc-4.7
  CXX=/usr/local/bin/g++-4.7

For Mac OSX Mountain Lion, you need to follow these brew commands:

  $ brew install boost openssl leveldb
  $ brew tap homebrew/versions
  $ brew install gcc48
  # Can be replaced back later if you prefer, but
  # keeping the new g++ is a good idea.
  $ sudo ln -sf /usr/local/bin/g++-4.8 /usr/bin/g++


  $ autoreconf -i
  $ ./configure --enable-leveldb
  $ make
  $ sudo make install