diff --git a/packages/composer-website/jekylldocs/index.html b/packages/composer-website/jekylldocs/index.html index 4c8883f39e..fda25559b7 100644 --- a/packages/composer-website/jekylldocs/index.html +++ b/packages/composer-website/jekylldocs/index.html @@ -35,7 +35,7 @@

Build Blockchain applications and business networks your way

-

Update Feb 1st 2018: Version 0.17.3 has been released. Please see the release notes.

+

Update Feb 8th 2018: Version 0.17.4 has been released. Please see the release notes.

diff --git a/packages/composer-website/jekylldocs/tutorials/deploy-to-fabric-multi-org.md b/packages/composer-website/jekylldocs/tutorials/deploy-to-fabric-multi-org.md index 185bdcb516..de5a6c8bfa 100644 --- a/packages/composer-website/jekylldocs/tutorials/deploy-to-fabric-multi-org.md +++ b/packages/composer-website/jekylldocs/tutorials/deploy-to-fabric-multi-org.md @@ -61,21 +61,21 @@ In order to follow this tutorial, you must start up a fresh {{site.data.conrefs. 2. Download the platform binaries, including cryptogen : - curl -sSL https://goo.gl/6wtTN5 | bash -s 1.1.0-alpha + curl -sSL https://goo.gl/6wtTN5 | bash -s 1.1.0-alpha Verify the list of docker images downloaded without issues 3. change directory into `first-network` sample - cd first-network + cd first-network 4. Next, start the BYFN network - additional flags (to the `byfn.sh` script below) must be specified, as we're using CouchDB as the world state database (different to that specified on the Fabric BYFN page) - we also want to start a Certificate Authority (CA) for **each** organization. 5. Execute the following commands in sequence from the `first-network` directory: - ./byfn.sh -m generate - - ./byfn.sh -m up -s couchdb -a + ./byfn.sh -m generate + + ./byfn.sh -m up -s couchdb -a If the command works successfully, the first command will generate Fabric network / security artifacts(see this [link](http://hyperledger-fabric.readthedocs.io/en/release/build_network.html#generate-network-artifacts for more info). Following the second command (above), the BYFN network is started, and verify that you see the following output before proceeding: diff --git a/packages/composer-website/jekylldocs/tutorials/invoke-composer-network.md b/packages/composer-website/jekylldocs/tutorials/invoke-composer-network.md index 9007172553..d5d9e1145a 100644 --- a/packages/composer-website/jekylldocs/tutorials/invoke-composer-network.md +++ b/packages/composer-website/jekylldocs/tutorials/invoke-composer-network.md @@ -10,7 +10,7 @@ sidebar: sidebars/accordion-toc0.md # Invoking a {{site.data.conrefs.composer_full}} business network from another business network {{site.data.conrefs.composer_full}} includes functionality that can be used by a business network to access an asset, participant, or transaction that is recorded in another business network. -This tutorial will demonstrate the steps that a business network developer needs to take in order to invoke a {{site.data.conrefs.composer_full}} business network from a different business network. As part of the tutorial you will deploy the same business network twice. The business networks can be on the same channel or different channels. The business network used in this example will be the tutorial network that is outlined in the [developer tutorial](./developer-tutorial.html). This tutorial will refer to the business networks as "A" and "B" +This tutorial will demonstrate the steps that a business network developer needs to take in order to invoke a {{site.data.conrefs.composer_full}} business network from a different business network. As part of the tutorial you will deploy the same business network twice. The business networks in this tutorial will be on the same channel, but they can be on different channels. The business network used in this example will be the tutorial network that is outlined in the [developer tutorial](./developer-tutorial.html). This tutorial will refer to the business networks as "A" and "B" ## Prerequisites @@ -43,27 +43,14 @@ If these commands fail, then you have business network cards from a previous ver ./createPeerAdminCard.sh -## Step Two: Create a second channel (Optional) +## Step Two: Define the business networks +1. Follow steps one and two in the [developer tutorial](./developer-tutorial.html). This will be network A. -The simple network config used in the previous step only creates one channel by default. If business network B is to be deployed to a different channel, then the channel should be created now by using the Hyperledger Fabric operational tools. +2. Follow steps one and two again but create a business network called `other-tutorial-network`. This will be network B. -After the channel has been created a business network card needs to be created to deploy to this channel. - -1. Create a connection profile that specifies the second channel - -2. To create the business network card run the following commands. - - export PRIVATE_KEY=~/fabric-tools/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk - export CERT=~/fabric-tools/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem - composer card create -p -u PeerAdmin -c ${CERT} -k ${PRIVATE_KEY} -r PeerAdmin -r ChannelAdmin --file otherPeerAdmin@hlfv1.card - composer card import -f otherPeerAdmin@hlfv1.card -n otherPeerAdmin@hlfv1 - -## Step Three: Define the business networks -1. Follow steps one and two in the [developer tutorial](./developer-tutorial.html). If business network A and business network B are being deployed to the same channel then a second business network will need to be created with a different name but with the same model, script and ACL files. This tutorial will assume this will be called `other-tutorial-network`. - -2. The transaction logic needs to be updated to query an asset in business network B and then update the quantity property of an asset in business network A. +3. The transaction logic needs to be updated in network A and to query an asset in business network B and then update the quantity property of an asset in business network A. - Replace the contents of the `logic.js` script file to update the transaction processor function to be the following. Where \ needs to be replaced with either the name of the channel created in step two, or `composerchannel` if the business networks are on the same channel; and where \ is either `tutorial-network` if the networks are on different channels, or `other-tutorial-network` if the network are on the same channel. + Replace the contents of the `logic.js` script file to update the transaction processor function to be the following. /** * Track the trade of a commodity from one trader to another @@ -73,7 +60,7 @@ After the channel has been created a business network card needs to be created t async function tradeCommodity(trade) { trade.commodity.owner = trade.newOwner; - const otherNetworkData = await getNativeAPI().invokeChaincode(, ['getResourceInRegistry', 'Asset', 'org.acme.biznet.Commodity', trade.commodity.tradingSymbol], ); + const otherNetworkData = await getNativeAPI().invokeChaincode('other-tutorial-network', ['getResourceInRegistry', 'Asset', 'org.acme.biznet.Commodity', trade.commodity.tradingSymbol], 'composerchannel'); const stringAsset = new Buffer(otherNetworkData.payload.toArrayBuffer()).toString('utf8'); const asset = getSerializer().fromJSON(JSON.parse(stringAsset)); @@ -83,26 +70,16 @@ After the channel has been created a business network card needs to be created t await assetRegistry.update(trade.commodity); } -3. Follow step three in the [developer tutorial](./developer-tutorial.html). - -4. If business network B is going to be deployed on the same channel as business network A, then repeat steps 1-3 but create a network call `other-tutorial-network`. +4. Follow step three in the [developer tutorial](./developer-tutorial.html). -## Step Four: Deploy the business networks +## Step Three: Deploy the business networks 1. Install and start business network A using the following commands composer runtime install --card PeerAdmin@hlfv1 --businessNetworkName tutorial-network composer network start --card PeerAdmin@hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --archiveFile tutorial-network@0.0.1.bna --file networkA.card composer card import --file networkA.card --name networkA -2. Install and start business network B using the following commands - - If business network B will be on a different channel: - - composer runtime install --card otherPeerAdmin@hlfv1 --businessNetworkName tutorial-network - composer network start --card otherPeerAdmin@hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --archiveFile tutorial-network@0.0.1.bna --file networkB.card - composer card import --file networkB.card --name networkB - - If business network B will be on the same channel: +2. Install and start business network B using the following commands composer runtime install --card PeerAdmin@hlfv1 --businessNetworkName other-tutorial-network composer network start --card PeerAdmin@hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --archiveFile other-tutorial-network@0.0.1.bna --file networkB.card @@ -113,7 +90,7 @@ After the channel has been created a business network card needs to be created t composer network ping --card networkA composer network ping --card networkB -## Step Five: Create the assets +## Step Four: Create the assets 1. Create a participant in business network A. Run the following command. @@ -131,20 +108,20 @@ After the channel has been created a business network card needs to be created t composer transaction submit --card networkB -d '{"$class": "org.hyperledger.composer.system.AddAsset","registryType": "Asset","registryId": "org.acme.biznet.Commodity", "targetRegistry" : "resource:org.hyperledger.composer.system.AssetRegistry#org.acme.biznet.Commodity", "resources": [{"$class": "org.acme.biznet.Commodity","tradingSymbol": "Ag","owner": "resource:org.acme.biznet.Trader#fred@example.com","description": "a lot of gold", "mainExchange": "exchange", "quantity" : 500}]}' -## Step Six: Bind the identity on network A to the participant on network B +## Step Five: Bind the identity on network A to the participant on network B 1. Export the networkA card to get the credentials composer card export -n networkA -2. Unzip the card +2. Unzip the card, you may need to rename networkA.card to networkA.zip. 3. Bind the identity to the participant. Run the following command. composer identity bind --card networkB --participantId resource:org.hyperledger.composer.system.NetworkAdmin#admin --certificateFile ./networkA/credentials/certificate -4. Create a card with the bound identity. Where \ should be the one to connect to networkB and \ should be the name of business network B +4. Create a card with the bound identity. - composer card create -p \ --businessNetworkName -u admin -c ./networkA/credentials/certificate -k ./networkA/credentials/privateKey -f newNetworkB.card + composer card create -p ~/.composer/cards/networkB/connection.json --businessNetworkName other-tutorial-network -u admin -c ./networkA/credentials/certificate -k ./networkA/credentials/privateKey -f newNetworkB.card 5. Import the card @@ -153,6 +130,12 @@ After the channel has been created a business network card needs to be created t 6. Ping the network to activate the identity composer network ping --card newNetworkB + +## Step Six: Review the asset data + +View the asset to see that the quantity is 250. + + composer network list --card networkA -r org.acme.biznet.Commodity -a Ag ## Step Seven: Submit a transaction diff --git a/packages/composer-website/jekylldocs/tutorials/tutorials.md b/packages/composer-website/jekylldocs/tutorials/tutorials.md index 2d62a2e302..5f3f0023f1 100644 --- a/packages/composer-website/jekylldocs/tutorials/tutorials.md +++ b/packages/composer-website/jekylldocs/tutorials/tutorials.md @@ -12,7 +12,7 @@ excerpt: Tutorials --- -We have two basic tutorial options, and one more advanced tutorial: +We have four basic tutorial options, and two more advanced tutorials: ## Playground Tutorial @@ -30,6 +30,10 @@ The developer tutorial will walk you through the steps required to build a {{sit [**Start Developer Tutorial**](../tutorials/developer-tutorial.html). +## Access Control Language (ACL) Tutorial +This tutorial presumes that you have some experience using {{site.data.conrefs.composer_short}}. +In this tutorial, you will incrementally build ACL rules for a sample Commodity Trading business network, and test the ACLs as an integral step during the rules build. You can complete the tutorial in the online Playground (and you deploy the Trade sample network there) ; but you can equally complete the tutorial if you deploy that sample network to your {site.data.conrefs.hlf_full}} runtime. + ## Query Tutorial This tutorial presumes that you have some experience using {{site.data.conrefs.composer_short}}. @@ -54,4 +58,10 @@ In this tutorial, two organization administrators configure their instances of { [**Start the multi-organization {{site.data.conrefs.hlf_full}} deployment tutorial**](../tutorials/deploy-to-fabric-multi-org.html). +## Invoking a {{site.data.conrefs.composer_full}} business network from another business network + +In this tutorial, we will demonstrate the steps that a business network developer needs to take in order to invoke a {{site.data.conrefs.composer_full}} business network from a different business network + +[**Start the invoking a {{site.data.conrefs.composer_full}} business network from another business network tutorial**](../tutorials/invoke-composer-network.html). + ---