Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

EC2 settings

  • Instance type: t2.xlarge
  • vCPUs: 4
  • Memory (GiB): 16
  • General Purpose SSD (GP2): 200 GB
  • Ubuntu
  • Running in eu-central-1b (Frankfurt)

Hint: to make your life easier and allow login with a simple ssh btc-0.14, edit ~/.ssh/config:

Host btc-0.14
    HostName ec2-x-x-x-x.eu-central-1.compute.amazonaws.com
    User ubuntu
    IdentityFile ~/.ssh/the-key-amazon-gave-you.pem

Versions

The last patch version of each minor release, down to 0.5 (late 2011)

  • v0.15.0rc3
  • v0.14.2
  • v0.13.2
  • v0.12.1
  • v0.11.2
  • v0.10.3
  • v0.9.3
  • v0.8.6
  • v0.7.2: stuck at 364,670
  • v0.6.3: stuck at 329,998
  • v0.5.3: sync stuck at 332,150
  • v0.4.0: can't compile
  • v0.3.24: can't compile

Install dependencies

Instructions taken from various sites. There might be some superfluous stuff.

sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install build-essential autoconf libboost-all-dev libssl-dev libtool pkg-config libevent-dev

I didn't run apt-get upgrade for the 0.14 and 0.13 runs.

<= v0.8

sudo apt-get install libdb++-dev libminiupnpc-dev

<= v0.4

I was not able to get these to work. They require some old version of WxWidgets.

Installation

git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
git checkout v0.14.2

master

./autogen.sh
./configure --disable-wallet --disable-bench --disable-tests --without-gui
make
sudo make install

0.15

./autogen.sh
./configure --disable-wallet --enable-experimental-asm
make
sudo make install

>= 0.9

./autogen.sh
./configure --disable-wallet
make
sudo make install

<= 0.9

If you use these older clients with a modern version of OpenSLL, syncing the blockchain . Thanks goes to Pieter Wuille for pointing that out.

Open src/key.cpp and replace everything inside the CKey::Verify function brackets with this new version.

0.8

I got great help through stack exchange.

Edit rpcrawtransaction.cpp and change:

const CScriptID& hash = boost::get<const CScriptID&>(address);

To:

const CScriptID& hash = boost::get<CScriptID>(address);

<= 0.8

Run make:

cd src/
make -f makefile.unix	

0.5

Instead of src/key.cpp, edit src/key.h. The function is called bool Verify here.

Amazing script to measure performance

I saved this as check.sh:

while sleep 10
do
BLOCKS=$(bitcoin-cli getblockcount)
echo "Block $BLOCKS of 473879..."
if [ "$BLOCKS" -gt "473879" ]; then
  echo "Synced."
  date
  break
fi
done
chmod +x check.sh

<= v0.8

In the above script, replace bitcoin-cli with ./bitcoind.

<= v0.7

mkdir ~/.bitcoin

Add a file ~/.bitcoin/DB_CONFIG as per these instructions:

set_lg_dir database
set_lk_max_locks 537000

Start Bitcoin client

I set -dbcache=8000 (8 GB).

v0.15

I'm using assumevalid=0 to force it to validate all signatures. I'm more interested in comparing performance on an ongoing basis than the initial sync.

bitcoind -assumevalid=0 -dbcache=8000 -daemon

<= v0.13

bitcoind -dbcache=8000 -daemon

<= v0.11

Follow the instructions you get in the error message when you first run bitcoind, to create a config file.

vim ~/.bitcoin/bitcoin.conf
# paste in the suggested settings
chmod 500 ~/.bitcoin/bitcoin.conf

Ignore the URGENT: Alert key compromised, upgrade required error returned by bitcoin-cli getinfo. :-)

<= v0.8

./bitcoind -dbcache=8000 -daemon

Start the clock

date

Note the starting time.

screen
./check.sh 

Use ctrl + a, ctrl + d to leave screen and keep the script running. Come back later, using screen -r.

Note the end time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.