You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 8, 2020. It is now read-only.
* Updates for work * Adding Installing Index to ToC * Removing Fabric Composer name * Removing Fabric composer name * Moving images for REST API doc * Fabric Composer Name removal * Fabric Composer name removal * Other name changes (Stack Overflow, GitHub, Rocket.Chat, JavaScript) * wording updates and bug splats * ToC Updates * HLv1 docs updates, couple more bug splats. * Last edit for HLv1 * Whoops, bug splat * Another bug splat... * Quick fixes prereqs navbar * intro diagram fix and bug fixes * Fixes and updates * Rollback optional script for v1.0 * QoL changes and rollback changes - Quickstart * Link fixes * Atom links fix, formatting fix * Odd formatting fix. * Name change and codeblock fix * More odd formatting fixes * Ubuntu root user doc fix + draft of bnd doc changes * update for CLI define + deploy BNA * last bnd update * Events and bug fixes * Last event thing * Updates for #803 and #822 * removing unnecessary stuff * Undeploy support #673 * Clarifications on undeploy
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).
12
+
13
+
## Before you begin
14
+
15
+
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).
16
+
17
+
## Procedure
18
+
19
+
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:
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": "<transactionId>#number"`.
29
+
30
+
## What next?
31
+
32
+
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.
title: Task - Deploy a Business Network Definition
4
4
category: tasks
5
5
sidebar: sidebars/businessnetworks.md
6
6
excerpt: How to deploy a Business Network
@@ -10,45 +10,42 @@ excerpt: How to deploy a Business Network
10
10
11
11
---
12
12
13
-
A business network is deployed using the `composer network deploy` command.
13
+
A business network definition is deployed using the `composer network deploy` command.
14
14
15
-
## Procedure
16
-
17
-
1. Before deploying a business network, a [Business Network Definition](../business-network/businessnetworkdefinition.html) is needed as a `zip` file with the following structure:
15
+
# Before you begin
18
16
19
-
```
20
-
BusinessNetworkArchive.zip
21
-
├── lib
22
-
│ └── mozart.cto.js
23
-
├── models
24
-
│ └── mozart.cto
25
-
└── package.json
26
-
```
17
+
Before deploying a business network, a [Business Network Definition](../business-network/businessnetworkdefinition.html) is needed as a `zip` file with the following structure:
27
18
28
-
-_lib_ contains all of the transactions processor functions
29
-
-_models_ contains all of the model files written in the [CTO Language](../reference/cto_language.html).
30
-
-_package.json_ is required, and is used to create the [Business Network Definition](../business-network/businessnetworkdefinition.html)'s identifier
19
+
```
20
+
BusinessNetworkArchive.zip
21
+
├── lib
22
+
│ └── mozart.cto.js
23
+
├── models
24
+
│ └── mozart.cto
25
+
└── package.json
26
+
```
27
+
<!--
28
+
You can use the `composer archive` command to create an archive with the correct format.
31
29
32
-
You can use the `composer archive` command to create an archive with the correct format.
30
+
**NOTE**: *Do not zip a a folder containing **lib**, **models**, and **package.json** to create an Business Network Archive, zip the contents themselves*
31
+
-->
33
32
34
-
**NOTE**: *Do not zip a a folder containing **lib**, **models**, and **package.json** to create an Business Network Archive, zip the contents themselves*
35
-
36
-
2. Start [Hyperledger Fabric Peer and Membership Service](runtime-start.md)
33
+
## Procedure
37
34
38
-
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.
35
+
1. Start [Hyperledger Fabric Peer and Membership Service](runtime-start.md).
39
36
40
-
4. Enter the command on a single line. For example:
37
+
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.
41
38
42
-
`composer network deploy -a <BusinessNetworkDefinition>.zip -i <Your EnrollmentID>`
39
+
3. Enter the command on a single line. For example:
43
40
44
-
5. Enter your Enrollment Secret when prompted.
41
+
`composer network deploy -a <BusinessNetworkDefinition>.zip -i <Your EnrollmentID>`
45
42
46
-
`prompt: What is the enrollment secret of the user?:`
43
+
4. Enter your Enrollment Secret when prompted.
47
44
48
-
6. When you see
45
+
5. When you see
49
46
50
-
```
51
-
Deploying business network definition. This may take a little time.
52
-
Command completed successfully.
53
-
```
54
-
you have successfully deployed a business network!
47
+
```
48
+
Deploying business network definition. This may take a little time.
49
+
Command completed successfully.
50
+
```
51
+
the business network definition has been successfully deployed.
0 commit comments