Skip to content

Commit

Permalink
Remove Short Names and Replace With Full Path in Fabric
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Castrence <juliancastrence@ibm.com>
  • Loading branch information
jrc-ibm authored and denyeart committed Dec 18, 2020
1 parent b2a5aec commit 2a8d96c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 32 deletions.
2 changes: 1 addition & 1 deletion docs/source/channel_update_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ use the ``test-network`` script to deploy the Basic chaincode:
.. code:: bash
cd fabric-samples/test-network
./network.sh deployCC -ccn basic -ccl go
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go/ -ccl go
The script will install the Basic chaincode on the Org1 and Org2 peers, approve
the chaincode definition for Org1 and Org2, and then commit the chaincode
Expand Down
2 changes: 1 addition & 1 deletion docs/source/couchdb_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ Run the following command to deploy the smart contract to `mychannel`:

.. code:: bash
./network.sh deployCC -ccn ledger -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
./network.sh deployCC -ccn ledger -ccp ../asset-transfer-ledger-queries/chaincode-go/ -ccl go -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
Note that we are using the `-ccep` flag to deploy the smart contract with an endorsement policy of
`"OR('Org1MSP.peer','Org2MSP.peer')"`. This allows either organization to create an asset without
Expand Down
2 changes: 1 addition & 1 deletion docs/source/create_channel/create_channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ Blockchain info: {"height":3,"currentBlockHash":"eBpwWKTNUgnXGpaY2ojF4xeP3bWdjlP
We can confirm that the channel was created successfully by deploying a chaincode to the channel. We can use the `network.sh` script to deploy the Basic asset transfer chaincode to any test network channel. Deploy a chaincode to our new channel using the following command:
```
./network.sh deployCC --ccn basic -c channel1 --cci InitLedger
./network.sh deployCC --ccn basic -ccp ../asset-transfer-basic/chaincode-go/ -ccl go -c channel1 --cci InitLedger
```
After you run the command, you should see the chaincode being deployed to the channel in your logs. The chaincode is invoked to add data to the channel ledger.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/private_data_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ Run the following command from the test network directory.

.. code:: bash
./network.sh deployCC -ccn private -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg ../asset-transfer-private-data/chaincode-go/collections_config.json
./network.sh deployCC -ccn private -ccp ../asset-transfer-private-data/chaincode-go/ -ccl go -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg ../asset-transfer-private-data/chaincode-go/collections_config.json
Note that we need to pass the path to the private data collection definition file
to the command. As part of deploying the chaincode to the channel, both organizations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ The script will deploy the nodes of the network and create a single channel name

You can use the test network script to deploy the secured asset transfer smart contract to the channel. Run the following command to deploy the smart contract to `mychannel`:
```
./network.sh deployCC -ccn secured -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
./network.sh deployCC -ccn secured -ccp ../asset-transfer-secured-agreement/chaincode-go/ -ccl go -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
```

Note that we are using the `-ccep` flag to deploy the smart contract with an endorsement policy of `"OR('Org1MSP.peer','Org2MSP.peer')"`. This allows either organization to create an asset without receiving an endorsement from the other organization.
Expand Down
35 changes: 9 additions & 26 deletions docs/source/test_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,6 @@ Usage:
down - Bring down the network
Flags:
<<<<<<< HEAD
-ca <use CAs> - create Certificate Authorities to generate the crypto material
-c <channel name> - channel name to use (defaults to "mychannel")
-s <dbtype> - the database backend to use: goleveldb (default) or couchdb
-r <max retry> - CLI times out after certain number of attempts (defaults to 5)
-d <delay> - delay duration in seconds (defaults to 3)
-ccn <name> - the short name of the chaincode to deploy: basic (default),ledger, private, secured
-ccl <language> - the programming language of the chaincode to deploy: go (default), java, javascript, typescript
-ccv <version> - chaincode version. 1.0 (default)
-ccs <sequence> - chaincode definition sequence. Must be an integer, 1 (default), 2, 3, etc
-ccp <path> - Optional, chaincode path. Path to the chaincode. When provided the -ccn will be used as the deployed name and not the short name of the known chaincodes.
-cci <fcn name> - Optional, chaincode init required function to invoke. When provided this function will be invoked after deployment of the chaincode and will define the chaincode as initialization required.
-i <imagetag> - the tag to be used to launch the network (defaults to "latest")
-cai <ca_imagetag> - the image tag to be used for CA (defaults to "latest")
-verbose - verbose mode
-h - print this message
=======
Used with network.sh up, network.sh createChannel:
-ca <use CAs> - Use Certificate Authorities to generate network crypto material
-c <channel name> - Name of channel to create (defaults to "mychannel")
Expand All @@ -77,17 +60,16 @@ Usage:
Used with network.sh deployCC
-c <channel name> - Name of channel to deploy chaincode to
-ccn <name> - Chaincode name. This flag can be used to deploy one of the asset transfer samples to a channel. Sample options: basic (default),ledger, private, sbe, secured
-ccn <name> - Chaincode name.
-ccl <language> - Programming language of the chaincode to deploy: go (default), java, javascript, typescript
-ccv <version> - Chaincode version. 1.0 (default), v2, version3.x, etc
-ccs <sequence> - Chaincode definition sequence. Must be an integer, 1 (default), 2, 3, etc
-ccp <path> - (Optional) File path to the chaincode. When provided, the -ccn flag will be used only for the chaincode name.
-ccp <path> - File path to the chaincode.
-ccep <policy> - (Optional) Chaincode endorsement policy using signature policy syntax. The default policy requires an endorsement from Org1 and Org2
-cccg <collection-config> - (Optional) File path to private data collections configuration file
-cci <fcn name> - (Optional) Name of chaincode initialization function. When a function is provided, the execution of init will be requested and the function will be invoked.
-h - Print this message
>>>>>>> 9adde2e7d... Update help text in test net tutorial
Possible Mode and flag combinations
up -ca -r -d -s -i -cai -verbose
Expand All @@ -98,7 +80,8 @@ Usage:
Examples:
network.sh up createChannel -ca -c mychannel -s couchdb -i 2.0.0
network.sh createChannel -c channelName
network.sh deployCC -ccn basic -ccl javascript
network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript/ -ccl javascript
network.sh deployCC -ccn mychaincode -ccp ./user/mychaincode -ccv 1 -ccl javascript
```

From inside the `test-network` directory, run the following command to remove
Expand Down Expand Up @@ -308,7 +291,7 @@ export CORE_PEER_ADDRESS=localhost:7051
The `CORE_PEER_TLS_ROOTCERT_FILE` and `CORE_PEER_MSPCONFIGPATH` environment
variables point to the Org1 crypto material in the `organizations` folder.

If you used `./network.sh deployCC` to install and start the asset-transfer (basic) chaincode, you can invoke the `InitLedger` function of the (Go) chaincode to put an initial list of assets on the ledger (if using typescript or javascript `./network.sh deployCC -l javascript` for example, you will invoke the `InitLedger` function of the respective chaincodes).
If you used `./network.sh deployCC` to install and start the asset-transfer (basic) chaincode, you can invoke the `InitLedger` function of the (Go) chaincode to put an initial list of assets on the ledger (if using typescript or javascript `./network.sh deployCC -ccl javascript` for example, you will invoke the `InitLedger` function of the respective chaincodes).

Run the following command to initialize the ledger with assets:
```
Expand Down Expand Up @@ -503,12 +486,12 @@ organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/
├── IssuerPublicKey
├── IssuerRevocationPublicKey
├── cacerts
   └── localhost-7054-ca-org1.pem
└── localhost-7054-ca-org1.pem
├── config.yaml
├── keystore
   └── 58e81e6f1ee8930df46841bf88c22a08ae53c1332319854608539ee78ed2fd65_sk
└── 58e81e6f1ee8930df46841bf88c22a08ae53c1332319854608539ee78ed2fd65_sk
├── signcerts
   └── cert.pem
└── cert.pem
└── user
```
You can find the certificate of the admin user in the `signcerts` folder and the
Expand Down Expand Up @@ -676,4 +659,4 @@ channel on [Hyperledger Rocket Chat](https://chat.hyperledger.org/home) or on
[StackOverflow](https://stackoverflow.com/questions/tagged/hyperledger-fabric).

<!--- Licensed under Creative Commons Attribution 4.0 International License
https://creativecommons.org/licenses/by/4.0/ -->
https://creativecommons.org/licenses/by/4.0/ -->
2 changes: 1 addition & 1 deletion docs/source/write_first_app.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Next, let's deploy the chaincode by calling the ``./network.sh`` script with the

.. code:: bash
./network.sh deployCC -ccn basic -ccl javascript
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript/ -ccl javascript
.. note:: Behind the scenes, this script uses the chaincode lifecycle to package, install,
query installed chaincode, approve chaincode for both Org1 and Org2, and finally commit the chaincode.
Expand Down

0 comments on commit 2a8d96c

Please sign in to comment.