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
@@ -10,46 +10,41 @@ This readme contains the instructions to go from the installation of the softwar
10
10
11
11
The sample is made of several projects. Each project contains its own README with more detail information about what it contains.
12
12
13
-
odm-runtime
14
-
-----------
13
+
#### odm-runtime
15
14
16
-
is a project that allows to build and run an ODM docker image that contains the ODM Rule Execution Server (RES) and a Database. The RES hosts the ODM rule engine and provide the interface to execute Decision Services.
15
+
Is a project that allows to build and run an ODM docker image that contains the ODM Rule Execution Server (RES) and a Database. The RES hosts the ODM rule engine and provide the interface to execute Decision Services.
17
16
18
-
odm-deployer
19
-
------------
17
+
#### odm-deployer
20
18
21
-
is a NodeJS service that acts as a facade to the RES to receive Ruleapp deployment commands from the Blockchain application.
19
+
Is a NodeJS service that acts as a facade to the RES to receive Ruleapp deployment commands from the Blockchain application.
22
20
23
-
odm-deployer-webapp
24
-
-------------------
21
+
#### odm-deployer-webapp
25
22
26
-
is a Java WebApp that can be packaged in the same Liberty Server as a the RES to provide a facade to the RES to receive Ruleapp deployment commands from the Blockchain application.
23
+
Is a Java WebApp that can be packaged in the same Liberty Server as a the RES to provide a facade to the RES to receive Ruleapp deployment commands from the Blockchain application.
27
24
28
25
You will be using either odm-deployer or odm-deployer-webapp to provide this facade, not both.
29
26
30
-
vehicle-lifecycle
31
-
-----------------
27
+
#### vehicle-lifecycle
32
28
33
-
is a HyperLedger Composer sample, derived from the one developed by the Composer Team.
29
+
Is a HyperLedger Composer sample, derived from the one developed by the Composer Team.
34
30
The JavaScript transaction processors in this sample are invoking decisions that are executed
35
31
as Decision Services in ODM.
36
32
37
-
vehicle-lifecycle-cli
38
-
---------------------
33
+
#### vehicle-lifecycle-cli
39
34
40
-
is a command line application invoking Composer CLI to perform various operations like deploying RuleApps and submitting transactions.
35
+
Is a command line application invoking Composer CLI to perform various operations like deploying RuleApps and submitting transactions.
41
36
42
-
vehicle-lifecycle-xom
43
-
----------------------
37
+
#### vehicle-lifecycle-xom
44
38
45
-
is a Java implementation of the model used in the ODM Decision Service. Its implementation is derived from the model used in the vehicle-lifecycle Composer Sample.
39
+
Is a Java implementation of the model used in the ODM Decision Service. Its implementation is derived from the model used in the vehicle-lifecycle Composer Sample.
46
40
47
-
vehicle-lifecycle-decision-service
48
-
-----------------------------------
41
+
#### vehicle-lifecycle-decision-service
49
42
50
-
is the ODM Decision Service that implements the decision logic invoked from the Smart Contracts of the vehicle-lifecycle Blockchain application.
43
+
Is the ODM Decision Service that implements the decision logic invoked from the Smart Contracts of the vehicle-lifecycle Blockchain application.
51
44
52
-
# 1/ Pre-requisites
45
+
# Installation
46
+
47
+
### 1/ Pre-requisites
53
48
54
49
This sample can only work on Linux and MacOS. If you are using a Windows box, you need to install a Ubuntu Virtual Machine.
55
50
@@ -58,38 +53,39 @@ You need to have IBM ODM 8.9.0 installed on your machine. Please refer to your c
58
53
The following prerequisites are required:
59
54
60
55
- Operating Systems: Ubuntu Linux 14.04 / 16.04 LTS (both 64-bit), or Mac OS 10.12
61
-
- sw_vers
56
+
-`sw_vers`
62
57
- Docker Engine: Version 17.03 or higher
63
-
- docker -v
58
+
-`docker -v`
64
59
- Docker-Compose: Version 1.8 or higher
65
-
- docker-compose -v
60
+
-`docker-compose -v`
66
61
- Node: 6.x (note version 7 is not supported)
67
-
- node -v
62
+
-`node -v`
68
63
- npm: v3.x or v5.v
69
-
- npm -v
64
+
-`npm -v`
70
65
- git: 2.9.x
71
-
- git --version
66
+
-`git --version`
72
67
- A code editor of your choice, we recommend VSCode (https://code.visualstudio.com).
73
68
74
69
75
70
Refer to the "Before you begin" section in https://hyperledger.github.io/composer/installing/development-tools.html to make sure you have all the pre-requisites to run HyperLedger Fabric and Composer on your machine.
76
71
77
-
# 2/ Setting up HyperLedger Fabric V1.0 & Composer 0.11.0
72
+
###2/ Setting up HyperLedger Fabric V1.0 & Composer 0.11.0
78
73
79
-
-Please refer to https://hyperledger.github.io/composer/installing/development-tools.html to install and run HyperLedger Fabric and Composer.
74
+
Please refer to https://hyperledger.github.io/composer/installing/development-tools.html to install and run HyperLedger Fabric and Composer.
80
75
81
76
Following the steps described in this page should allow you to install Composer (0.11.0 or later) on your machine, install Fabric images and run Fabric on your machine as Docker containers.
82
77
83
-
Use 'composer -v' to check the version of Composer that has been installed.
78
+
Use `composer -v` to check the version of Composer that has been installed.
84
79
85
-
Note that 'downloadFabric.sh' and 'createComposerProfile.sh' should be done only once, the first time.
80
+
Note that `downloadFabric.sh` and `createComposerProfile.sh` should be done only once, the first time.
86
81
87
-
- use 'startFabric.sh' to start HyperLedger Fabric processes. (You can use 'stopFabric.sh' to stop Fabric on your machine).
82
+
Use `startFabric.sh` to start HyperLedger Fabric processes. (You can use `stopFabric.sh` to stop Fabric on your machine).
88
83
89
84
At this point you should have HyperLedger Fabric 1.0 running and Composer ready to deploy Composer applications.
90
85
91
-
Use 'docker ps -a' to check that you have the proper containers up and running:
86
+
Use `docker ps -a` to check that you have the proper containers up and running:
92
87
88
+
```
93
89
$ docker ps -a
94
90
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
95
91
1a4b387f872c hyperledger/fabric-peer:x86_64-1.0.0 "peer node start -..." About a minute ago Up About a minute 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
5d6a927ab0dd hyperledger/fabric-couchdb:x86_64-1.0.0 "tini -- /docker-e..." About a minute ago Up About a minute 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb
100
96
101
97
90a45895fcb8 hyperledger/fabric-ca:x86_64-1.0.0 "sh -c 'fabric-ca-..." About a minute ago Up About a minute 0.0.0.0:7054->7054/tcp ca.org1.example.com
98
+
```
102
99
103
100
Next step is to augment this installation with ODM capabilities.
104
101
105
-
# 3/ Setting-up IBM ODM with HyperLedger Fabric and Composer
102
+
### 3/ Setting-up IBM ODM with HyperLedger Fabric and Composer
103
+
104
+
- Launch a terminal window and go the `odm-runtime` project directory
105
+
106
+
**<FIRST TIME ONLY>**
107
+
108
+
- You need to copy RES binary files from your ODM installation:
109
+
110
+
- Open the `init.sh` script file and set the `ODM_HOME` variable to point to your actual ODM installation
111
+
-**Save** the file and **Run** the `init.sh` script
112
+
113
+
**</FIRST TIME ONLY>**
106
114
107
-
- Launch a terminal window and go the 'odm-runtime' project directory
108
-
- <FIRSTTIMEONLY>
109
-
You need to copy RES binary files from your ODM installation:
110
-
- open the 'init.sh' script file and set the ODM_HOME variable to point to your actual ODM installation
111
-
- save the file and run the 'init.sh' script
112
-
</FIRST TIME ONLY>
113
-
- enter: 'docker-compose up -d' to build the RES Docker image and start it as a Docker Container.
115
+
- Enter: `docker-compose up -d` to build the RES Docker image and start it as a Docker Container.
114
116
115
-
Refer to the README in 'odm-runtime' project for more information
117
+
Refer to the README in `odm-runtime` project for more information
116
118
117
119
The next step is to a run a deployment facade as a companion process to the RES. Called ODM Deployer,
118
120
this application comes from the 'odm-deployer' project.
119
121
120
-
-go to 'odm-deployer'
121
-
-enter: 'docker-compose up -d' to build the image and start the deployment service.
122
+
-Go to `odm-deployer`
123
+
-Enter: `docker-compose up -d` to build the image and start the deployment service.
122
124
123
-
Refer to the README in the 'odm-deployer' project for more information.
125
+
Refer to the README in the `odm-deployer` project for more information.
124
126
125
127
At this point, the whole Blockchain infrastructure is up-and-running and ready to receive Blockchain applications.
126
128
127
129
The RES deployed in the Blockchain network is still empty at this point. It must but populated with the XOM of the vehicle lifecycle application and the Decision Service used by the Smart Contracts of this application.
128
130
129
131
The next step will be to deploy the vehicle lifecycle Hyperledger Composer application.
130
132
131
-
# 4/ Deploying the vehicle-lifecycle Composer application
133
+
###4/ Deploying the vehicle-lifecycle Composer application
132
134
133
-
-go to 'vehicle-lifecycle' directory
134
-
-enter: 'npm run deploy' to build and deploy the application.
135
+
-Go to `vehicle-lifecycle` directory
136
+
-Enter: `npm run deploy` to build and deploy the application.
135
137
136
-
Refer to the README in 'vehicle-lifecycle' directory for more information about this Composer application.
138
+
Refer to the README in `vehicle-lifecycle` directory for more information about this Composer application.
137
139
138
-
# 5/ Setting-up an Eclipse environment for ODM projects
140
+
###5/ Setting-up an Eclipse environment for ODM projects
139
141
140
142
The ODM application is packaged as 2 eclipse projects that can be edited with ODM Rule Designer:
141
-
'vehicle-lifecycle-xom' and 'vehicle-lifecycle-decision-service'
143
+
`vehicle-lifecycle-xom` and `vehicle-lifecycle-decision-service`
142
144
143
145
You need to import them in an Eclipse workspace. You need to perform these instructions only once.
144
146
145
147
- Launch ODM 8.9.0 Rule Designer
146
148
- Create a fresh workspace in whatever location on your disk
147
-
- import 'vehicle-lifecycle-xom' and 'vehicle-lifecycle-decision-service' projects into it. You don't need
148
-
to copy them, just import them.
149
+
- Import `vehicle-lifecycle-xom` and `vehicle-lifecycle-decision-service` projects using "Import > General > Existing Projects Into The Workspace". You don't need to copy them, just import them.
149
150
150
151
The 2 projects should build without errors. Warnings can be ignored.
151
152
152
153
Note: if you are copying these project in a different location, the 'npm run deployXom' and 'npm run deployRuleapp' can't be use. Please refer to the 'package.json' file in 'vehicle-lifecycle-cli' directory
153
154
to see how to point these commands to a different location.
154
155
155
-
# 6/ Deploying the XOM
156
+
###6/ Deploying the XOM
156
157
157
158
A deployment feature has been integrated in the vehicle lifecycle demo to deploy the XOM and the Decision Services through the Blockchain.
158
159
159
160
To deploy the XOM throught the Blockchain, you should perform the following actions:
160
-
- in Rule Designer, you need to generate the XOM (and the Ruleapp):
161
-
- right click on the 'deployment/deployer' file in the 'vehicle-lifecycle-decision-service' project explorer and select 'Rule Execution Server / Deploy ...'
162
-
- this operation generate a 'vehicle_lifecycle_ds.jar' in the 'output' directory
163
-
- right click on the 'deployment/deployer' file in the 'vehicle-lifecycle-decision-service' project explorer and select 'Rule Execution Server / Deploy XOM ...'
164
-
- this operation generate a 'vehicle-lifecycle-xom.zip' in the 'output' directory
165
-
- go to 'vehicle-lifecyle-cli' directory
166
-
- Note: the first time you need to perform: 'npm install'
167
-
- enter: 'npm run deployXom'
161
+
- In Rule Designer, you need to generate the XOM (and the Ruleapp):
162
+
- Right click on the `deployment/deployer` file in the `vehicle-lifecycle-decision-service` project explorer and select "Rule Execution Server / Deploy ...". This operation generate a `vehicle_lifecycle_ds.jar` in the `output` directory.
163
+
- Right click on the `deployment/deployer` file in the `vehicle-lifecycle-decision-service` project explorer and select "Rule Execution Server / Deploy XOM ...". This operation generate a `vehicle-lifecycle-xom.zip` in the `output` directory
164
+
- Go to `vehicle-lifecyle-cli` directory
165
+
166
+
**<FIRST TIME ONLY>**
167
+
168
+
- The first time you need to perform: `npm install`
169
+
170
+
**<FIRST TIME ONLY>**
171
+
172
+
- Enter: `npm run deployXom`
168
173
169
174
This operation needs to be done each time you modify the XOM of the decision service.
170
175
171
-
Refer to the README in 'vehicle-lifecycle-cli' directory for more information about this command.
176
+
Refer to the README in `vehicle-lifecycle-cli` directory for more information about this command.
172
177
173
-
# 7/ Deploying the Decision Service
178
+
###7/ Deploying the Decision Service
174
179
175
180
The Decision Service is the packaging of the vehicle lifecyle business rules exposed as a REST service invoked from the Smart Contracts. It must be deployed in the RES associated to all nodes of the Blockchain network.
176
181
177
182
Like the XOM, the Decision Service is deployed through the Blockchain, leveraging a deployment feature integrated in the demo.
178
183
179
-
In the previous step, you should have generated the ruleapp supporting the vehicle lifecycle decision service using Rule Designer. The ruleapp is the 'vehicle_lifecycle_ds.jar' generated in the 'output' directory of the 'vehicle-lifecycle-decision-service' project.
184
+
In the previous step, you should have generated the ruleapp supporting the vehicle lifecycle decision service using Rule Designer. The ruleapp is the `vehicle_lifecycle_ds.jar` generated in the `output` directory of the `vehicle-lifecycle-decision-service` project.
180
185
181
-
-go to 'vehicle-lifecyle-cli' directory
182
-
-enter: 'npm run deployRuleapp'
186
+
-Go to `vehicle-lifecyle-cli` directory
187
+
-Enter: `npm run deployRuleapp`
183
188
184
189
This operation needs to be done each time you modify the business rules of the application.
185
190
186
191
When you change the rules, you need to increment the version number of the ruleset. You can do it in Rule Designer:
187
-
- Open the 'deployer' file in 'deployment'
188
-
-make sure the Ruleset base version (in Decision Operation tab) is set to the right version (1.0 to start, to be incremented when you want to deploy newer version)
192
+
- Open the `deployer` file in `deployment`
193
+
-Make sure the Ruleset base version (in Decision Operation tab) is set to the right version (1.0 to start, to be incremented when you want to deploy newer version)
189
194
190
-
Refer to the README in 'vehicle-lifecycle-cli' directory for more information about this command.
195
+
Refer to the README in `vehicle-lifecycle-cli` directory for more information about this command.
191
196
192
-
# 8/ Running the Vehicle Lifecycle demo
197
+
###8/ Running the Vehicle Lifecycle demo
193
198
194
-
Refer to the README in 'vehicle-lifecycle-cli' directory to initialize the application and run a demo scenario that illustrates the application of the business rules when suspicious transactions are generated.
199
+
Refer to the README in `vehicle-lifecycle-cli` directory to initialize the application and run a demo scenario that illustrates the application of the business rules when suspicious transactions are generated.
195
200
196
201
Assuming the XOM and the Ruleapp have been deployed, you can run the full demo from a fresh model
197
-
using the following command from the 'vehicle-lifecycle-cli' directory:
198
-
- 'npm run demo'
202
+
using the following command from the `vehicle-lifecycle-cli` directory:
0 commit comments