Skip to content

Commit

Permalink
Multi-Org 1.2 changes, TP docs changes (hyperledger-archives#4318)
Browse files Browse the repository at this point in the history
* Use different fabric-samples repo to support BYFN/EYFN
* Add information about REST API @returns in TP functions

Signed-off-by: Paul O'M <[email protected]>
  • Loading branch information
Paul O'M authored and bestbeforetoday committed Aug 9, 2018
1 parent c754012 commit 4687ddc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/composer-website/jekylldocs/reference/js_scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ async function simpleNativeHistoryTransaction (transaction) {

## Returning data from transaction processor functions

Transaction processor functions can optionally return data to client applications. This can be useful for returning a receipt to the submitter of the transaction, or returning an asset modified by the transaction to avoid a separate lookup of the asset after the transaction has been committed.
Transaction processor functions can optionally return data to client applications. This can be useful for returning a receipt to the submitter of the transaction, or returning an asset modified by the transaction to avoid a separate lookup of the asset after the transaction has been committed. Data can also be returned to the client application via a transaction REST API for the business network, eg a POST method to return data (as described below) to the client application.

The return data for a transaction processor function must be a valid type, either a primitive type (String, Integer, Long, etc.), or a type modelled using the Composer modelling language - a concept, asset, participant, transaction, event or enumeration.

Expand Down Expand Up @@ -600,7 +600,7 @@ Transaction processor function:
const assetRegistry = await getAssetRegistry('org.sample.MyAsset');
const localAssets = await assetRegistry.getAll();
for (const asset of localAssets) {
localAssets.push(asset);
allAssets.push(asset);
}
const businessNetworkNames = ['other-network-1', 'other-network-2'];
for (const businessNetworkName of businessNetworkNames) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ If you have previously installed the Composer development environment, you will
./stopFabric.sh
./teardownFabric.sh

Next, clone the following GitHub Fabric Samples repository using the command line (do not use the samples from the [Fabric site:](http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html) as it is missing some changes that are required for this tutorial)
Next, clone the following GitHub Fabric Samples repository using the command line (IMPORTANT: DO NOT USE the samples from the [Fabric site:](http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html) as it is missing some changes that are required for this tutorial)

git clone -b issue-6978 https://github.com/sstone1/fabric-samples.git
git clone https://github.com/mahoney1/fabric-samples.git

We are using the [Building Your First Network](http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html) Fabric sample network for this multi-org tutorial. We will refer to this {{site.data.conrefs.hlf_full}} network as the 'BYFN' (Building Your First Network) network henceforth. If you choose to split your organisations across separate physical machines or separate virtual machines running on different IP networks, it is outside the scope of this particular tutorial.

Expand All @@ -66,15 +66,19 @@ In order to follow this tutorial, you must start up a fresh {{site.data.conrefs.

Verify the list of docker images downloaded without issues.

(Please note that you can ignore the initial "error: pathspec v1.1.0 did not match" message in the output for now)
(Please note that you can ignore the initial "error: pathspec v1.x.x did not match" message in the output - you may not even see this message)

3. change directory into `first-network` sample
3. We need to use the 'multi-org' branch from the Git repo we cloned earlier (to work with current Fabric level):

git checkout multi-org
4. change directory into `first-network` sample

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. 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:
6. Execute the following commands in sequence from the `first-network` directory:

./byfn.sh -m generate

Expand Down

0 comments on commit 4687ddc

Please sign in to comment.