Skip to content

Commit

Permalink
BE-467 Create docker image
Browse files Browse the repository at this point in the history
Change-Id: I38e3fc8f4cc85bb2aa753774389b649b0b22dfe2
Signed-off-by: nfrunza <nfrunza@gmail.com>
  • Loading branch information
nfrunza committed Oct 4, 2018
1 parent fae61b1 commit 5f93474
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ There is also an automated deployment of the **Hyperledger Explorer** available

## Docker

* Hyperledger Explorer docker repository `https://hub.docker.com/r/hyperledger/explorer/`
* Hyperledger Explorer PostgreSQL docker repository `https://hub.docker.com/r/hyperledger/explorer-db`

### Steps to deploy using Docker

From new terminal.
Expand Down
8 changes: 4 additions & 4 deletions deploy_explorer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ function config(){
subnet=192.168.10.0/24

# database container configuration
fabric_explorer_db_tag="hyperledger-blockchain-explorer-db"
fabric_explorer_db_tag="hyperledger/explorer-db"
fabric_explorer_db_name="blockchain-explorer-db"
db_ip=192.168.10.11

# fabric explorer configuratio
fabric_explorer_tag="hyperledger-blockchain-explorer"
fabric_explorer_tag="hyperledger/explorer"
fabric_explorer_name="blockchain-explorer"
explorer_ip=192.168.10.12
# END: GLOBAL VARIABLES OF THE SCRIPT
Expand Down Expand Up @@ -190,8 +190,8 @@ function deploy_run_explorer(){
-e DATABASE_PASSWD=$explorer_db_pwd \
-v $network_config_file:/opt/explorer/app/platform/fabric/config.json \
-v $network_crypto_base_path:/tmp/crypto \
-p 8080:8080 \
hyperledger-blockchain-explorer
-p 8090:8080 \

This comment has been minimized.

Copy link
@zhihua1607

zhihua1607 Jan 28, 2019

8090 port is error. the appconfig.json default port is 8080.

This comment has been minimized.

Copy link
@nfrunza

nfrunza via email Jan 28, 2019

Author Contributor
$fabric_explorer_tag
}

function connect_to_network(){
Expand Down
43 changes: 35 additions & 8 deletions examples/net1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ Note: Make sure you put the right node IPs, ports and certs paths before running
"path":
"/tmp/crypto/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
},
"url": "grpcs://peer1.org1.example.com:8051",
"eventUrl": "grpcs://peer1.org1.example.com:8053",
"url": "grpcs://peer1.org1.example.com:7051",
"eventUrl": "grpcs://peer1.org1.example.com:7053",
"grpcOptions": {
"ssl-target-name-override": "peer1.org1.example.com"
}
Expand All @@ -287,8 +287,8 @@ Note: Make sure you put the right node IPs, ports and certs paths before running
"path":
"/tmp/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt"
},
"url": "grpcs://peer0.org2.example.com:9051",
"eventUrl": "grpcs://peer0.org2.example.com:9053",
"url": "grpcs://peer0.org2.example.com:7051",
"eventUrl": "grpcs://peer0.org2.example.com:7053",
"grpcOptions": {
"ssl-target-name-override": "peer0.org2.example.com"
}
Expand All @@ -298,8 +298,8 @@ Note: Make sure you put the right node IPs, ports and certs paths before running
"path":
"/tmp/crypto/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt"
},
"url": "grpcs://peer1.org2.example.com:10051",
"eventUrl": "grpcs://peer1.org2.example.com:10053",
"url": "grpcs://peer1.org2.example.com:7051",
"eventUrl": "grpcs://peer1.org2.example.com:7053",
"grpcOptions": {
"ssl-target-name-override": "peer1.org2.example.com"
}
Expand All @@ -319,5 +319,32 @@ Note: Make sure you put the right node IPs, ports and certs paths before running

4. in case if port 8080 is occupied in your system, the `deploy_explorer.sh` should be updated. Please update the line 193
`-p 8080:8080 \` to `-p <port>:8080 \`, where <port> is a free port, where BE can be browsed.
5. issue `./deploy_explorer.sh <your_folder> net_byfn` and wait.
6. open the browser `http://localhost:<port>` and explore the blockchain network.
5. issue `./deploy_explorer.sh <your_folder> net_byfn` and wait, example: `./deploy_explorer.sh net1 net_byfn`
6. open the browser `http://localhost:<port>` and explore the blockchain network.

### Docker Troubleshooting commands
List your networks
$docker network ls
List docker images id
$docker images | grep block
Remove an image
$docker rmi <image_id>
Login to docker
$docker exec -it <image_id> sh
Read explorer app log
$docker exec <image_id> cat /opt/logs/app/app.log
Inspect real IP's
$docker inspect <image_id> | grep IPAddress
Stop and remove dockers
$docker stop $(docker ps -a -q)
$docker rm -f $(docker ps -a -q)
Remove default fabric crypto
$rm -rf ./crypto-config/*
$rm -rf ~/.hfc*
From the docker ($docker exec -it <image_id> sh)
Install curl:
$apk update && apk add curl
Use curl in docker to query explorer REST API
Example:
$curl http://localhost:8080/api/channels
Example response: {"status":200,"channels":["dockerchannel","mychannel"]

0 comments on commit 5f93474

Please sign in to comment.