You are on page 1of 5

Environmental Setup

1.1 Setting up the environment


Two machines were used one for platform implementation with following
implementations: Windows 10 Pro 4th Generation Intel 64-bit core i7 processor of 2.4Gz
base frequency with 4 cores, 16 GB RAM, 1 TB SSD and Windows10 pro OS. And other
for launching attacks with Kali Linux 2018.2, 4th Generation Intel 64-bit core i5 processor
of 2.4Gz, 8GB RAM, 500GB RPM hard disk. The blockchain implementation work has
done on virtualization. Oracle Virtual Box is a tool that provide virtualized environment to
host operating systems. For project implementation, Oracle Virtual Box 2.5 was taken. On
virtual box two machine were installed, first for Hyperledger Fabric implementation and
second for Ripple implementation. Same specification was used for both machines
comprises of 8GB RAM, 80GB SSD Hard disk. The bridge adaptor was used for internet
connection on virtual machines.
1.2 Implementation
In this section we discuss the implementation of our two blockchain platform: Hyperledger
fabric and Ripple.
1.2.1 Hyperledger Fabric
In order to perform the first experiment, HLF V1.1.0 was chosen. For execution of the
HLF, the necessary pre-requisites i.e., docker container V17.06.0, Python V2.7, Python-
pip V8.1.1, docker composer V1.21.2, Git V2.7.4, Curl V7.47.0, Node.js V8.11.3, Go
V1.8.1, Npm V 5.6.0, were installed.
Download and extract docker-ce following commands are used: sudo wget
https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-
ce_17.06.0~ce-0~ubuntu_amd64.deb and sudo dpkg -i docker- ce_17.06.0~ce-
0~ubuntu_amd64.deb. To download docker-compose first need to install python-pip by
using sudo apt-get install python-pip, after that hit sudo pip install docker-compose
command to install docker-compose. In order to install Git Hub repository run command
sudo apt-get install git. To install specific version of Node.js, need to install “curl” a
command line tool for transferring data to server or from server, by running sudo apt-get
install curl, then execute curl –sL https://deb.nodesource.com/setup8.x | sudo - E bash -.
cd$ HOME/ && wget https://storage.googleapis.com/golang/go1.8.1linux-amd64.tar.gz
and tar -xvf go1.8.1.linux-amd64.tar.gz commands are used to download and extract
specific version of GO language. During environmental configuration, many errors were
encountered while installing applications, packages and libraries under normal user. These
hurdles were tackled by installing them under root privileges. Then, fabric samples had
been cloned from Git hub repository. Extract platform specific binaries by applying the
command: sudo curl –sSL https://goo.gl/6wtTN5 | bash -s 1.1.0
For our project Fabcar an example of Hyperledger fabric was taken. In order to use our
example went into fabcar directory by cd fabcar command. In the fabcar directory hit sudo
npm install command in order to install node modules. To communicate with HLF grpc
module was installed by using sudo npm install grpc command. ./startFabric.sh command
was executed to HLF network for fabcar.

Figure 1 Running mode of HLF


Above Fig. shows that our network is in running mode. node enrollAdmin.js command was
used to enroll admin as shown in the following paper.

Figure 2 Admin Enrollment


The public and private key pair of enrolled admin were in the hfc-key-store directory as
shown below:

Figure 3 key pair of Admin


Once we enroll admin, then we would be able to add users. To add a new user, need to
register new user by executed node registerUser.js command as HLF is permissioned
blockchain platform. The key pair of created user were stored in the same directory as
admin keys were stored as shown below:

Figure 4 key pair of User


Node query.js query used to access the ledger state of fabcar network.

Figure 5 Ledger state


We made our transactions by sending our arguments to the network of fabcar by executing
node invoke.js , this command generate the transaction id. Each transaction in the network
has its own transaction id.

Figure 6 transaction id
Below Fig. shows that we successfully made our transaction and our network is in running
mode.

Figure 7 Made Transaction


1.2.2 Ripple v1.0
In order to perform the second experiment, Ripple V1.0.0 was chosen. For the execution
of Ripple, the necessary pre-requisites i.e., Git V2.7.4, cmake V3.5.1, pkg-config V0.29.1,
wget V1.17.1, Boost V1.64.1, were installed.
Install Git Hub repository sudo apt-get install git command was used. Cmake is a compiler-
independent method and supports directory hierarchy and applications that depend on
multiple libraries, sudo apt-get install cmake command was used to install Cmake. Pkg-
config, protobuf-compiler, libprotobuf-dev, libssl-dev and wget all were installed by the
same command just by replacing the name of the package at the end of a command. In
order to make the installation process easy of ripple, the Boost.build automated installation
process was downloaded and extracted by using wget
https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz && tar xvzf
boost_1_64_0.tar.gz command. Access the boost 1.64.0 directory by using cd
boost_1_64_0 command and run prepare Boost. Build system for run by executing
./bootstrap.sh. In order to invoke Boost.Build to build separately-compiled Boost libraries
run command ./b2 –j 6. Number of parallel jobs you want to assign for building libraries,
it depends on CPU cores and the hardware specs of the system. In our case we assigned 6
cores of our CPU, this command will take about 45mins for execution. Set the environment
variable BOOST_ROOT to a new boost_1_64_0 directory by using export
BOOST_ROOT=/home/ubuntu/boost_1_64_0. Source ~./profile was used to update path.
Get the ripple source code from the working directory by executing command git clone
https://github.com/ripple/rippled.git. Make my_build directory, a sub directory of rippled,
which is separate from the source tree root. Generate the build system, cmake -
Dtarget=gcc.debug.unity .. command was used. cmake --build . -- -j 6 command was used
to build rippled binary executables. 45 min time has taken to build rippled binary
executable. Executed /.rippled –u command, to take unit test in order to check rippled
binary executable correctly. Made copy of the example config file to run rippled as non-
root user following commands were executed: mkdir -p ~/.config/ripple and cp cfg/rippled-
example.cfg ~/.config/ripple/rippled.cfg. Edit the config file to set node_db, database_path
and debug_logfile paths. Made copy the example validators.txt file to the same folder as
rippled.cfg by hitting cp cfg/validators-example.txt ~/.config/ripple/validators.txt. Using
the defined configurations, run stock rippled server from the executable we build as cd
my_build && ./rippled. The network is in running mode as shown below:
.

You might also like