Created
August 8, 2018 18:02
-
-
Save igor-egorov/84f05ee319e6fb9aa7f6b02ff1505f17 to your computer and use it in GitHub Desktop.
Run tx-example.py on Iroha from master branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone -b master --depth=1 git@github.com:hyperledger/iroha.git iroha | |
cd iroha | |
docker pull hyperledger/iroha:latest | |
docker network create iroha-network | |
docker run --name some-postgres \ | |
-e POSTGRES_USER=postgres \ | |
-e POSTGRES_PASSWORD=mysecretpassword \ | |
-p 5432:5432 \ | |
--network=iroha-network \ | |
-d postgres:9.5 | |
docker volume create blockstore | |
docker run -it --name iroha \ | |
-p 50051:50051 \ | |
-v $(pwd)/example:/opt/iroha_data \ | |
-v blockstore:/tmp/block_store \ | |
--network=iroha-network \ | |
--entrypoint=/bin/bash \ | |
hyperledger/iroha:latest | |
# now you are in a terminal window inside container | |
irohad --config config.docker --genesis_block genesis.block --keypair_name node0 | |
# from now we would not type anything into this terminal - it's full of iroha logs | |
# for the following commands you must open another terminal on your host machine | |
cd path/to/iroha/example/python | |
pip2 install grpcio-tools | |
pip2 install protobuf | |
./prepare.sh | |
# prepare.sh compiles iroha python library | |
# you may need boost 1.65.1, automake and protobuf installed in your system | |
python2 tx-example.py | |
# all the commands are executed | |
# to stop and remove everything do the following | |
# stop running iroha with ctrl+c | |
# leave iroha container with ctrl+d (container should stop automatically) | |
docker stop some-postgres | |
docker container rm iroha | |
docker container rm some-postgres | |
docker volume rm blockstore | |
docker network rm iroha-network | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment