hyperledger / hyperledger/fabric-samples

test network incorrectly recreates a fabric network when creating a channel

Open
#1,243 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
3k
Forks
3.5k
Avg merge
3d 20h
Merged PRs (30d)
6

Description

Doing the following
```
./network.sh up -s couchdb
./network.sh createChannel -c mychannel
```

results in the fabric network being recreated by the createChannel command using levelDB. The reason for this is due to this check in the `createChannel` Function of `network.sh`

```
[[ $len -lt 4 ]] || [[ ! -d "organizations/peerOrganizations" ]] && bringUpNetwork="true" || echo "Network Running Already"
```

as no fabric-tools image now pulled and launched the check that there are less than 4 images running is not correct.

I do have to question as to why does the createChannel attempt to start a network if no network exists ? The paradigm of doing a single action may be better here and just have the up command do it

But as of now it is wrong so a quick fix would be
```
[[ $len -lt 3 ]] || [[ ! -d "organizations/peerOrganizations" ]] && bringUpNetwork="true" || echo "Network Running Already"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.