Skip to content

Commit

Permalink
feat(SATP-Hermes): add gateway coordinator WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

feat(bungee): add skeleton for bungee

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>

refactor(plugin-satp-hermes): update messages formats SATP core version 2.0.0 OpenAPI

* created new messages in openAPI definition

feat(bungee): fix bungee dependencies

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>

feat(SATP-Hermes): gateway coordinator

feat(SATP-Hermes): gateway coordinator

feat(SATP-Hermes): gateway coordinator WIP

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

test(SATP-Hermes): enable decorators needed for gateway coordinator checks

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

docs(SATP-Hermes): update package.json

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

refactor(SATP-Hermes): re-estructure project

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

refactor(SATP-Hermes): re-estructure project

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

refactor(SATP-Hermes): re-estructure project

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

refactor(SATP-Hermes): remove kotlin sdk, add protobuffer

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

feat(SATP-Hermes): protobuf structure

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

feat(SATP-Hermes): protobuf structure

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

refactor(SATP-Hermes): refactor naming

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

feat(SATP-Hermes): protobuf structure improvements

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

feat(SATP-Hermes): update yarn.lock and clean up

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>

refactor(test-tooling): fix types of streams: use NodeJS.ReadableStream

1. The container management library that we use in the test infrastructure
(called dockerode) is expecting streams that are defined in the global
namespace of the `@types/node` library, e.g. the standard library of NodeJS
itself.
2. Previously we were using the "streams" package to provide type information
to the streams that we were passing around to dockerode and it was working
fine, but after some changes that seem unrelated this has broken the
compilation process.
3. The mentioned changes are not yet on the main branch, but we expect
them to be there soon and so this change is laying the groundwork for that
by pre-emptively fixing the broken build's root cause which is that the
test-tooling package does not declare it's typings related dependencies
correctly: It implicitly uses the NodeJS standard library's types but
so far had not declared them on the package level.
4. This change is therefore to rectify the issue of the `@types/node`
dependency missing from the test-tooling package and also the refactoring
of some of the test ledger classes which were relying on the `streams`
builtin package instead of correctly using the NodeJS.ReadableStream global.
5. Earlier the reasoning for this was that we try to avoid pulling in
types from the global scope because we try to avoid any sort of dependency
on the global scope in general. Once we have proof though that this is
causing issues with the build, then we must give up the principle for
practical reasons (and only in the minimum viable scope, e.g. this does
not change the fact that everywhere else in the codebase we should still
do our best to avoid using the global scoped classes, types, functions,
etc..).

Thank you to @AndreAugusto11 and @RafaelAPB for pointing out this issue
through the pull request of his that is currently being worked on at the
time of this writing:
RafaelAPB#72

Related to but does not address hyperledger-cacti#2811

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>

refactor(SATP-Hermes): remove unused packages

* updated openapi version
* updated bungee plugin version to 2.0.0-alpha.2

Co-authored-by: Peter Somogyvari <peter.somogyvari@accenture.com>

Signed-off-by: André Augusto <andre.augusto@tecnico.ulisboa.pt>
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
RafaelAPB authored and AndreAugusto11 committed Mar 11, 2024
1 parent 50a07ba commit 91f1755
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export class SATPGateway {
private server: any | undefined;
// TODO!: add logic to manage sessions (parallelization, user input, freeze, unfreeze, rollback, recovery)
// private sessions: Map<string, Session> = new Map();

constructor(public readonly options: SATPGatewayConfig) {
const fnTag = `${this.label}#constructor()`;
Checks.truthy(options, `${fnTag} arg options`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export class GatewayOrchestrator {
}

async createChannel(identity: GatewayIdentity): Promise<GatewayChannel> {
const fnTag = `${this.label}#createChannel()`;
// add checks
const channel: GatewayChannel = {
id: identity.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class KnexLocalLogRepository implements ILocalLogRepository {

public constructor(config: Knex.Config | undefined) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const configFile = require("../../../knex/knexfile.ts")[
const configFile = require("../../../../knex/knexfile.ts")[
process.env.ENVIRONMENT || "development"
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class KnexRemoteLogRepository implements IRemoteLogRepository {
// simulating a remote log storage
public constructor(config: Knex.Config | undefined) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const configFile = require("../../../knex/knexfile-remote.ts")[
const configFile = require("../../../../knex/knexfile-remote.ts")[
process.env.ENVIRONMENT || "development"
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ beforeAll(async () => {
serverGatewayApiHost = `http://${address}:${port}`;

pluginRecipientGateway = new BesuSATPGateway(serverGatewayPluginOptions);
<<<<<<< HEAD
=======

expect(
pluginRecipientGateway.localRepository?.database,
).not.toBeUndefined();
>>>>>>> feat(SATP-Hermes): add gateway coordinator WIP

expect(pluginRecipientGateway.localRepository?.database).not.toBeUndefined();
expect(pluginRecipientGateway.remoteRepository?.database).not.toBeUndefined();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ let pluginSourceGateway: PluginSATPGateway;
let pluginRecipientGateway: PluginSATPGateway;

test("successful run ODAP instance", async () => {
console.log(knexRemoteConnection);
const sourceGatewayConstructor = {
name: "plugin-satp-gateway#sourceGateway",
dltIDs: ["DLT2"],
Expand Down
76 changes: 76 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8395,7 +8395,11 @@ __metadata:
"@types/uuid": "npm:9.0.6"
axios: "npm:1.6.0"
express: "npm:4.18.2"
<<<<<<< HEAD
fabric-network: "npm:2.2.20"
=======
fabric-network: "npm:2.2.19"
>>>>>>> feat(SATP-Hermes): add gateway coordinator WIP
typescript-optional: "npm:2.0.1"
uuid: "npm:9.0.1"
languageName: unknown
Expand Down Expand Up @@ -9471,7 +9475,11 @@ __metadata:
"@types/fs-extra": "npm:9.0.13"
"@types/js-yaml": "npm:4.0.3"
"@types/lodash": "npm:4.14.172"
<<<<<<< HEAD
"@types/node": "npm:18.11.9"
=======
"@types/node": "npm:20.11.24"
>>>>>>> feat(SATP-Hermes): add gateway coordinator WIP
"@types/node-forge": "npm:1.3.0"
"@types/ssh2": "npm:0.5.47"
"@types/ssh2-streams": "npm:0.1.9"
Expand Down Expand Up @@ -15646,6 +15654,18 @@ __metadata:
languageName: node
linkType: hard

<<<<<<< HEAD
=======
"@types/node@npm:20.11.24":
version: 20.11.24
resolution: "@types/node@npm:20.11.24"
dependencies:
undici-types: "npm:~5.26.4"
checksum: 10/7f34bfae5f9b98b9910230af4b4c52dc7fb2d1e96fdebfbc3d7576f8ab3d100076f193f9469add9e7418b455294155e7e6a028498cc5e98f9d49349875a459cf
languageName: node
linkType: hard

>>>>>>> feat(SATP-Hermes): add gateway coordinator WIP
"@types/node@npm:20.4.7":
version: 20.4.7
resolution: "@types/node@npm:20.4.7"
Expand Down Expand Up @@ -16951,6 +16971,15 @@ __metadata:
languageName: node
linkType: hard

"@typescript/vfs@npm:^1.4.0":
version: 1.5.0
resolution: "@typescript/vfs@npm:1.5.0"
dependencies:
debug: "npm:^4.1.1"
checksum: 10/9a60cfd4e4ef37f69558e7e8a0c4633f86aae969a4c1193435bfdf80eb9573d23850b65621631d07e2f9699a2d7351ae6d9caa46080595314bde03c2c63443dd
languageName: node
linkType: hard

"@ungap/structured-clone@npm:^1.2.0":
version: 1.2.0
resolution: "@ungap/structured-clone@npm:1.2.0"
Expand Down Expand Up @@ -28311,6 +28340,29 @@ __metadata:
languageName: node
linkType: hard

"fabric-common@npm:2.2.19":
version: 2.2.19
resolution: "fabric-common@npm:2.2.19"
dependencies:
callsite: "npm:^1.0.0"
elliptic: "npm:^6.5.4"
fabric-protos: "npm:2.2.19"
js-sha3: "npm:^0.8.0"
jsrsasign: "npm:^10.5.25"
long: "npm:^5.2.3"
nconf: "npm:^0.12.0"
pkcs11js: "npm:^1.3.0"
promise-settle: "npm:^0.3.0"
sjcl: "npm:^1.0.8"
winston: "npm:^2.4.5"
yn: "npm:^4.0.0"
dependenciesMeta:
pkcs11js:
optional: true
checksum: 10/23056da75976c600d197a5a9a504f4466db93a8f16ecf76fa96a9946d0ec75919edc278bfa765d80f37ed41c82ea729707a905da298fd121e12ee93ed32afc55
languageName: node
linkType: hard

"fabric-common@npm:2.2.20":
version: 2.2.20
resolution: "fabric-common@npm:2.2.20"
Expand Down Expand Up @@ -28356,6 +28408,18 @@ __metadata:
languageName: node
linkType: hard

"fabric-network@npm:2.2.19":
version: 2.2.19
resolution: "fabric-network@npm:2.2.19"
dependencies:
fabric-common: "npm:2.2.19"
fabric-protos: "npm:2.2.19"
long: "npm:^5.2.3"
nano: "npm:^9.0.5"
checksum: 10/cf7adada9411d9168a073f6878074971211f6bc48c06f33bda7c95ac823ddf4d9ef217c6ac996235c41b0e414606184dde563f69f7f284469ca51f34a3628e88
languageName: node
linkType: hard

"fabric-network@npm:2.2.20":
version: 2.2.20
resolution: "fabric-network@npm:2.2.20"
Expand All @@ -28379,6 +28443,18 @@ __metadata:
languageName: node
linkType: hard

"fabric-protos@npm:2.2.19":
version: 2.2.19
resolution: "fabric-protos@npm:2.2.19"
dependencies:
"@grpc/grpc-js": "npm:~1.9.0"
"@grpc/proto-loader": "npm:^0.7.0"
long: "npm:^5.2.3"
protobufjs: "npm:^7.2.0"
checksum: 10/d82b98a292f53cdbcbe27b3673721fbff5aece1075b79c580e75f7047c69ec1483e370c5dc3bc4332c0d4768b0af44bbf682318c2544d2a97f8543c69c77f078
languageName: node
linkType: hard

"fabric-protos@npm:2.2.20":
version: 2.2.20
resolution: "fabric-protos@npm:2.2.20"
Expand Down

0 comments on commit 91f1755

Please sign in to comment.