You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are interested in learning more about the sample network, you can investigate the files and scripts in the test-network directory. The steps below provide a guided tour of what happens when you issue the command of ./network.sh up.
31
+
32
+
*`./network.sh` creates the certificates and keys for two peer organizations and the orderer organization. By default, the script uses the cryptogen tool using the configuration files located in the `organizations/cryptogen` folder. If you use the `-ca` flag to create Certificate Authorities, the script uses Fabric CA server configuration files and registerEnroll.sh script located in the `organizations/fabric-ca` folder. Both cryptogen and the Fabric CAs create the crypto material and MSP folders for all three organizations in the organizations folder.
33
+
* Once the organization crypto material has been generated, the `network.sh` can bring up the nodes of the network. The script uses the `docker-compose-test-net.yaml` file in the docker folder to create the peer and orderer nodes. The docker folder also contains the `docker-compose-e2e.yaml` file that brings up the nodes of the network alongside three Fabric CAs.
34
+
* If you use the createChannel subcommand, `./network.sh` runs the createChannel.sh script in the scripts folder to create a channel using the supplied channel name. The script uses the configtxgen tool to create the channel genesis block based on the TwoOrgsApplicationGenesis channel profile in the `configtx/configtx.yaml` file. After creating the channel, the script uses the peer cli to join `peer0.org1.example.com` and `peer0.org2.example.com` to the channel, and make both of the peers anchor peers.
35
+
* If you issue the `deployCC` command, `./network.sh` runs the `deployCC.sh` script to install the asset-transfer (basic) chaincode on both peers and then define then chaincode on the channel. Once the chaincode definition is committed to the channel, the peer cli initializes the chaincode using the Init and invokes the chaincode to put initial data on the ledger.
36
+
37
+
## Running the test network with cryptogen tool
38
+
39
+
### Run the test network
29
40
30
41
```bash
31
42
cd fabric-samples/test-network
@@ -34,6 +45,68 @@ cd fabric-samples/test-network
34
45
docker ps -a
35
46
```
36
47
48
+
### Create a channel
49
+
50
+
```bash
51
+
./network.sh createChannel
52
+
```
53
+
54
+
### Deploy the chaincode
55
+
56
+
The `deployCC` subcommand will install the `asset-transfer (basic)` chaincode on `peer0.org1.example.com` and `peer0.org2.example.com` and then deploy the chaincode on the channel specified using the channel flag (or mychannel if no channel is specified)
57
+
58
+
```bash
59
+
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go
60
+
```
61
+
62
+
### Interact with the chaincode
63
+
64
+
Because the endorsement policy for the asset-transfer (basic) chaincode requires the transaction to be `signed by Org1 and Org2`, the chaincode invoke command needs to target both `peer0.org1.example.com` and `peer0.org2.example.com` using the --peerAddresses flag
0 commit comments