Skip to content

ndrwchn/bitcoinclassic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 

Repository files navigation

Host a Bitcoicn Classic node on Ubuntu Server 14.04 LTS / Microsoft Azure

Motivation: To create comprehensive instructions for anyone to follow to allow users to deploy a full Bitcoin Classic node permanently on using Microsoft's Azure.

If you have any kind of company or startup, maybe sign up through https://www.microsoft.com/bizspark/signup/ and get $150 a month per employee of free Azure time for 3 years.

Requirements

  1. Secondary drive large enough for the block chain growth
  2. No wallet
  3. No UI
  4. Allow to be discovered by opening firewall
  5. Good uptime

Start from the Microsoft Azure portal https://portal.azure.com

Create an Ubuntu Server VM on Azure

  1. Basics
  2. Select New -> Compute -> Ubuntu Server 14.04 LTS -> Create
  3. Enter Name, e.g. BitcoinClassic-1
  4. Enter User name, e.g. satoshi
  5. Set Authentication type, e.g. Password
  6. Set a strong password
  7. Make a Resource group, e.g. Bitcoin
  8. Select Location, e.g. North Europe
  9. Click OK
  10. Size
  11. Select View all
  12. Select A2 Standard (2 cores, 3.5 GB RAM) as a minimum while the code is built and blockchain is synced, then scale back to A1 when all is set.
  13. Click Select
  14. Settings
  15. Keep suggested Storage, Network and Monitoring settings
  16. Click OK
  17. Summary
  18. Click OK
  19. Wait for deployment to finish
  20. Assign DNS name label
  21. Click the public IP address -> All settings -> Configuration
  22. Enter a DNS name label, e.g. bitcoinclassic21
  23. Click the Save icon

Attach a second 120GB empty disk (to be used for the block chain)

  1. Click Microsoft Azure in the top-left corner
  2. Select Virtual machines -> BitcoinClassic-1
  3. Select Disks -> Attach new
  4. Size (GB): 120
  5. Click OK
  6. Wait until the new disk has been attached

Open port 8333 for inbound connections

  1. Click All resources from the left menu
  2. Select Network security group - looks like a shield
  3. Select Inbound security rules
  4. Click Add
  5. Enter name, e.g. Bitcoin
  6. Change Protocol to TCP
  7. Change Destination port range to 8333
  8. Click OK

You may want to restrict access to port 22 (SSH port) to your own IP.

Now we can SSH into the VM, e.g. satoshi@bitcoinclassic21.northeurope.cloudapp.azure.com If connection was not made, try restarting the server.

Mount data drive

Format the data drive using ext3 filesystem and mount it. The secondary drive should be named /dev/sdc

sudo fdisk /dev/sdc
n
p
1
(Enter)
(Enter)
w
sudo mkfs.ext3 /dev/sdc1
sudo mkdir /media/data
sudo mount /dev/sdc1 /media/data
cd /media/data
sudo su -c "echo '/dev/sdc1 /media/data ext3 defaults 0 0' >> /etc/fstab"

Prerequisites

For the software to build a few dependencies must be installed first. You can install them by the following commands.

sudo apt-get update
sudo apt-get -y install python-software-properties
sudo apt-get -y install build-essential libboost-all-dev automake libtool autoconf
sudo apt-get -y install libdb++-dev
sudo apt-get -y install libboost-all-dev
sudo apt-get -y install pkg-config
sudo apt-get -y install libevent-dev
sudo apt-get -y install libssl-dev
sudo apt-get -y install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
sudo apt-get -y install git

Make Bitcoin Classic

Now we will get the Bitcoin Classic source from GitHub and make the executables.

cd ~/
sudo git clone https://github.com/bitcoinclassic/bitcoinclassic
cd bitcoinclassic
sudo git checkout classic-0.11.2.b1
sudo ./autogen.sh
sudo ./configure --with-cli=yes --with-gui=no --disable-wallet
sudo make 
sudo make install

Note, if there is an error on autogen.sh, re install the pre reqs.

Initial run

We will run bitcoind for a few seconds once so it generates the proper directories.

 bitcoind -server

Write down or copy the generated rpcuser and rpcpassword values.

Configure

Run the following to generate the bitcoin.conf file - replace rpcpassword with generate values.

Example:

echo 'rpcuser=bitcoinrpc' > ~/.bitcoin/bitcoin.conf
echo 'rpcpassword=XXXXyy1yXXXyyX1XXy1XXy1XXXy1Xy1y11XyXyXyyXXy' >>  ~/.bitcoin/bitcoin.conf
echo 'server=1' >>  ~/.bitcoin/bitcoin.conf

Verify config-file values are in the file.

more ~/.bitcoin/bitcoin.conf

Move blocks

We now move the blocks from the default location to the secondary drive, and create a static link.

cd ~/.bitcoin
sudo rsync -a ~/.bitcoin/blocks /media/data/
sudo rm -R ~/.bitcoin/blocks
ln -s /media/data/blocks blocks

To check this has worked perform the following.

cd ~/.bitcoin
ls -al

"blocks" should be in a cyan colour and look like this: blocks -> /media/data/blocks

Node that it's the current user, satoshi, that has file access.

Done

The daemon should now be ready to start.

Type the following to start the node.

bitcoind -daemon

You should see "Bitcoin server starting"

Test

Type the following to run a small test

bitcoin-cli getinfo

The output should be something like this

{
    "version" : 110200,
    "protocolversion" : 70002,
    "blocks" : 125656,
    "timeoffset" : 0,
    "connections" : 8,
    "proxy" : "",
    "difficulty" : 244112.48777434,
    "testnet" : false,
    "relayfee" : 0.00005000,
    "errors" : ""
}

Also, go to https://getaddr.bitnodes.io/ and type in the node network address, e.g. bitcoinclassic21.northeurope.cloudapp.azure.com, and click "CHECK NODE". Something like the following should show to verify you are running Bitcoin Classic:

bitcoinclassic42.northeurope.cloudapp.azure.com:8333 /Classic:0.11.2/

Trouble shooting

You can check the drive space by using this command

df -h

Debug log files are located at ~/.bitcoin/debug.log You can use the command this command to monitor log files:

sudo tail -f ~/.bitcoin/debug.log

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published