Skip to content
This repository has been archived by the owner on Nov 30, 2017. It is now read-only.

Latest commit

 

History

History

iroha-build

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

IROHA Building HowTo

IROHA is a simple Distributed Ledger Technology software.

IROHA will building easily by using below shell scripts.

  1. iroha_prep.sh
  2. iroha_build.sh

1. iroha_prep.sh

iroha_prep.sh run by root user on Ubuntu 16.04.

bash iroha_prep.sh

After execution of this script, iroha user account was created and several development tools will be installed on your environment.

2. iroha_build.sh

iroha_build.sh run by iroha user which created by iroha_prep.sh scripts.

Note: iroha_build.sh script must run by iroha user.
su - iroha
cd /usr/local/iroha
bash iroha_build.sh

This script using several sudo commands, so you should enter iroha user's password.

[sudo] password for iroha: 

iroha_prep.sh has been created IROHA's password as passw0rd, so you should type this at above prompt.

This shell will be done below functions.

  1. Cloning IROHA from Hyperledger Project Official repositories on github .
  2. Bulding IROHA libraries.
  3. Building IROHA.
  4. Make IROHA directory on /usr/local as /usr/local/iroha.
  5. Copy IROHA binaries, libraries and configuration files to IROHA directory.

After iroha_build.sh script execution, you can use IROHA on your /usr/local/iroha directories.

3. Docker container

If you want to use iroha_build repository on your docker container, you can use as below.

3.1 Build Docker

At first you'll build container as below.

docker build -t hyperledger/iroha-build .

Then you can run iroha-build container.

docker run -it --name iroha-build hyperledger/iroha-build /bin/bash

3.2 Build IROHA

After that, you can build IROHA in the iroha-build container.

cd /usr/local/iroha
bash iroha_prep.sh
su - iroha
cd /usr/local/iroha
bash iroha_build.sh

3.3 Commit Container

Now, you can commit this container.

docker commit <container id> hyperledger/iroha-build

3.4 Running Container

Then, you can run this container like this.

HOME=$(pwd)
docker run -d --name iroha-build \
  -v ${HOME}/../iroha/config1:/usr/local/iroha/config \
  hyperledger/iroha-build /bin/su - iroha -c "env IROHA_HOME=/usr/local/iroha /usr/local/iroha/bin/iroha-main"

In this example, we are using sample configuration file which provided by iroha in the iroha-docker repository.

3.5 Running Containers by Script

You can run iroha-build containers using by run-iroha-build.sh script.

./run-iroha-build.sh

This script runs four containers on your host machine.

3.6 Show Logs

You can show logs of the container, as below.

docker logs -f iroha-build

Or

docker logs -f iroha1 # iroha1 ... iroha4

4. Virtual Environment or Bare Metal

Really, you can build IROHA on your Virtual Environment or Bare Metal.

4.1 Update Ubuntu

At first, you'll update Ubuntu. <user> is your account on this machine.

sudo apt update
sudo apt -y upgrade

4.2 Create Git account

Create Git account as below.

sudo groupadd -g 1001 git
sudo useradd -u 1001 -c "Git Administrator" -s /bin/bash -m -g git git

4.3 Clone iroha-docker

Make git repository and clone iroha-docker on it.

sudo apt -y install git
mkdir -p git/hyperledger
sudo chgrp -R git git
sudo chmod -R 2775 git
cd git/hyperledger
git clone https://github.com/hyperledger/iroha-docker

4.4 Run iroha-prep

Running iroha-prep.sh script to prepare development tools for building IROHA.

sudo -i
cd /home/<user>/git/hyperledger/iroha-docker/iroha-build
./iroha_prep.sh

4.5 Run iroha_build

Running iroha_build.sh to building IROHA.

su - iroha
cd /home/<user>/git/hyperledger/iroha-docker/iroha-build
./iroha_build.sh

After this script running, IROHA will successfully build on your /usr/local/iroha directory.

Have fun!

Author

Takeshi Yonezu

License

Copyright 2016 Soramitsu Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.