diff --git a/packages/composer-website/jekylldocs/applications/subscribing-to-events.md b/packages/composer-website/jekylldocs/applications/subscribing-to-events.md new file mode 100644 index 0000000000..b303d87261 --- /dev/null +++ b/packages/composer-website/jekylldocs/applications/subscribing-to-events.md @@ -0,0 +1,34 @@ +--- +layout: default +title: Subscribing to events +category: tasks +sidebar: sidebars/applications.md +excerpt: Subscribing to events +--- + +# Subscribing to events + +Applications can subscribe to events from a business network by using the `composer-client.BusinessNetworkConnection.on` API call. Events are defined in the business network model file and are emitted by specified transactions in the transaction processor function file. For more information on publishing events, see [publishing events](../business-network/publishing-events.html). + +## Before you begin + +Before an application can subscribe to events, you must have defined some events and the transactions which will emit them. The business network must also be deployed and you must have connected to it. Follow the steps for [connecting to the {{site.data.conrefs.composer_full}} runtime](../applications/getting-started-nodejs-app.html). + +## Procedure + +1. An application must send a specific API call to subscribe to events emitted transactions in a business network. Currently, an application which subscribes to events will receive all events which are emitted. The API call should take the following format: + + ```Javascript + businessNetworkConnection.on('event', (event) => { + // event: { "$class": "org.namespace.BasicEvent", "eventId": "0000-0000-0000-000000#0" } + console.log(event); + }); + ``` + + This includes an event called `BasicEvent` which was created in the [publishing events](../business-network/publishing-events.html) documentation. The `eventId` property is always the same as the `transactionId` of the transaction which emitted the event, with an appended number in the form `"transactionId": "#number"`. + +## What next? + +The application will now receive all of the events emitted by the business network, and it's up to the application to choose to what extent those events are integrated. + +--- diff --git a/packages/composer-website/jekylldocs/business-network/deploybusinessnetwork.md b/packages/composer-website/jekylldocs/business-network/deploybusinessnetwork.md index e94e2f70b4..3f010839ad 100644 --- a/packages/composer-website/jekylldocs/business-network/deploybusinessnetwork.md +++ b/packages/composer-website/jekylldocs/business-network/deploybusinessnetwork.md @@ -1,6 +1,6 @@ --- layout: default -title: Task - Deploy a Business Network +title: Task - Deploy a Business Network Definition category: tasks sidebar: sidebars/businessnetworks.md excerpt: How to deploy a Business Network @@ -10,45 +10,42 @@ excerpt: How to deploy a Business Network --- -A business network is deployed using the `composer network deploy` command. +A business network definition is deployed using the `composer network deploy` command. -## Procedure - -1. Before deploying a business network, a [Business Network Definition](../business-network/businessnetworkdefinition.html) is needed as a `zip` file with the following structure: +# Before you begin - ``` - BusinessNetworkArchive.zip - ├── lib - │   └── mozart.cto.js - ├── models - │   └── mozart.cto - └── package.json - ``` +Before deploying a business network, a [Business Network Definition](../business-network/businessnetworkdefinition.html) is needed as a `zip` file with the following structure: - - _lib_ contains all of the transactions processor functions - - _models_ contains all of the model files written in the [CTO Language](../reference/cto_language.html). - - _package.json_ is required, and is used to create the [Business Network Definition](../business-network/businessnetworkdefinition.html)'s identifier +``` +BusinessNetworkArchive.zip +├── lib +│   └── mozart.cto.js +├── models +│   └── mozart.cto +└── package.json +``` + - **NOTE**: *Do not zip a a folder containing **lib**, **models**, and **package.json** to create an Business Network Archive, zip the contents themselves* - -2. Start [Hyperledger Fabric Peer and Membership Service](runtime-start.md) +## Procedure -3. [Create a Connection Profile](../installing/createconnectionprofile.html) or do *not* use `-p` and allow {{site.data.conrefs.composer_full}} to create a `Default Connection Profile` for you. +1. Start [Hyperledger Fabric Peer and Membership Service](runtime-start.md). -4. Enter the command on a single line. For example: +2. [Create a Connection Profile](../installing/createconnectionprofile.html) or do *not* use `-p` and allow {{site.data.conrefs.composer_full}} to create a `Default Connection Profile` for you. - `composer network deploy -a .zip -i ` +3. Enter the command on a single line. For example: -5. Enter your Enrollment Secret when prompted. + `composer network deploy -a .zip -i ` - `prompt: What is the enrollment secret of the user?:` +4. Enter your Enrollment Secret when prompted. -6. When you see +5. When you see - ``` - Deploying business network definition. This may take a little time. - Command completed successfully. - ``` - you have successfully deployed a business network! + ``` + Deploying business network definition. This may take a little time. + Command completed successfully. + ``` + the business network definition has been successfully deployed. diff --git a/packages/composer-website/jekylldocs/business-network/getting-started-coding-bnd.md b/packages/composer-website/jekylldocs/business-network/getting-started-coding-bnd.md index ea7555690d..98abbe9485 100644 --- a/packages/composer-website/jekylldocs/business-network/getting-started-coding-bnd.md +++ b/packages/composer-website/jekylldocs/business-network/getting-started-coding-bnd.md @@ -6,181 +6,190 @@ sidebar: sidebars/businessnetworks.md excerpt: Getting Started with coding a Business Network Definition --- -# Coding a Business Network Definition +# Coding and deploying a business network definition --- -This tutorial will take you through how to code and deploy a Business Network Definition. How to put together the files, and code artifacts needed and what to do with them. -This is after the important step of modeling the actual business network and the entities within it. For this tutorial we are going to continue to use the Digital Property Network but from the position of having only the model file and the transction function file. +This tutorial will take you through how to code and deploy a Business Network Definition. How to put together the files, code required artifacts, and what to do with them. -# Style of creation -The final form of the Business Network Archive is mandatory for {{site.data.conrefs.composer_full}}. This file is created using the `composer archive create` command; however how the files that are taken as input to that command are created and managed is not mandatory. In all the documents and websites we are showing a selection of approaches we consider to be good practice. +The final form of the Business Network Archive (`.bna`) is mandatory for {{site.data.conrefs.composer_full}}. However, the creation and management of the input files is not mandatory. -For this tutorial, a single NPM module will be created for both the model and transaction functions. An archive will be created from this locally and deployed. -In production this NPM module would be published to a NPM repository, in development/test context this is not required. +For this tutorial, a single NPM module will be created for both the model and transaction functions. An archive will be created locally and deployed. The NPM module consists of your business network definition, and the `package.json` file. -Also the command line set of tools will be used. -#Creating the npm Module. +## Before you begin -## Basic Infrastrure -We will need to have the command line {{site.data.conrefs.composer_full}} tools installed. If you've not done this yet +Typically, a business network would be deployed after fully modelling and testing a business network definition. For this tutorial we are going to continue to use the Digital Property Network sample business network, using only the model file and the transction function file. + +You will need the {{site.data.conrefs.composer_short}} command line tools. To install the tools run the following command: ```bash $ npm install -g composer-cli ``` +*Please note: When using Ubuntu this command will fail when running in a root user shell.* -Ensure that you have a new clean working directory +You will also require a running {{site.data.conrefs.hyperledger_fabric_full}}. For more information on setting up an instance of {{site.data.conrefs.hyperledger_fabric_full}}, see the [Fabric documentation]()*fill this in* -```bash -$ mkdir property-network && cd property-network && pwd -/home/matthew/property-network -``` +# Creating the npm module. -Now we need to setup the NPM module as follows. It's ok to accept the default values, but you are welcome to change any that you wish. +## Creating the basic infrastrure -```bash -$ npm init -This utility will walk you through creating a package.json file. -It only covers the most common items, and tries to guess sensible defaults. - -See `npm help json` for definitive documentation on these fields -and exactly what they do. - -Use `npm install --save` afterwards to install a package and -save it as a dependency in the package.json file. - -Press ^C at any time to quit. -name: (property-network) -version: (1.0.0) -description: -entry point: (index.js) -test command: -git repository: -keywords: -author: -license: (ISC) -About to write to /home/matthew/property-network/package.json: - -{ - "name": "property-network", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} - - -Is this ok? (yes) yes -``` +1. Ensure that you have a new clean working directory by using the following command: -The infrastructure is now in place, the model and transaction functions can now be added. + ```bash + $ mkdir property-network && cd property-network && pwd + /home/matthew/property-network + ``` -## Model file +2. Now we need to setup the NPM module. The default values can be accepted, but you are welcome to change any that you wish. -The files are simple text files following a defined syntax, create a new blank file. + ```bash + $ npm init + This utility will walk you through creating a package.json file. + It only covers the most common items, and tries to guess sensible defaults. -```bash -$ touch models/DigitalLandTitle.cto -``` + See `npm help json` for definitive documentation on these fields + and exactly what they do. -Load that file up in any editor and then add your own model, or copy in the code below that is the DigitalLandTitle Getting Started Example + Use `npm install --save` afterwards to install a package and save it as a dependency in the package.json file. -``` -/** A 'Getting Started Tutorial' to work with Hyperledger Composer -*/ - -namespace net.biz.digitalPropertyNetwork - -asset LandTitle identified by titleId { - o String titleId - --> Person owner - o String information - o Boolean forSale optional -} - -asset SalesAgreement identified by salesId { - o String salesId - --> Person buyer - --> Person seller - --> LandTitle title -} - -participant Person identified by personId { - o String personId - o String firstName - o String lastName -} - -transaction RegisterPropertyForSale identified by transactionId{ - o String transactionId - --> Person seller - --> LandTitle title -} -``` + Press ^C at any time to quit. + name: (property-network) + version: (1.0.0) + description: + entry point: (index.js) + test command: + git repository: + keywords: + author: + license: (ISC) + About to write to /home/matthew/property-network/package.json: -## Transaction functions -The transaction function files are stadard JavaScript files. Create a blank file for this. + { + "name": "property-network", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC" + } -```bash -$ touch lib/DigitalLandTitle.js -``` -In this example the following is the implementation of the `registeryPropertyForSale` transaction. Copy this in to the `lib/DigitalLandTitle.js` file. + Is this ok? (yes) yes + ``` + + The infrastructure is now in place, the model and transaction functions can now be added. + +## Creating your model file + +The model file defines the assets, participants, and transactions in your business network. It is a simple text file that follows a defined syntax. + +1. Create the model (`.cto`) file: -```javascript -'use strict'; + ```bash + $ touch models/DigitalLandTitle.cto + ``` -/** - * Process a property that is held for sale - * @param {net.biz.digitalPropertyNetwork.RegisterPropertyForSale} propertyForSale the property to be sold - * @transaction - */ -function onRegisterPropertyForSale(propertyForSale) { - console.log('### onRegisterPropertyForSale ' + propertyForSale.toString()); - propertyForSale.title.forSale = true; +2. Open the model file in an editor of your choice and add your own model, or copy in the code below. The following code is the DigitalLandTitle getting started example. - returAssetRegistry('net.biz.digitalPropertyNetwork.LandTitle').then(function(result) { - return result.update(propertyForSale.title); + ``` + /** A 'Getting Started Tutorial' to work with Hyperledger Composer + */ + + namespace net.biz.digitalPropertyNetwork + + asset LandTitle identified by titleId { + o String titleId + --> Person owner + o String information + o Boolean forSale optional + } + + asset SalesAgreement identified by salesId { + o String salesId + --> Person buyer + --> Person seller + --> LandTitle title } - ); -} -``` -*That has completed the creation of the npm module for the Business Network, the next step is to form this into a Business Network Archive* + participant Person identified by personId { + o String personId + o String firstName + o String lastName + } -# Creating the Business Network Archive -Once we have the network complete we can create a business network definition archive. This is the unit will actually be deployable to the HyperLedger Fabric. + transaction RegisterPropertyForSale identified by transactionId{ + o String transactionId + --> Person seller + --> LandTitle title + } + ``` -There is a `composer archive` command that can be used to create and inspect these archives. The `composer network` command is then used to administer the business network archive on the Hyperledger Fabric. +## Creating transaction processor functions -### Creating an archive +The transaction processor function file is a standard JavaScript file that defines the operation of your transactions. -The `composer archive create` command is used to create the archive. The `--archiveFile` option is used to specify the name of the archive file to create. If this is not specified then a default name will be used that is based on the identifier of the business network (sanitized to be suitable as a filename). For example `digitalPropertyNetwork-0.1.2.bna`. +1. Create a blank JavaScript file. -There are two options that control where the inputs for the archive create from. + ```bash + $ touch lib/DigitalLandTitle.js + ``` -- *--sourceType* can either be *dir* or *module*. *dir* implies that the source is from a directory, *module* from an NPM module that has been installed. -- *--sourceName* is either the directory name or the NPM module name as appropriate. +2. Open the transaction processor file in an editor of your choice. Enter either the JavaScript for your own transactions, or use the following JavaScript sample. This sample is the `registeryPropertyForSale` transaction. -In the case of a directory being given, this directory must containsthe `package.json` file of the Business Network's npm module's package.json. + ```javascript + 'use strict'; -```bash -$ composer archive create --archiveFile digitalLandTitle.bna --sourceType dir --sourceName . -``` + /** + * Process a property that is held for sale + * @param {net.biz.digitalPropertyNetwork.RegisterPropertyForSale} propertyForSale the property to be sold + * @transaction + */ + function onRegisterPropertyForSale(propertyForSale) { + console.log('### onRegisterPropertyForSale ' + propertyForSale.toString()); + propertyForSale.title.forSale = true; -Once you have this archive it can then be deployed to Hyperledger (which will assuming is all running for the moment) + returAssetRegistry('net.biz.digitalPropertyNetwork.LandTitle').then(function(result) { + return result.update(propertyForSale.title); + } + ); + } + ``` -```bash -$ composer network deploy --archiveFile DigitalLandTitle.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d -``` +Now that the `package.json` file has been created in addition to the business network definition, the npm module for the business network has been created. The next step is to form this into a business network archive (`.bna`) file to be depoloyed to an instance of {{site.data.conrefs.hyperledger_fabric_full}}. + +--- + +# Creating the business network archive and deploying to {{site.data.conrefs.hyperledger_fabric_full}} + +Now that the business network has been defined, a business network archive must be created. This requires all the files in the business network definition created above. The business network archive (`.bna`) file can then be deployed to {{site.data.conrefs.hyperledger_fabric_full}}. + +There is a `composer archive` command that can be used to create and inspect these archives. The `composer network` command is then used to administer the business network archive on the Hyperledger Fabric. + +1. Use the `composer archive create` command to create the archive. The `--archiveFile` option is used to specify the name of the archive file to create. If no filename is specified, a default name will be created based on the identifier of the business network (sanitized to be suitable as a filename). For example `digitalPropertyNetwork-0.1.2.bna`. + + There are two options that control where the inputs for the archive create from. + + - `--sourceType` can either be `dir` or `module`. Specifying `dir` implies that the source is from a directory. Specifying `module` indicates that the source is an installed NPM module. + - `--sourceName` is either the directory name or the NPM module name as appropriate. + + In the case of a directory being given, this directory must contain the appropriate `package.json` file. + + ```bash + $ composer archive create --archiveFile digitalLandTitle.bna --sourceType dir --sourceName . + ``` + +2. To deploy an archive file Once you have this archive it can then be deployed to Hyperledger (which will assuming is all running for the moment) + + ```bash + $ composer network deploy --archiveFile DigitalLandTitle.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d + ``` -## Continued Development of the model or transaction functions +# Next steps to develop the model or transaction processor functions The next step in the development process would be to update either the model or transaction functions or both. When you've done this, the steps are to recreate the archive and then redeploy the network. @@ -189,6 +198,6 @@ $ composer archive create --archiveFile digitalLandTitle.bna ---sourceType dir - $ composer network update --archiveFile digitalproperty-network@0.0.1.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d ``` -#Complete! +# Complete! -This tutorial is now complete. The next step would be to create a REST api for applications to use. The [next step](../applications/genapp.html) will create a REST api for the Digital Property Network. +This tutorial is now complete. The next step would be to create a REST API for applications to use. The [next step](../applications/genapp.html) will create a REST api for the Digital Property Network. diff --git a/packages/composer-website/jekylldocs/business-network/publishing-events.md b/packages/composer-website/jekylldocs/business-network/publishing-events.md new file mode 100644 index 0000000000..c5ba9c31e5 --- /dev/null +++ b/packages/composer-website/jekylldocs/business-network/publishing-events.md @@ -0,0 +1,49 @@ +--- +layout: default +title: Publishing Events +category: tasks +sidebar: sidebars/businessnetworks.md +excerpt: Publishing Events Using Transactions +--- + +# Publishing Events + +Events can be published by {{site.data.conrefs.composer_full}} and subscribed to by applications. Events are defined in the model file of a business network definition, and are emitted by transaction JavaScript in the transaction processor functions file. + +## Before you begin + +Before you begin adding events to your business network, you should have a good understanding of the modelling language for business networks, and what makes up a full business network definition. + +## Procedure + +1. Events are defined in the model file (`.cto`) of your business network definition, in the same way as assets and participants. Events use the following format: + + ``` + event BasicEvent identified by eventId { + o String eventId + } + ``` + +2. In order for the event to be published the transaction which creates the event must include three functions, the first is the `getFactory` function. The `getFactory` allows events to be created as part of a transaction. Next, an event must be created by using `factory.newEvent('org.namespace', 'BasicEvent')`. This creates a `BasicEvent` from the business network model file in the defined organisation namespace. Lastly, the event must be emitted by using `emit(BasicEvent)`. A simple transaction which calls this event would look like this: + + ```JavaScript + /** + * @param {org.namespace.BasicEventTransaction} basicEventTransaction + * @transaction + */ + function basicEventTransaction(basicEventTransaction) { + var factory = getFactory(); + + var basicEvent = factory.newEvent('org.namespace', 'BasicEvent'); + emit(basicEvent); + } + ``` + +This transaction would create and publish an event of the `BasicEvent` type as defined in the business network's model file. For more information on the getFactory function, see the [{{site.data.conrefs.composer_short}} API documentation](https://hyperledger.github.io/composer/jsdoc/module-composer-runtime.html#getFactory). + +## What next? + +* [Subscribing to events](../applications/subscribing-to-events.html) +* [Creating an application](../applications/genapp.html) + +--- diff --git a/packages/composer-website/jekylldocs/installing/quickstart.md b/packages/composer-website/jekylldocs/installing/quickstart.md index 3429d839b1..7ed53cf222 100644 --- a/packages/composer-website/jekylldocs/installing/quickstart.md +++ b/packages/composer-website/jekylldocs/installing/quickstart.md @@ -38,6 +38,7 @@ If you need to update or install any of the prerequisites, please refer to [inst ``` $ npm install -g composer-cli ``` + *Please note: When using Ubuntu this command will fail when running in a root user shell.* 2. Clone the Composer sample applications GitHub repository. Choose from either the v0.6 sample application or the v1.0 sample application, the former will stand up a Hyperledger Fabric v0.6 environment ; the latter will stand up a newer Hyperledger Fabric v1.0 environment using a docker command sequence. For Hyperledger v0.6 use the following command: diff --git a/packages/composer-website/jekylldocs/introduction/key-concepts.md b/packages/composer-website/jekylldocs/introduction/key-concepts.md index 0c8fb99cf2..f70182c1f5 100644 --- a/packages/composer-website/jekylldocs/introduction/key-concepts.md +++ b/packages/composer-website/jekylldocs/introduction/key-concepts.md @@ -55,6 +55,12 @@ Transactions are the mechanism by which participants interact with assets. This --- +### Events + +Events are defined in the business network definition in the same way as assets or participants. Once events have been defined, they can be included in the transaction processor functions to be emitted as part of a transaction. Applications can subscribe to emitted events through the `composer-client` API. + +--- + ### APIs The `composer-admin`, `composer-client`, and `composer-common` components contain the APIs to interact with a {{site.data.conrefs.composer_full}} runtime. The `composer-rest-server` component generates a unique RESTful API for interacting with your deployed business network. diff --git a/packages/composer-website/jekylldocs/reference/commands.md b/packages/composer-website/jekylldocs/reference/commands.md index fb202cefc7..0bda2ba322 100644 --- a/packages/composer-website/jekylldocs/reference/commands.md +++ b/packages/composer-website/jekylldocs/reference/commands.md @@ -17,6 +17,8 @@ The {{site.data.conrefs.composer_full}} command line application can be installe `npm install -g composer-cli` +*Please note: When using Ubuntu this command will fail when running in a root user shell.* + ## Business Network Archives `composer archive create` @@ -35,7 +37,7 @@ Deploy a Business Network Definition: [composer network deploy](./composer.netwo `composer network undeploy` -Undeploy a Business Network Definition: [composer network undeploy](./composer.network.undeploy.md) +Permanently disable a business network definition: [composer network undeploy](./composer.network.undeploy.md) `composer network list` diff --git a/packages/composer-website/jekylldocs/reference/composer.network.undeploy.md b/packages/composer-website/jekylldocs/reference/composer.network.undeploy.md index 4e178b1f30..78fefb3c88 100644 --- a/packages/composer-website/jekylldocs/reference/composer.network.undeploy.md +++ b/packages/composer-website/jekylldocs/reference/composer.network.undeploy.md @@ -10,13 +10,15 @@ excerpt: Composer Network Undeploy CLI --- -The `composer network undeploy` utility is used to undeploy a business network from a Hyperledger Fabric runtime. +The `composer network undeploy` command **permanently disables a business network**. Once a business network has been undeployed, it cannot be redeployed. + +**Please Note**: When using the `undeploy` command with a business network running on {{site.data.conrefs.hyperledger_fabric_full}} v1.0, the business network remains running, but will become unresponsive. The business network **cannot be redeployed or updated once the `undeploy` command has been issued.** This is because the business network is already deployed, but has been set to be unresponsive. ``` composer network undeploy -a -i -s ``` -Note that after undeploy the business network definition can no longer be used, however the docker container +Note that **after undeploy the business network definition can no longer be used**, however the docker container associated with the business network definition is still running. The docker container for the business network definition must be explicitly stopped and removed if no longer needed. diff --git a/packages/composer-website/jekylldocs/reference/cto_language.md b/packages/composer-website/jekylldocs/reference/cto_language.md index 74c91c0972..221125581b 100644 --- a/packages/composer-website/jekylldocs/reference/cto_language.md +++ b/packages/composer-website/jekylldocs/reference/cto_language.md @@ -34,14 +34,11 @@ o DEER_OTHER } ``` -### Declarations of Assets, Participants, Transactions +### Declarations of Assets, Events, Participants, Transactions -Assets, Participants and Transactions are class definitions. The -concepts of Asset, Participant and Transaction may be considered to be different -stereotypes of the class type. +Assets, Participants and Transactions are class definitions. The concepts of Asset, Participant and Transaction may be considered to be different stereotypes of the class type. -A class in {{site.data.conrefs.composer_full}} is referred to as a Resource Definition. Therefore an -Asset (instance) has-an Asset Definition. +A class in {{site.data.conrefs.composer_full}} is referred to as a Resource Definition. Therefore an Asset (instance) has-an Asset Definition. A resource definition has the following properties: @@ -81,6 +78,15 @@ but that may be referenced from the resource. Relationships are unidirectional. } ``` + ``` + /** + * An abstract event type + */ + event BasicEvent identified by eventId { + o String eventId + } + ``` + ``` /** * An abstract transaction type for animal movements diff --git a/packages/composer-website/jekylldocs/reference/glossary.md b/packages/composer-website/jekylldocs/reference/glossary.md index 7e902dd3b8..f68d92053a 100644 --- a/packages/composer-website/jekylldocs/reference/glossary.md +++ b/packages/composer-website/jekylldocs/reference/glossary.md @@ -31,6 +31,8 @@ From [Wikipedia](https://en.wikipedia.org/wiki/Blockchain_(database)) **{{site.data.conrefs.composer_short}} Playground**: The {{site.data.conrefs.composer_full}} Playground is an open toolset allowing business networks to be rapidly modelled and tested. Sample business networks can be imported to learn more about {{site.data.conrefs.composer_full}} and business network archives can be exported for local editing or later use. +**Events**: Events are defined in the business network definition in the same way as assets or participants. Once events have been defined, they can be included in the transaction processor functions to be emitted as part of a transaction. Applications can subscribe to emitted events through the `composer-client` API. + **Fabric**: Fabric is a blockchain platform that user applications connect to in order to interact with a ledger. Examples of blockchain fabrics include Bitcoin, Ethereum, Open Blockchain and Hyperledger. **Hyperledger**: Hyperledger is a Linux Foundation project to produce an open blockchain platform that is ready for business. It provides an implementation of the shared ledger, smart contracts, privacy and consensus mechanisms. diff --git a/packages/composer-website/jekylldocs/tutorials/getting-started-playground.md b/packages/composer-website/jekylldocs/tutorials/getting-started-playground.md index 9a42dbca49..2215954ec7 100644 --- a/packages/composer-website/jekylldocs/tutorials/getting-started-playground.md +++ b/packages/composer-website/jekylldocs/tutorials/getting-started-playground.md @@ -28,39 +28,8 @@ docker images -aq | xargs docker rmi -f In order to install {{site.data.conrefs.composer_full}} Playground, you need the following software installed: * Docker Engine 1.12.3 or greater - - Test that Docker Engine is installed by running the following command in your terminal or command prompt: - - ``` - docker -v - ``` - - You should see the following output in your terminal or command prompt: - - ``` - $ docker -v - Docker version 1.13.0, build 49bf474 - ``` - - Verify that no errors occurred, and the version is greater than or equal to 1.12.3. If not, then follow the official instructions for installing Docker Engine: [Install Docker Engine] (https://docs.docker.com/engine/installation/) - * Docker Compose 1.8 or greater - Test that Docker Compose is installed by running the following command in your terminal or command prompt: - - ``` - docker-compose -v - ``` - - You should see the following output in your terminal or command prompt: - - ``` - $ docker-compose -v - docker-compose version 1.10.0, build 4bd6f1a - ``` - - Verify that no errors occurred, and the version is greater than or equal to 1.8. If not, then follow the official instructions for installing Docker Compose: [Install Docker Compose](https://docs.docker.com/compose/install/) - # Installation Download the example Docker Compose file: @@ -122,7 +91,7 @@ Verify that no errors occurred. If you see an error similar to the following err If you see this error, ensure that all of these ports are free before you run any commands. -If everything started OK, you should be able to access {{site.data.conrefs.composer_full}} Playground by clicking on this link: http://localhost:8080 +If everything started OK, you should be able to access {{site.data.conrefs.composer_full}} Playground by clicking on this link: http://localhost:8080 # Connecting to Hyperledger Fabric @@ -157,56 +126,21 @@ Note that the same set of features is available regardless of the installation m In order to install {{site.data.conrefs.composer_full}} Playground with npm, you need the following software installed: -* Node.js v4.6.2 or greater, or Node.js v6.x (note that Node.js v7.x is unsupported) - - Test that Node.js is installed by running the following command in your terminal or command prompt: - - ``` - node -v - ``` - - You should see the following output in your terminal or command prompt: - - ``` - $ node -v - v4.6.2 - ``` - - Verify that no errors occurred, and the version is greater than or equal to v4.6.2 or v6.x. If not, follow the official instructions for installing Node.js v6.x: [Node.js] (https://nodejs.org) - +* Node.js v6.x (note that Node.js v7.x is unsupported) * npm v3.x or greater - Test that npm is installed by running the following command in your terminal or command prompt: - - ``` - npm -v - ``` - - You should see the following output in your terminal or command prompt: - - ``` - $ npm -v - 3.10.10 - ``` - - Verify that no errors occurred, and the version is greater than or equal to v3.x. If not, upgrade npm to the latest version by running the following command in your terminal or command prompt: - - ``` - sudo npm -g upgrade npm - ``` - ### Installation You can install {{site.data.conrefs.composer_full}} Playground by running the following command in your terminal or command prompt: ``` - sudo npm install -g composer-playground + npm install -g composer-playground ``` You should see the following output in your terminal or command prompt: ``` - $ sudo npm install -g composer-playground + npm install -g composer-playground ... /usr/local/bin/composer-playground -> /usr/local/lib/node_modules/composer-playground/cli.js /usr/local/lib/node_modules @@ -226,10 +160,6 @@ A web browser will be automatically opened once the playground has started, but --- ->This tutorial is now **complete**. We plan on extending this tutorial with a guided tour of the playground and its features, so stay tuned! - ---- - ## Installing with Docker ### Prerequisites @@ -238,21 +168,6 @@ In order to install {{site.data.conrefs.composer_full}} Playground with Docker, * Docker Engine 1.12.3 or greater - Test that Docker Engine is installed by running the following command in your terminal or command prompt: - - ``` - docker -v - ``` - - You should see the following output in your terminal or command prompt: - - ``` - $ docker -v - Docker version 1.13.0, build 49bf474 - ``` - - Verify that no errors occurred, and the version is greater than or equal to 1.12.3. If not, then follow the official instructions for installing Docker Engine: [Install Docker Engine] (https://docs.docker.com/engine/installation/) - ### Installation You can install {{site.data.conrefs.composer_full}} Playground by running the following Docker command in your terminal or command prompt: @@ -273,7 +188,3 @@ Verify that no errors occurred. You can then start {{site.data.conrefs.composer_full}} Playground by clicking on this link: http://localhost:8080 --- - ->This tutorial is now **complete**. We plan on extending this tutorial with a guided tour of the playground and its features, so stay tuned! - ---- diff --git a/packages/composer-website/jekylldocs/tutorials/tutorialindex.md b/packages/composer-website/jekylldocs/tutorials/tutorialindex.md index 3622157f8a..ad99d665e0 100644 --- a/packages/composer-website/jekylldocs/tutorials/tutorialindex.md +++ b/packages/composer-website/jekylldocs/tutorials/tutorialindex.md @@ -29,6 +29,7 @@ These getting started guides are intended for more technical users and may requi * [Quickstart](../installing/quickstart.html) installs and tests the prerequisites for the digital property network sample. * [Running a sample with the command line](../tutorials/getting-started-cmd-line.html). * [Installing and running the {{site.data.conrefs.composer_short}} Playground locally](../tutorials/getting-started-playground.html). To run the [business network tutorial](../tutorials/defining-a-business-network.html) locally, install the playground locally first. +* [Writing your own business network using the command line](../business-network/getting-started-coding-bnd.html)