Skip to content

Commit 6663dc0

Browse files
committed
[FAB-3161] Enhance cluster-creation reporting
It will likely be helpful to the user to display a more obvious "success" message along with key details about the created cluster (such as IP addresses). This patch adds the following report: ======================================================================== Cluster ready! ======================================================================== 172.18.0.2 ca 172.18.0.3 orderer 172.18.0.4 peer1 172.18.0.5 peer2 172.18.0.6 peer3 172.18.0.7 peer4 Change-Id: I8228b0d439ec5bd71f5ddb0774888b02b978955a Signed-off-by: Gregory Haskins <[email protected]>
1 parent 31bce9c commit 6663dc0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

examples/cluster/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ help:
4141
@cat usage.txt
4242

4343
compose-up: nodes
44+
@echo "Booting docker-compose environment"
4445
$(COMPOSE) up -d ca $(PEERS)
4546
$(DRUN) ./configure.sh $(CHANNEL_NAME) "$(CHANNEL_TXNS)" "$(PEERS)" $(TLS)
47+
@./compose/report-env.sh "$(filter-out cli,$(NODES)")
4648

4749
compose-down:
4850
$(COMPOSE) down
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
NODES=$1
4+
5+
getip() {
6+
HOST=$1
7+
8+
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $HOST
9+
}
10+
11+
generate_hosts() {
12+
for NODE in $NODES; do
13+
echo "$(getip $NODE) $NODE"
14+
done
15+
}
16+
17+
echo "========================================================================"
18+
echo "Cluster ready!"
19+
echo "========================================================================"
20+
echo
21+
generate_hosts | sort

0 commit comments

Comments
 (0)