Skip to content

Commit 36e9795

Browse files
committed
Improve simple-testing-network to check if monitoring should be enabled or not.
Signed-off-by: munapower <mmunaro@hotmail.com>
1 parent 8ce969b commit 36e9795

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

samples/deployment/fabric-smart-client/the-simple-testing-network/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ make run
3838
go run . network start --path ./testdata
3939
```
4040
Once the network is up and running, use a second terminal to interact with the network.
41-
Uou can shut down the network using `CTRL+C`.
41+
You can shut down the network using `CTRL+C`.
4242

4343
To clean up the network you can run `make clean` or `go run . network clean --path ./testdata`.
4444

@@ -75,7 +75,10 @@ You can switch the user by running `./env.sh` either with `Org1` or `Org2`.
7575

7676
The test network includes a Hyperledger Blockchain explorer that you can use to see what is happening on the network.
7777
By default, you can reach the Blockchain Explorer Dashboard via your browser on `http://localhost:8080` with username `admin` and password `admin`.
78-
78+
You can disable adding it by setting the `BE_INSTALL` environment variable to `NO`.
79+
```bash
80+
export BE_INSTALL=NO
81+
```
7982

8083
### Troubleshooting
8184

samples/deployment/fabric-smart-client/the-simple-testing-network/topology.go

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const (
2424
defaultChaincodeImageTag = "latest"
2525
defaultChaincodeMRENCLAVE = "fakeMRENCLAVE"
2626
defaultLoggingSpec = "info"
27+
defaultBlockchainExplorer = "YES"
2728
)
2829

2930
func Fabric() []api.Topology {
@@ -41,16 +42,18 @@ func Fabric() []api.Topology {
4142
// bring hyperledger explorer into the game
4243
// you can reach it http://localhost:8080 with admin:admin
4344
monitoringTopology := monitoring.NewTopology()
44-
monitoringTopology.EnableHyperledgerExplorer()
45-
45+
if config.blockchainExplorer == "YES" {
46+
monitoringTopology.EnableHyperledgerExplorer()
47+
}
4648
return []api.Topology{fabricTopology, fsc.NewTopology(), monitoringTopology}
4749
}
4850

4951
type config struct {
50-
loggingSpec string
51-
chaincodeName string
52-
chaincodeImage string
53-
fpcOptions []func(chaincode *topology.ChannelChaincode)
52+
loggingSpec string
53+
chaincodeName string
54+
chaincodeImage string
55+
blockchainExplorer string
56+
fpcOptions []func(chaincode *topology.ChannelChaincode)
5457
}
5558

5659
// setup prepares a config helper struct, containing some additional configuration that can be injected via environment variables
@@ -75,6 +78,12 @@ func setup() *config {
7578
config.chaincodeImage = fmt.Sprintf("%s:%s", defaultChaincodeImageName, defaultChaincodeImageTag)
7679
}
7780

81+
// export BE_INSTALL=YES or NO
82+
config.blockchainExplorer = os.Getenv("BE_INSTALL")
83+
if len(config.blockchainExplorer) == 0 {
84+
config.blockchainExplorer = defaultBlockchainExplorer
85+
}
86+
7887
// get mrenclave
7988
mrenclave := os.Getenv("FPC_MRENCLAVE")
8089
if len(mrenclave) == 0 {

0 commit comments

Comments
 (0)