bitcoin

Download the Source

(Taken from: http://bitzuma.com/posts/compile-bitcoin-core-from-source-on-ubuntu/)

We'll use Git to access the Bitcoin Core source code. In addition to providing the current version of Bitcoin Core, Git gives ready access to all past and future versions. Enter your login password when prompted.

$ sudo apt-get install git

Next, create a source directory and clone the Bitcoin Core source repository.

$ mkdir -p src && cd src $ git clone https://github.com/bitcoin/bitcoin.git

After a short time, all files should be ready. To confirm, use the lscommand.

$ ls bitcoin

Install Dependencies

Bitcoin core requires many software libraries that don't come packaged by default with the Ubuntu distribution. The first one, build-essential, enables software to be compiled from source.

$ sudo apt-get install build-essential

Bitcoin Core relies on an old version of the Berkeley Database that is not available as a standard Ubuntu 14.04 package. Although precompiled binaries can be downloaded, in this guide we'll compile from source.

Begin by downloading and verifying the BerkeleyDB source package.

$ wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz $ echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256sum -c

The last command should return a value of db-4.8.30.NC.tar.gz: OK.

Next, unpack the BerkeleyDB source and compile.

$ tar -xvf db-4.8.30.NC.tar.gz $ cd db-4.8.30.NC/build_unix $ mkdir -p build $ BDB_PREFIX=$(pwd)/build $ ../dist/configure --disable-shared --enable-cxx --with-pic --prefix=$BDB_PREFIX $ make install $ cd ../..

The remaining dependencies can be installed with a single command.

$ sudo apt-get install autoconf libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libqt4-dev libqrencode-dev libtool

Compile Bitcoin Core

To compile Bitcoin Core, move back into the previously-cloned git repository and checkout the current release tag. At the time of this writing, that version is 0.9.2. Tags can be listed with the command git tag. For now, ignore the warning about "'detached HEAD' state". Next, configure build, and install the binaries.

$ cd bitcoin $ git checkout v0.9.2 $ ./autogen.sh $ ./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/" --with-gui $ make $ sudo make install

Under the bitcoin/doc directory is a file called build-unix.md containing more Linux build instructions and options.

Run Bitcoin Core

Bitcoin Core can now be run from the command line.

1 Simple Commands: 2 3 Start Daemon: 4 bitcoind -regtest -daemon -printtoconsole 5 6 Add Node to Daemon: 7 bitcoin-cli -regtest addnode 192.168.56.102 onetry 8 9 Mine Coins: 10 bitcoin-cli -regtest setgenerate true 101 11 12 Get Balance: 13 bitcoin-cli -regtest getbalance 14 15 Get New Address: 16 bitcoin-cli -regtest getnewaddress 17 18 Send Coin to New Address: 19 bitcoin-cli -regtest sendtoaddress mpoYkKfjtnHU5ykYB4vuy3RjcAnd5FtNYi 500

20

21 Set account to a specific address

22 bitcoin-cli -regtest setaccount moxnkx3uocKDS4SjVxCg7iBRyPrqZaPCjZ

23

24 List accounts:

25 bitcoin-cli -regtest listaccounts

List of Prefixes

Version 0.2.0.pre

Key:

Pub Dec = Prefix for Public Key, Decimal

Pub Hex = Prefix for Public Key, Hexadecimal

Pub lead = leading character in Public Key

Priv Dec = Prefix for Private Key, Decimal

Priv Hex = Prefix for Private Key, Hexadecimal

Priv lead = leading character in Private Key (Wallet Import Format)

PrvC lead = leading character in Private Key (Compressed Wallet Import Format)

test = Test results for importing PHPCoinAddress created keys into standard client

src = source code repository

Note: tests are for uncompressed keys

Pub Pub Pub Priv Priv Priv PrvC

Coin Dec Hex lead Dec Hex lead lead test src

============ ==== ==== ==== ==== ==== ==== ==== ==== ====

BITCOIN 0 0x00 1 128 0x80 5 K,L OK https://github.com/bitcoin/bitcoin

BBQCOIN 85 0x05 3 213 0xD5 8 K, - https://github.com/overware/BBQCoin

BITBAR 25 0x19 B 153 0x99 6 K, - https://github.com/aLQ/bitbar

BYTECOIN 18 0x12 8 128 0x80 5 K, - https://github.com/bryan-mills/bytecoin

CHNCOIN 28 0x1C C 156 0x9C 6 K, - https://github.com/CHNCoin/CHNCoin

DEVCOIN 0 0x00 1 128 0x80 5 K,L - http://sourceforge.net/projects/galacticmilieu/files/DeVCoin/

FAIRBRIX - - - - - - - - https://github.com/coblee/Fairbrix

FEATHERCOIN 14 0x0E 6 142 0x8E 5 K, - https://github.com/FeatherCoin/FeatherCoin

FREICOIN 0 0x00 1 128 0x80 5 K,L - https://github.com/freicoin/freicoin

IXCOIN - - - - - - - - https://github.com/ixcoin/ixcoin

JUNKCOIN 16 0x10 7 144 0x90 5 K, OK https://github.com/js2082/JKC

LITECOIN 48 0x30 L 176 0xB0 6 K, OK https://github.com/litecoin-project/litecoin

MINCOIN 50 0x32 M 178 0xB2 6 K, - https://github.com/SandyCohen/mincoin

NAMECOIN 52 0x34 M,N 180 0xB4 7 K, - https://github.com/namecoin/namecoin

NOVACOIN 8 0x08 4 136 0x88 5 K, - https://github.com/CryptoManiac/novacoin

ONECOIN 115 0x73 o 243 0xF3 9 K, - https://github.com/cre8r/onecoin

PPCOIN 55 0x37 P 183 0xB7 7 K, OK https://github.com/ppcoin/ppcoin

ROYALCOIN - - - - - - - - http://sourceforge.net/projects/royalcoin/

SMALLCHANGE 62 0x3E S 190 0xBE 7 K, - https://github.com/bfroemel/smallchange

TERRACOIN 0 0x00 1 128 0x80 5 K,L - https://github.com/terracoin/terracoin

YACOIN 77 0x4D Y 205 0xCD 7 K, - https://github.com/pocopoco/yacoin

Pub Pub Pub Priv Priv Priv PrvC

TESNET Coin Dec Hex lead Dec Hex lead lead test

============ ==== ==== ==== ==== ==== ==== ==== ====

BITCOIN-T 111 0x6F m,n 239 0xEF 9 - OK(uncompressed only)

BBQCOIN-T 25 0x19 153 0x99 - - -

BITBAR-T 115 0x73 243 0xF3 - - -

FAIRBRIX-T - - - - - - - -

IXCOIN-T - - - - - - - -

NAMECOIN-T - - - - - - - -

ROYALCOIN-T - - - - - - - -

TESTNET Coins using BITCOIN TESTNET prefixes:

BYTECOIN, CHNCOIN, DEVCOIN, FEATHERCOIN, FREICOIN, JUNKCOIN, LITECOIN

MINCOIN, NOVACOIN, ONECOIN, PPCOIN, TERRACOIN, SMALLCHANGE, YACOIN

Source: https://bitcointalk.org/index.php?topic=200042.0