From ef68e9c48b6cea8b88ee6ed93044dd428146bb99 Mon Sep 17 00:00:00 2001 From: Julian Castrence Date: Mon, 7 Dec 2020 12:29:33 -0500 Subject: [PATCH] Remove Short Names and Replace With Full Path in Fabric Signed-off-by: Julian Castrence --- docs/source/channel_update_tutorial.rst | 2 +- docs/source/couchdb_tutorial.rst | 2 +- docs/source/create_channel/create_channel.md | 2 +- docs/source/private_data_tutorial.rst | 1 + ...secured_private_asset_transfer_tutorial.md | 2 +- docs/source/test_network.md | 31 ++++++++++++------- docs/source/write_first_app.rst | 2 +- 7 files changed, 25 insertions(+), 17 deletions(-) diff --git a/docs/source/channel_update_tutorial.rst b/docs/source/channel_update_tutorial.rst index bb119620427..8c53807665e 100644 --- a/docs/source/channel_update_tutorial.rst +++ b/docs/source/channel_update_tutorial.rst @@ -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 diff --git a/docs/source/couchdb_tutorial.rst b/docs/source/couchdb_tutorial.rst index b59cf533cf8..e4bd749b183 100644 --- a/docs/source/couchdb_tutorial.rst +++ b/docs/source/couchdb_tutorial.rst @@ -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/ -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 diff --git a/docs/source/create_channel/create_channel.md b/docs/source/create_channel/create_channel.md index 136fd53a67e..e66733bd62b 100644 --- a/docs/source/create_channel/create_channel.md +++ b/docs/source/create_channel/create_channel.md @@ -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/ -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. diff --git a/docs/source/private_data_tutorial.rst b/docs/source/private_data_tutorial.rst index 73320176352..fda32db9fae 100644 --- a/docs/source/private_data_tutorial.rst +++ b/docs/source/private_data_tutorial.rst @@ -317,6 +317,7 @@ to package the marbles chaincode. The test network includes two organizations, Org1 and Org2, with one peer each. Therefore, the chaincode package has to be installed on two peers: + ./network.sh deployCC -ccn private -ccp ../asset-transfer-private-data/chaincode-go/ -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg ../asset-transfer-private-data/chaincode-go/collections_config.json - peer0.org1.example.com - peer0.org2.example.com diff --git a/docs/source/secured_asset_transfer/secured_private_asset_transfer_tutorial.md b/docs/source/secured_asset_transfer/secured_private_asset_transfer_tutorial.md index ba816b7224d..1639caa6609 100644 --- a/docs/source/secured_asset_transfer/secured_private_asset_transfer_tutorial.md +++ b/docs/source/secured_asset_transfer/secured_private_asset_transfer_tutorial.md @@ -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/ -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. diff --git a/docs/source/test_network.md b/docs/source/test_network.md index 02802767fdf..d8ccc09671e 100644 --- a/docs/source/test_network.md +++ b/docs/source/test_network.md @@ -53,17 +53,23 @@ Usage: -c - channel name to use (defaults to "mychannel") -s - the database backend to use: goleveldb (default) or couchdb -r - CLI times out after certain number of attempts (defaults to 5) - -d - delay duration in seconds (defaults to 3) - -ccn - the short name of the chaincode to deploy: basic (default),ledger, private, secured - -ccl - the programming language of the chaincode to deploy: go (default), java, javascript, typescript - -ccv - chaincode version. 1.0 (default) - -ccs - chaincode definition sequence. Must be an integer, 1 (default), 2, 3, etc - -ccp - 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 - 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 - the tag to be used to launch the network (defaults to "latest") - -cai - the image tag to be used for CA (defaults to "latest") - -verbose - verbose mode - -h - print this message + -d - CLI delays for a certain number of seconds (defaults to 3) + -i - Docker image tag of Fabric to deploy (defaults to "latest") + -cai - Docker image tag of Fabric CA to deploy (defaults to "latest") + -verbose - Verbose mode + + Used with network.sh deployCC + -c - Name of channel to deploy chaincode to + -ccn - Chaincode name. + -ccl - Programming language of the chaincode to deploy: go (default), java, javascript, typescript + -ccv - Chaincode version. 1.0 (default), v2, version3.x, etc + -ccs - Chaincode definition sequence. Must be an integer, 1 (default), 2, 3, etc + -ccp - File path to the chaincode. + -ccep - (Optional) Chaincode endorsement policy using signature policy syntax. The default policy requires an endorsement from Org1 and Org2 + -cccg - (Optional) File path to private data collections configuration file + -cci - (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 Possible Mode and flag combinations up -ca -c -r -d -s -i -verbose @@ -77,7 +83,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 diff --git a/docs/source/write_first_app.rst b/docs/source/write_first_app.rst index 94dfee98fa1..d6b92621b35 100644 --- a/docs/source/write_first_app.rst +++ b/docs/source/write_first_app.rst @@ -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.