Clone iroha.git
on your directory.
git clone --recursive https://github.com/hyperledger/iroha.git
cd iroha
Build depends on the environment variable IROHA_HOME
so you need to set it:
export IROHA_HOME=$(pwd)
Run build script and wait for completion.
${IROHA_HOME}/docker/build.sh
- It builds
hyperledger/iroha-dev
image, which is ubuntu:latest with all dependencies installed. - It builds iroha inside that image and copies
iroha.tar
into${IROHA_HOME}/docker/build/iroha.tar
- It creates production-ready docker image with tag
hyperledger/iroha-docker
and copiesiroha.tar
inside it.
In order to use iroha, you need to create config/sumeragi.json
config file in each node (docker container).
You have two options:
- To use automatic config discovery.
- To run iroha containers and setup configs by yourself. To do this, run bash in iroha container:
# run bash instead of default /run.sh
ID=$(docker run -it -d hyperledger/iroha-docker bash)
# attach to container
docker exec -it $ID bash
# setup config now and then execute /run.sh
iroha image includes several scripts:
/configure.sh
, which makes attempt to get config file fromconfigdiscovery
service./run.sh
, which runs iroha (it will be successful only if you properly setup${IROHA_HOME}/config/sumeragi.json
inside a container) ./configure-then-run.sh
, which runsconfigure
, thenrun
.
You can use them instead default CMD
:
docker run -d --name iroha hyperledger/iroha-docker /configure-then-run.sh