Skip to content

Commit da804e9

Browse files
author
Stephane Mery
committed
Introduce a container name
1 parent 069dc7d commit da804e9

File tree

5 files changed

+23
-12
lines changed

5 files changed

+23
-12
lines changed

odm-deployer/README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@ XOM and Ruleapps to the RES from dedicated Smart Contracts involved on specific
44

55
# setting up the deployer
66

7-
- Launch a terminal window and go the odm-deployer project directory
8-
- enter: 'docker-compose up -d' to build the image and start the service
7+
- Launch a terminal window and go the `odm-deployer` project directory
8+
- enter: `docker-compose up -d` to build the image and start the service
99

1010
# stopping the deployer
1111

12-
You need to stop the deployer using 'docker-compose down' from the odm-deployer project directory.
13-
If you change the code of the service, you need to remove the existing images by invoking the
14-
following Docker command:
15-
docker rmi smartcontract/odm-deployer:1.0.0
12+
You need to stop the deployer using `docker-compose down` from the `odm-deployer` project directory.
13+
14+
If you change the code of the service, you need to remove the existing images so that a new one can be created with the new code.
15+
You can remove the image by invoking the following Docker command:
16+
`docker rmi smartcontract/odm-deployer:1.0.0`
1617

1718
To create a Docker image from the dockerfile in this directory use the following docker command:
18-
docker build -t smartcontract/odm-deployer .
19+
`docker-compose build`
20+
21+
Note that `docker-compose up` will build the images if it does not exist yet.
22+
1923

2024

2125

odm-deployer/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: '2'
22
services:
33
odm-deployer:
4+
container_name: odm-deployer
45
image: smartcontract/odm-deployer:1.0.0
56
build:
67
context: ./

odm-deployer/server.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ app.post('/deploy', function (req, res) {
6161
header['Content-Length'] = buf.length;
6262

6363
var options = {
64-
host: 'odmruntime_odm-runtime_1',
64+
// host: 'odmruntime_odm-runtime_1',
65+
host: 'odm-runtime',
6566
port: '9060',
6667
path: '/res/api/v1/ruleapps?merging=REPLACE_MERGING_POLICY',
6768
method: 'POST',
@@ -149,7 +150,8 @@ var updateArchiveXom = function(ruleappName, rulesetName, ruleappVersion, rulese
149150
header['Content-Length'] = body.length;
150151

151152
var options = {
152-
host: 'odmruntime_odm-runtime_1',
153+
//host: 'odmruntime_odm-runtime_1',
154+
host: 'odm-runtime',
153155
port: '9060',
154156
path: '/res/api/v1/ruleapps/' + ruleappName + '/' + ruleappVersion + '/' + rulesetName + '/' + rulesetVersion + '/properties/ruleset.managedxom.uris',
155157
method: 'POST',
@@ -220,7 +222,8 @@ app.post('/deployXom', function (req, res) {
220222
header['Content-Length'] = buf.length;
221223

222224
var options = {
223-
host: 'odmruntime_odm-runtime_1',
225+
// host: 'odmruntime_odm-runtime_1',
226+
host: 'odm-runtime',
224227
port: '9060',
225228
path: '/res/api/v1/xoms/' + xomName,
226229
method: 'POST',
@@ -312,7 +315,8 @@ var updateLibrary = function(uri, libraryName, libraryVersion)
312315
header['Content-Length'] = body.length;
313316

314317
var options = {
315-
host: 'odmruntime_odm-runtime_1',
318+
// host: 'odmruntime_odm-runtime_1',
319+
host: 'odm-runtime',
316320
port: '9060',
317321
path: '/res/api/v1/libraries/' + libraryName + '/' + libraryVersion,
318322
method: 'PUT',

odm-runtime/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ services:
44
# ODMVERSION : The Operational Decision Management version
55
# ODMDOCKERDIR : The Directory where this
66
odm-runtime:
7+
container_name: odm-runtime
78
image: smartcontract/odm-runtime:8.9.0
89
build:
910
context: ./

vehicle-lifecycle/lib/vda.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ function privateVehicleTransfer(privateVehicleTransfer) {
8787
// should be assigned to the Vehicle.suspiciousMessage field
8888
// The Decision Service receives all the data about the current transaction: buyer, seller and the vehicle
8989

90-
var url = 'http://odmruntime_odm-runtime_1:9060/DecisionService/rest/' + rulesetPath;
90+
// var url = 'http://odmruntime_odm-runtime_1:9060/DecisionService/rest/' + rulesetPath;
91+
var url = 'http://odm-runtime:9060/DecisionService/rest/' + rulesetPath;
9192

9293
var dsCallObject = factory.newResource(NS_DECISION, 'IsSuspiciousTransferDecisionService', "isSuspiciousTransfer");
9394
dsCallObject.transaction = privateVehicleTransfer;

0 commit comments

Comments
 (0)