From 2a8d96c9566d22da9875aa8ffa7ba69f8dd23977 Mon Sep 17 00:00:00 2001 From: Julian Castrence Date: Wed, 16 Dec 2020 16:34:18 -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 | 2 +- ...secured_private_asset_transfer_tutorial.md | 2 +- docs/source/test_network.md | 35 +++++-------------- docs/source/write_first_app.rst | 2 +- 7 files changed, 15 insertions(+), 32 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..185ce486be0 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/ -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 diff --git a/docs/source/create_channel/create_channel.md b/docs/source/create_channel/create_channel.md index 136fd53a67e..64f63ccd7e9 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/ -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. diff --git a/docs/source/private_data_tutorial.rst b/docs/source/private_data_tutorial.rst index 28901f5bc29..360a84e8004 100644 --- a/docs/source/private_data_tutorial.rst +++ b/docs/source/private_data_tutorial.rst @@ -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 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..a0c34ececf1 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/ -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. diff --git a/docs/source/test_network.md b/docs/source/test_network.md index afdbdcb709f..7c7b660494f 100644 --- a/docs/source/test_network.md +++ b/docs/source/test_network.md @@ -48,23 +48,6 @@ Usage: down - Bring down the network Flags: -<<<<<<< HEAD - -ca - create Certificate Authorities to generate the crypto material - -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 -======= Used with network.sh up, network.sh createChannel: -ca - Use Certificate Authorities to generate network crypto material -c - Name of channel to create (defaults to "mychannel") @@ -77,17 +60,16 @@ Usage: Used with network.sh deployCC -c - Name of channel to deploy chaincode to - -ccn - 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 - 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 - (Optional) File path to the chaincode. When provided, the -ccn flag will be used only for the chaincode name. + -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 ->>>>>>> 9adde2e7d... Update help text in test net tutorial Possible Mode and flag combinations up -ca -r -d -s -i -cai -verbose @@ -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 @@ -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: ``` @@ -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 @@ -676,4 +659,4 @@ channel on [Hyperledger Rocket Chat](https://chat.hyperledger.org/home) or on [StackOverflow](https://stackoverflow.com/questions/tagged/hyperledger-fabric). +https://creativecommons.org/licenses/by/4.0/ --> \ No newline at end of file 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.