Skip to content

Commit

Permalink
Intermediate release - updating GHGP policy (#2387)
Browse files Browse the repository at this point in the history
* fix too big policy

Signed-off-by: simvalery <[email protected]>

* fix calculate block output schema config

Signed-off-by: Artem Buslaev <[email protected]>

* fix mongodb version

Signed-off-by: simvalery <[email protected]>

* update ghgp policy [skip ci]

Signed-off-by: Artem Buslaev <[email protected]>

* update aggregate block in ghgp

Signed-off-by: Artem Buslaev <[email protected]>

* update versions

Signed-off-by: Artem Buslaev <[email protected]>

* [skip ci] Add swagger.yaml

---------

Signed-off-by: simvalery <[email protected]>
Signed-off-by: Artem Buslaev <[email protected]>
Co-authored-by: Artem Buslaev <[email protected]>
Co-authored-by: envision-ci-agent <[email protected]>
  • Loading branch information
3 people authored Jul 8, 2023
1 parent 9c87706 commit 00d7994
Show file tree
Hide file tree
Showing 21 changed files with 87 additions and 94 deletions.
Binary file not shown.
6 changes: 3 additions & 3 deletions api-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
},
"author": "Envision Blockchain Solutions <[email protected]>",
"dependencies": {
"@guardian/common": "^2.14.1",
"@guardian/interfaces": "^2.14.1",
"@guardian/common": "^2.14.2",
"@guardian/interfaces": "^2.14.2",
"@nestjs/common": "^9.4.1",
"@nestjs/core": "^9.4.1",
"@nestjs/jwt": "^10.0.3",
Expand Down Expand Up @@ -66,5 +66,5 @@
"start": "node dist/index.js",
"test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/ui-service.xml"
},
"version": "2.14.1"
"version": "2.14.2"
}
18 changes: 9 additions & 9 deletions api-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "api-tests",
"version": "2.14.1",
"version": "2.14.2",
"description": "API Tests",
"main": "index.js",
"scripts": {
Expand All @@ -11,12 +11,12 @@
"license": "Apache-2.0",
"devDependencies": {
"chai": "^4.3.5",
"mocha": "^9.2.0",
"mocha-junit-reporter": "^2.0.2",
"tree-kill": "^1.2.2"
},
"dependencies": {
"axios": "^1.3.6",
"dotenv": "^16.0.1"
}
"mocha": "^9.2.0",
"mocha-junit-reporter": "^2.0.2",
"tree-kill": "^1.2.2"
},
"dependencies": {
"axios": "^1.3.6",
"dotenv": "^16.0.1"
}
}
6 changes: 3 additions & 3 deletions auth-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
},
"author": "Envision Blockchain Solutions <[email protected]>",
"dependencies": {
"@guardian/common": "^2.14.1",
"@guardian/interfaces": "^2.14.1",
"@guardian/common": "^2.14.2",
"@guardian/interfaces": "^2.14.2",
"@mikro-orm/core": "~5.7.12",
"@mikro-orm/mongodb": "~5.7.12",
"@nestjs/common": "^9.4.1",
Expand Down Expand Up @@ -53,5 +53,5 @@
"start": "node dist/index.js",
"test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/ui-service.xml"
},
"version": "2.14.1"
"version": "2.14.2"
}
6 changes: 3 additions & 3 deletions common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"@aws-sdk/client-secrets-manager": "^3.319.0",
"@azure/identity": "^3.2.2",
"@azure/keyvault-secrets": "^4.7.0",
"@guardian/interfaces": "^2.14.1",
"@guardian/interfaces": "^2.14.2",
"@hashgraph/sdk": "2.24.2",
"@mattrglobal/jsonld-signatures-bbs": "^1.1.2",
"@meeco/cryppo": "^2.0.2",
Expand All @@ -31,7 +31,7 @@
"lodash.get": "^4.4.2",
"lodash.set": "^4.3.2",
"moment": "^2.29.2",
"mongodb": "^5.6.0",
"mongodb": "5.6.0",
"nats": "^2.6.1",
"node-vault": "^0.9.22",
"reflect-metadata": "^0.1.13",
Expand Down Expand Up @@ -65,5 +65,5 @@
"test:local": "mocha tests/**/*.test.js --exit",
"test:stability": "mocha tests/stability.test.js"
},
"version": "2.14.1"
"version": "2.14.2"
}
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@
"test": "ng test",
"watch": "ng build --watch --configuration development --output-path ../www-data"
},
"version": "2.14.1"
"version": "2.14.2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<mat-select [(value)]="properties.outputSchema" [disabled]="readonly" (selectionChange)="onSelectOutput()">
<mat-option [matTooltip]="getSchemaName(schema.name, schema.version || schema.sourceVersion, schema.status)"
matTooltipPosition="below" matTooltipClass="guardian-tooltip small-guardian-tooltip" matTooltipShowDelay="500"
*ngFor="let schema of schemas" [value]="schema">{{getSchemaName(schema.name, schema.version ||
*ngFor="let schema of schemas" [value]="schema.value">{{getSchemaName(schema.name, schema.version ||
schema.sourceVersion, schema.status)}}</mat-option>
</mat-select>
</td>
Expand Down
8 changes: 4 additions & 4 deletions guardian-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"author": "Envision Blockchain Solutions <[email protected]>",
"dependencies": {
"@guardian/common": "^2.14.1",
"@guardian/interfaces": "^2.14.1",
"@guardian/common": "^2.14.2",
"@guardian/interfaces": "^2.14.2",
"@hashgraph/sdk": "2.24.2",
"@mattrglobal/jsonld-signatures-bbs": "^1.1.2",
"@meeco/cryppo": "^2.0.2",
Expand Down Expand Up @@ -46,7 +46,7 @@
"mathjs": "^10.1.0",
"module-alias": "^2.2.2",
"moment": "^2.29.2",
"mongodb": "^5.6.0",
"mongodb": "5.6.0",
"prom-client": "^14.1.1",
"prometheus-api-metrics": "3.2.2",
"reflect-metadata": "^0.1.13"
Expand Down Expand Up @@ -85,5 +85,5 @@
"test:local": "mocha tests/**/*.test.js --exit",
"test:stability": "mocha tests/stability.test.js"
},
"version": "2.14.1"
"version": "2.14.2"
}
1 change: 0 additions & 1 deletion guardian-service/src/policy-engine/policy-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,6 @@ export class PolicyEngine extends NatsService {

try {
const r = await this.sendMessageWithTimeout<any>(PolicyEvents.GENERATE_POLICY, 1000, {
policy,
policyId,
skipRegistration: false
});
Expand Down
2 changes: 1 addition & 1 deletion interfaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
"prepack": "npm run build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "2.14.1"
"version": "2.14.2"
}
6 changes: 3 additions & 3 deletions logger-service/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"author": "Envision Blockchain Solutions <[email protected]>",
"dependencies": {
"@guardian/common": "^2.14.1",
"@guardian/interfaces": "^2.14.1",
"@guardian/common": "^2.14.2",
"@guardian/interfaces": "^2.14.2",
"@mikro-orm/core": "~5.7.12",
"@mikro-orm/mongodb": "~5.7.12",
"@nestjs/common": "^9.4.1",
Expand Down Expand Up @@ -40,5 +40,5 @@
"start": "node dist/index.js",
"watch": "nodemon src/index.ts"
},
"version": "2.14.1"
"version": "2.14.2"
}
24 changes: 12 additions & 12 deletions mrv-sender/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"author": "Envision Blockchain Solutions <[email protected]>",
"dependencies": {
"@guardian/common": "^2.14.1",
"@transmute/credentials-context": "0.7.0-unstable.80",
"@transmute/did-context": "0.7.0-unstable.80",
"@transmute/ed25519-signature-2018": "0.7.0-unstable.80",
"@transmute/json-web-signature": "0.7.0-unstable.80",
"@transmute/jsonld-schema": "0.7.0-unstable.80",
"@transmute/security-context": "0.7.0-unstable.80",
"@transmute/vc.js": "0.7.0-unstable.80",
"axios": "^1.3.6",
"express": "^4.17.3",
"jose": "4.14.1",
"@guardian/common": "^2.14.2",
"@transmute/credentials-context": "0.7.0-unstable.80",
"@transmute/did-context": "0.7.0-unstable.80",
"@transmute/ed25519-signature-2018": "0.7.0-unstable.80",
"@transmute/json-web-signature": "0.7.0-unstable.80",
"@transmute/jsonld-schema": "0.7.0-unstable.80",
"@transmute/security-context": "0.7.0-unstable.80",
"@transmute/vc.js": "0.7.0-unstable.80",
"axios": "^1.3.6",
"express": "^4.17.3",
"jose": "4.14.1",
"prom-client": "^14.1.1",
"prometheus-api-metrics": "3.2.2"
},
Expand All @@ -32,5 +32,5 @@
"dev:docker": "nodemon .",
"start": "node dist/index.js"
},
"version": "2.14.1"
"version": "2.14.2"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"policy-service",
"api-tests"
],
"version": "2.14.1"
"version": "2.14.2"
}
8 changes: 4 additions & 4 deletions policy-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"author": "Envision Blockchain Solutions <[email protected]>",
"dependencies": {
"@guardian/common": "^2.14.1",
"@guardian/interfaces": "^2.14.1",
"@guardian/common": "^2.14.2",
"@guardian/interfaces": "^2.14.2",
"@hashgraph/sdk": "2.24.2",
"@mattrglobal/jsonld-signatures-bbs": "^1.1.2",
"@meeco/cryppo": "^2.0.2",
Expand Down Expand Up @@ -43,7 +43,7 @@
"mathjs": "^10.1.0",
"module-alias": "^2.2.2",
"moment": "^2.29.2",
"mongodb": "^5.6.0",
"mongodb": "5.6.0",
"prom-client": "^14.1.1",
"prometheus-api-metrics": "3.2.2",
"reflect-metadata": "^0.1.13"
Expand Down Expand Up @@ -82,5 +82,5 @@
"test:local": "mocha tests/**/*.test.js",
"test:stability": "mocha tests/stability.test.js"
},
"version": "2.14.1"
"version": "2.14.2"
}
11 changes: 6 additions & 5 deletions policy-service/src/api/policy-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { GridFSBucket } from 'mongodb';
import { SynchronizationService } from '@policy-engine/multi-policy-service';

const {
policy,
policyId,
policyServiceName,
skipRegistration
Expand All @@ -37,14 +36,17 @@ Promise.all([
Environment.setLocalNodeProtocol(process.env.LOCALNODE_PROTOCOL);
Environment.setLocalNodeAddress(process.env.LOCALNODE_ADDRESS);
Environment.setNetwork(process.env.HEDERA_NET);

const policyConfig = await DatabaseServer.getPolicyById(policyId);

if (process.env.HEDERA_CUSTOM_NODES) {
try {
const nodes = JSON.parse(process.env.HEDERA_CUSTOM_NODES);
Environment.setNodes(nodes);
} catch (error) {
await new Logger().warn(
'HEDERA_CUSTOM_NODES field in settings: ' + error.message,
['POLICY', policy.name, policyId.toString()]
['POLICY', policyConfig.name, policyId.toString()]
);
console.warn(error);
}
Expand All @@ -59,7 +61,7 @@ Promise.all([
await new Logger().warn(
'HEDERA_CUSTOM_MIRROR_NODES field in settings: ' +
error.message,
['POLICY', policy.name, policyId.toString()]
['POLICY', policyConfig.name, policyId.toString()]
);
console.warn(error);
}
Expand All @@ -81,7 +83,6 @@ Promise.all([

new Logger().info(`Process for with id ${policyId} was started started PID: ${process.pid}`, ['POLICY', policyId]);

const policyConfig = await DatabaseServer.getPolicyById(policyId);
const generator = new BlockTreeGenerator();
const policyValidator = new PolicyValidator(policyConfig);

Expand All @@ -105,5 +106,5 @@ Promise.all([
new LargePayloadContainer().runServer();
}

new Logger().info('Start policy', ['POLICY', policy.name, policyId.toString()]);
new Logger().info('Start policy', ['POLICY', policyConfig.name, policyId.toString()]);
});
7 changes: 0 additions & 7 deletions policy-service/src/helpers/policy-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ import { POLICY_PROCESS_PATH } from '@api/policy-process-path';
* Policy start options
*/
export interface IPolicyStartOptions {
/**
* Config
*/
policy: unknown;

/**
* Service name
*/
Expand Down Expand Up @@ -304,15 +299,13 @@ export class PolicyContainer extends NatsService {
}

const {
policy,
policyId,
policyServiceName,
skipRegistration
} = instance.options;

const childEnvironment = Object.assign(process.env, {
POLICY_START_OPTIONS: JSON.stringify({
policy,
policyId,
policyServiceName,
skipRegistration
Expand Down
2 changes: 1 addition & 1 deletion swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6760,7 +6760,7 @@ info:
the heart of the Guardian solution is a sophisticated Policy Workflow Engine
(PWE) that enables applications to offer a requirements-based tokenization
implementation.
version: 2.14.1
version: 2.14.2
contact:
name: API developer
url: https://envisionblockchain.com
Expand Down
2 changes: 1 addition & 1 deletion topic-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
"dev": "tsc -w",
"start": "node dist/index.js"
},
"version": "2.14.1"
"version": "2.14.2"
}
2 changes: 1 addition & 1 deletion tree-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"dev": "tsc -w",
"start": "node dist/index.js"
},
"version": "2.14.1"
"version": "2.14.2"
}
26 changes: 13 additions & 13 deletions worker-service/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"author": "Envision Blockchain Solutions <[email protected]>",
"dependencies": {
"@guardian/common": "^2.14.1",
"@guardian/interfaces": "^2.14.1",
"@hashgraph/sdk": "2.24.2",
"@transmute/credentials-context": "^0.7.0-unstable.80",
"@transmute/did-context": "^0.7.0-unstable.80",
"@transmute/ed25519-signature-2018": "^0.7.0-unstable.80",
"@transmute/json-web-signature": "^0.7.0-unstable.80",
"@transmute/jsonld-schema": "^0.7.0-unstable.80",
"@transmute/security-context": "^0.7.0-unstable.80",
"@transmute/vc.js": "^0.7.0-unstable.80",
"axios": "^1.3.6",
"axios-retry": "^3.2.4",
"@guardian/common": "^2.14.2",
"@guardian/interfaces": "^2.14.2",
"@hashgraph/sdk": "2.24.2",
"@transmute/credentials-context": "^0.7.0-unstable.80",
"@transmute/did-context": "^0.7.0-unstable.80",
"@transmute/ed25519-signature-2018": "^0.7.0-unstable.80",
"@transmute/json-web-signature": "^0.7.0-unstable.80",
"@transmute/jsonld-schema": "^0.7.0-unstable.80",
"@transmute/security-context": "^0.7.0-unstable.80",
"@transmute/vc.js": "^0.7.0-unstable.80",
"axios": "^1.3.6",
"axios-retry": "^3.2.4",
"cross-blob": "^2.0.1",
"dotenv": "^16.0.0",
"ipfs-client": "0.5.0",
Expand Down Expand Up @@ -49,5 +49,5 @@
"start": "node dist/index.js",
"test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/worker-service.xml --exit"
},
"version": "2.14.1"
"version": "2.14.2"
}
Loading

0 comments on commit 00d7994

Please sign in to comment.