Skip to content

Commit

Permalink
modify circle.yml add simplei peer-service test / resolve codacy in c…
Browse files Browse the repository at this point in the history
…lear.sh
  • Loading branch information
satellitex authored and l4l committed Mar 17, 2017
1 parent 6c30e8c commit 3665339
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 22 deletions.
25 changes: 18 additions & 7 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,27 @@ test:
- export ID=$(docker run -it -d -p 1204:1204 hyperledger/iroha-docker /run.sh); echo "ID=$ID" >> ~/.bashrc
# put new tests below
- curl -X POST http://127.0.0.1:1204/account/register -d '{"publicKey":"WdvM/DPabapmtA7ISbTYPywbHxk8gWu2221LzmcmAgw=","alias":"yonezu","timestamp":1482053586}'
# docker-compose TEST (add peer)
- docker-compose up &
# docker-peer-service TEST (add peer)
- docker network create --subnet=172.20.0.0/16 iroha-network
- docker run -dit \
--network=iroha-network \
--ip=172.20.0.2 \
--name iroha1 \
-v sumeragi1.json:/usr/local/iroha/config/sumeragi.json \
hyperledger/iroha-docker
- docker run -dit \
--network=iroha-network \
--ip=172.20.0.3 \
--name iroha2 \
-v sumeragi2.json:/usr/local/iroha/config/sumeragi.json \
hyperledger/iroha-docker
- docker exec -it iroha1 sh -c "/usr/local/iroha/bin/issue_transaction add peer 172.18.0.3 yUAFTYNh6qkhBMiNgNdg45Wk/XHOGYanuIroY9skfPQ= 1.0 true"

post:
- docker-compose scale iroha=2
# WIP - docker exec -it iroha_iroha_2 sh -c "/usr/local/iroha/bin/make_sumeragi" > /tmp/me.json
# WIP - docker exec -it iroha_iroha_1 sh -c "/usr/local/iroha/bin/issue_transaction add peer ${TARGET_IP} ${TARGET_KEY} 1.0 true"
- docker exec -it iroha_iroha_1 sh -c "/usr/local/iroha/bin/issue_transaction add peer 172.18.0.5 X/Sk+plpcQ/+Wb9RQybm+OUS7FP3lbkuQmyHuK+uMvQ 1.0 true"
# iroha1 logs
- docker logs iroha1
# iroha-main logs
- docker logs $ID
- docker-compose down
# if node is alive, then iroha-main still works, otherwise test is failed
- (docker kill $ID && echo "Container worked and now killed. OK") || (echo "Container died. FAIL." && exit 1)

Expand Down
8 changes: 4 additions & 4 deletions config/sumeragi1.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"group": [
{
"ip": "127.0.0.1",
"name": "da77880a3da4",
"ip": "127.0.0.2",
"name": "iroha1",
"publicKey": "u7X/zQ/Dq21WW7YH4rbkpiCYJXjPxk5t3qNDKiVwBx8="
}
],
"me": {
"ip": "127.0.0.1",
"name": "da77880a3da4",
"ip": "127.0.0.2",
"name": "iroha1",
"privateKey": "cPY84e0BXGUHBjT4QdlPI0LI3BPIfUfSZjB8jdWURkNQ+pEagT/ysrewbt2YUo/Qbfd5vczW5oDooGSNUBTj9g==",
"publicKey": "u7X/zQ/Dq21WW7YH4rbkpiCYJXjPxk5t3qNDKiVwBx8="
}
Expand Down
19 changes: 9 additions & 10 deletions config/sumeragi2.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"me": {
"ip": "172.18.0.3",
"name": "iroha2",
"privateKey": "SGjvIKNb9sh3H48/Lnid/slxt0H479kpDhZJu/xSfU8sX26lztYqFZTB8pSWL4eLLpx2nDqNr9n44sYkIRYzNQ==",
"publicKey": "yUAFTYNh6qkhBMiNgNdg45Wk/XHOGYanuIroY9skfPQ="},
"group": [
{
"ip": "127.0.0.1",
"name": "da77880a3da4",
"publicKey": "u7X/zQ/Dq21WW7YH4rbkpiCYJXjPxk5t3qNDKiVwBx8="
"ip": "172.18.0.3",
"name": "iroha2",
"publicKey": "yUAFTYNh6qkhBMiNgNdg45Wk/XHOGYanuIroY9skfPQ="
}
],
"me": {
"ip": "127.0.0.1",
"name": "da77880a3da4",
"privateKey": "cPY84e0BXGUHBjT4QdlPI0LI3BPIfUfSZjB8jdWURkNQ+pEagT/ysrewbt2YUo/Qbfd5vczW5oDooGSNUBTj9g==",
"publicKey": "u7X/zQ/Dq21WW7YH4rbkpiCYJXjPxk5t3qNDKiVwBx8="
}
]
}
2 changes: 1 addition & 1 deletion docker/clear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
docker rm `docker ps -a -q -f status=exited`
docker rm $(docker ps -a -q -f status=exited)
docker rmi -f hyperledger/iroha-docker
rm -f $IROHA_HOEM/docker/build/iroha.tar

0 comments on commit 3665339

Please sign in to comment.