diff --git a/examples/cartrade/package.json b/examples/cartrade/package.json index c434086621..9c26bb86f2 100644 --- a/examples/cartrade/package.json +++ b/examples/cartrade/package.json @@ -27,7 +27,7 @@ "log4js": "^3.0.6", "morgan": "~1.9.1", "shelljs": "^0.8.4", - "socket.io": "^2.0.4", + "socket.io": "4.1.3", "ts-node": "8.9.1", "web3": "^1.2.9", "xmlhttprequest": "^1.8.0" diff --git a/examples/cartrade/script-test-getFunctions/fabric/package.json b/examples/cartrade/script-test-getFunctions/fabric/package.json index 9311c0ef22..bc50d4f3fc 100644 --- a/examples/cartrade/script-test-getFunctions/fabric/package.json +++ b/examples/cartrade/script-test-getFunctions/fabric/package.json @@ -1,11 +1,10 @@ { - "name": "validatorDriver", - "version": "0.0.0", - "private": true, - "dependencies": { - "config": "^1.26.1", - "socket.io": "^2.0.4", - "fabric-ca-client": "2.2.10", - "fabric-network": "2.2.10" - } + "name": "validatorDriver", + "version": "0.0.0", + "private": true, + "dependencies": { + "config": "^1.26.1", + "fabric-ca-client": "2.2.10", + "fabric-network": "2.2.10" + } } \ No newline at end of file diff --git a/examples/cartrade/validatorDriver/package.json b/examples/cartrade/validatorDriver/package.json index 8b06050954..aa5db1264b 100644 --- a/examples/cartrade/validatorDriver/package.json +++ b/examples/cartrade/validatorDriver/package.json @@ -19,7 +19,7 @@ "log4js": "^3.0.6", "morgan": "~1.8.1", "serve-favicon": "~2.4.2", - "socket.io": "^2.0.4", + "socket.io": "4.1.3", "ethereumjs-common": "^1.5.1", "ethereumjs-tx": "^2.1.2", "web3": "^1.2.9", diff --git a/examples/discounted-cartrade/package.json b/examples/discounted-cartrade/package.json index c6d01340bb..dd025098aa 100644 --- a/examples/discounted-cartrade/package.json +++ b/examples/discounted-cartrade/package.json @@ -10,7 +10,7 @@ "copy-static-assets": "ts-node copyStaticAssets.ts", "copy-blp-config": "ts-node copyBLPConfig.ts", "replace-blp-config-path": "ts-node replaceBLPConfigPath.ts", - "init-discounted-cartrade": "ln -s ../examples/discounted-cartrade/node_modules ../../dist/node_modules" + "init-discounted-cartrade": "ln -fs ../examples/discounted-cartrade/node_modules ../../dist/node_modules" }, "dependencies": { "@types/node": "^14.0.24", @@ -22,13 +22,14 @@ "express": "~4.16.1", "fabric-ca-client": "2.2.10", "fabric-network": "2.2.10", + "fabric-client": "^1.4.0", "http-errors": "~1.6.3", "indy-sdk": "^1.16.0-dev-1636", "jsonwebtoken": "^8.5.1", "log4js": "^3.0.6", "morgan": "~1.9.1", "shelljs": "^0.8.4", - "socket.io": "^2.0.4", + "socket.io": "4.1.3", "ts-node": "8.9.1", "web3": "^1.2.9", "xmlhttprequest": "^1.8.0" diff --git a/examples/discounted-cartrade/script-test-getFunctions/fabric/package.json b/examples/discounted-cartrade/script-test-getFunctions/fabric/package.json index 9311c0ef22..bc50d4f3fc 100644 --- a/examples/discounted-cartrade/script-test-getFunctions/fabric/package.json +++ b/examples/discounted-cartrade/script-test-getFunctions/fabric/package.json @@ -1,11 +1,10 @@ { - "name": "validatorDriver", - "version": "0.0.0", - "private": true, - "dependencies": { - "config": "^1.26.1", - "socket.io": "^2.0.4", - "fabric-ca-client": "2.2.10", - "fabric-network": "2.2.10" - } + "name": "validatorDriver", + "version": "0.0.0", + "private": true, + "dependencies": { + "config": "^1.26.1", + "fabric-ca-client": "2.2.10", + "fabric-network": "2.2.10" + } } \ No newline at end of file diff --git a/examples/discounted-cartrade/validatorDriver/package.json b/examples/discounted-cartrade/validatorDriver/package.json index 8b06050954..aa5db1264b 100644 --- a/examples/discounted-cartrade/validatorDriver/package.json +++ b/examples/discounted-cartrade/validatorDriver/package.json @@ -19,7 +19,7 @@ "log4js": "^3.0.6", "morgan": "~1.8.1", "serve-favicon": "~2.4.2", - "socket.io": "^2.0.4", + "socket.io": "4.1.3", "ethereumjs-common": "^1.5.1", "ethereumjs-tx": "^2.1.2", "web3": "^1.2.9", diff --git a/examples/discounted-cartrade/validatorDriver/src/driver-common.ts b/examples/discounted-cartrade/validatorDriver/src/driver-common.ts index 5c74cc84e1..c6d6cc82b2 100644 --- a/examples/discounted-cartrade/validatorDriver/src/driver-common.ts +++ b/examples/discounted-cartrade/validatorDriver/src/driver-common.ts @@ -22,10 +22,6 @@ export function json2str(jsonObj: object) { } } -// Validator test program.(socket.io client) -const io = require("socket.io-client"); -//var config = require('config'); - export function makeApiInfoList(targetApiInfo: any): Array { const retApiInfoList: Array = []; for (const item of targetApiInfo) { diff --git a/examples/discounted-cartrade/validatorDriver/src/ethereumValidatorAccess.ts b/examples/discounted-cartrade/validatorDriver/src/ethereumValidatorAccess.ts index 4bd7ad5ba8..2f29367005 100644 --- a/examples/discounted-cartrade/validatorDriver/src/ethereumValidatorAccess.ts +++ b/examples/discounted-cartrade/validatorDriver/src/ethereumValidatorAccess.ts @@ -19,7 +19,7 @@ import { deleteAndDisconnectSocke, } from "./driver-common"; -const io = require("socket.io-client"); +import { io } from "socket.io-client"; const targetValidatorUrl = "https://localhost:5050"; diff --git a/examples/discounted-cartrade/validatorDriver/src/fabricValidatorAccess.ts b/examples/discounted-cartrade/validatorDriver/src/fabricValidatorAccess.ts index bdff81e6b3..577fa54bd9 100644 --- a/examples/discounted-cartrade/validatorDriver/src/fabricValidatorAccess.ts +++ b/examples/discounted-cartrade/validatorDriver/src/fabricValidatorAccess.ts @@ -19,7 +19,7 @@ import { deleteAndDisconnectSocke, } from "./driver-common"; -const io = require("socket.io-client"); +import { io } from "socket.io-client"; const targetValidatorUrl = "https://localhost:5040"; diff --git a/examples/discounted-cartrade/validatorDriver/testDriver_sendSignedProposal.js b/examples/discounted-cartrade/validatorDriver/testDriver_sendSignedProposal.js index ead1e0e759..2cd01d43e3 100644 --- a/examples/discounted-cartrade/validatorDriver/testDriver_sendSignedProposal.js +++ b/examples/discounted-cartrade/validatorDriver/testDriver_sendSignedProposal.js @@ -344,8 +344,6 @@ function sendRequest() { .then((returnvalue) => { //console.log('success : ' + json2str(returnvalue)); - ////socket.emit('request', returnvalue); - // call WebAPI console.log("##call WebAPI"); var param = { diff --git a/examples/electricity-trade/package.json b/examples/electricity-trade/package.json index 9da8d8eb7f..6f1436c0bf 100644 --- a/examples/electricity-trade/package.json +++ b/examples/electricity-trade/package.json @@ -27,7 +27,7 @@ "log4js": "^3.0.6", "morgan": "~1.9.1", "shelljs": "^0.8.4", - "socket.io": "^2.0.4", + "socket.io": "4.1.3", "ts-node": "8.9.1", "web3": "^1.2.9", "xmlhttprequest": "^1.8.0" diff --git a/examples/electricity-trade/tools/transferNumericAsset/package.json b/examples/electricity-trade/tools/transferNumericAsset/package.json index bd051d2b66..43faba1828 100644 --- a/examples/electricity-trade/tools/transferNumericAsset/package.json +++ b/examples/electricity-trade/tools/transferNumericAsset/package.json @@ -15,7 +15,7 @@ "ethereumjs-tx": "^2.1.2", "ts-node": "^9.0.0", "web3": "^1.2.9", - "socket.io": "^2.0.4" + "socket.io": "4.1.3" }, "devDependencies": { "typescript": "^3.9.3" diff --git a/examples/electricity-trade/tools/transferNumericAsset/transferNumericAsset.ts b/examples/electricity-trade/tools/transferNumericAsset/transferNumericAsset.ts index 0a7acdc69f..9af42138f2 100644 --- a/examples/electricity-trade/tools/transferNumericAsset/transferNumericAsset.ts +++ b/examples/electricity-trade/tools/transferNumericAsset/transferNumericAsset.ts @@ -5,9 +5,10 @@ * transferNumericAsset.ts */ +import { io } from "socket.io-client"; + { // Validator test program.(socket.io client) - const io = require("socket.io-client"); const config = require("config"); // Specify the server (Validator) of the communication destination @@ -32,7 +33,7 @@ } console.log( - `execution parameter : fromAddress = ${process.argv[2]}, toAddress = ${process.argv[3]}, amount = ${process.argv[4]}` + `execution parameter : fromAddress = ${process.argv[2]}, toAddress = ${process.argv[3]}, amount = ${process.argv[4]}`, ); const fromAddress = process.argv[2]; diff --git a/examples/test-run-transaction/package.json b/examples/test-run-transaction/package.json index 83169b761b..1e80941099 100644 --- a/examples/test-run-transaction/package.json +++ b/examples/test-run-transaction/package.json @@ -27,7 +27,7 @@ "log4js": "^3.0.6", "morgan": "~1.9.1", "shelljs": "^0.8.4", - "socket.io": "^2.0.4", + "socket.io": "4.1.3", "ts-node": "8.9.1", "web3": "^1.2.9", "xmlhttprequest": "^1.8.0" diff --git a/jest.config.js b/jest.config.js index 956a815a21..0822f27aa9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -54,7 +54,6 @@ module.exports = { `./packages/cactus-test-cmd-api-server/src/test/typescript/integration/plugin-import-with-npm-install.test.ts`, `./packages/cactus-test-cmd-api-server/src/test/typescript/integration/plugin-import-with-npm-install-version-selection.test.ts`, `./packages/cactus-test-cmd-api-server/src/test/typescript/integration/runtime-plugin-imports.test.ts`, - `./packages/cactus-cmd-socketio-server/`, `./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/openapi/openapi-validation.test.ts`, `./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes-v4.7.test.ts`, `./packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/jvm-kotlin-spring-server-v4.7.test.ts`, diff --git a/packages-python/cactus_validator_socketio/testcli/package.json b/packages-python/cactus_validator_socketio/testcli/package.json index e5025d4429..ac01e019a1 100644 --- a/packages-python/cactus_validator_socketio/testcli/package.json +++ b/packages-python/cactus_validator_socketio/testcli/package.json @@ -3,6 +3,6 @@ "version": "0.0.0", "private": true, "dependencies": { - "socket.io-client": "^4.1.2" + "socket.io-client": "4.1.3" } } diff --git a/packages-python/cactus_validator_socketio_iroha/README.md b/packages-python/cactus_validator_socketio_iroha/README.md index 4d39933b7b..1438a716a0 100644 --- a/packages-python/cactus_validator_socketio_iroha/README.md +++ b/packages-python/cactus_validator_socketio_iroha/README.md @@ -19,74 +19,77 @@ This validator codes provides the following features: ### How to execute test client (in the current status, only the monitor feature can be tested) 1. Launch [iroha-testnet](https://github.com/hyperledger/cactus/tree/main/tools/docker/iroha-testnet) docker and execute its wallet script - ``` - $ cd cactus/tools/docker/iroha-testnet/ - $ docker-compose up -d - $ cd example/iroha-wallet - $ bash setup-iroha-wallet.sh - ``` + ``` + $ cd cactus/tools/docker/iroha-testnet/ + $ docker-compose up -d + $ cd example/iroha-wallet + $ bash setup-iroha-wallet.sh + ``` 1. Launch validator server on the first console - ``` - $ cd cactus/packages-python/cactus_validator_socketio_iroha/validator-python - $ pip3 install websocket eventlet flask requests flask-socketio==4.3.2 pyyaml pyjwt cryptography iroha schedule - $ python3 -m main - ``` - - If there is the following message on your first console, the validator is successfully launched. - - ``` - socket port: 5060 - Server initialized for eventlet. - ``` + ``` + $ cd cactus/packages-python/cactus_validator_socketio_iroha/ + $ python3 -m venv .venv + $ . .venv/bin/activate + $ pip3 install websocket eventlet flask requests flask-socketio==5.1.1 pyyaml pyjwt cryptography iroha schedule + $ cd ./validator-python + $ python3 -m main + ``` + - If there is the following message on your first console, the validator is successfully launched. + + ``` + socket port: 5060 + Server initialized for eventlet. + ``` 1. Execute test script on the second console - ``` - $ cd cactus/packages-python/cactus_validator_socketio_iroha/testcli - $ npm install - $ node testsock.js - ``` - - - If there is the following message on your second console, the block monitoring request is successfully executed. - - ``` - connect - 81680a4dc06a4685b8219b22fd002023 - polling - call nop! - ##exec requestStartMonitor() - ``` - - - After this request is executed, the messages about monitoring blocks (`##get_block block num is : n`) will appear on your first console. - - ``` - 81680a4dc06a4685b8219b22fd002023: Sending packet OPEN data {'sid': '81680a4dc06a4685b8219b22fd002023', 'upgrades': ['websocket'], 'pingTimeout': 60000, 'pingInterval': 25000} - on connect (sessionid: 81680a4dc06a4685b8219b22fd002023) - ##called getValidatorInstance() - ##IrohaConnector.__init__ - 81680a4dc06a4685b8219b22fd002023: Sending packet MESSAGE data 0 - 81680a4dc06a4685b8219b22fd002023: Received request to upgrade to websocket - 81680a4dc06a4685b8219b22fd002023: Received packet MESSAGE data 2["test-event"] - received event "test-event" from 81680a4dc06a4685b8219b22fd002023 [/] - ##IrohaConnector.cb() - 81680a4dc06a4685b8219b22fd002023: Upgrade to websocket successful - 81680a4dc06a4685b8219b22fd002023: Received packet MESSAGE data 2["nop"] - received event "nop" from 81680a4dc06a4685b8219b22fd002023 [/] - received nop - ##IrohaConnector.nop() - 81680a4dc06a4685b8219b22fd002023: Received packet MESSAGE data 2["startMonitor"] - received event "startMonitor" from 81680a4dc06a4685b8219b22fd002023 [/] - on startMonitor - ##called monitoring_routine() - ##get_block block num is : 1 - ##get_block block num is : 2 - ##get_block block num is : 3 - ... - ##get_block block num is : 12 - ``` - - - After 180 seconds on the second console, run requestStopMonitor and the test script will stop running. - - ``` - ##exec requestStopMonitor() - ``` + ``` + $ cd cactus/packages-python/cactus_validator_socketio_iroha/testcli + $ npm install + $ node testsock.js + ``` + + - If there is the following message on your second console, the block monitoring request is successfully executed. + + ``` + connect + 81680a4dc06a4685b8219b22fd002023 + polling + call nop! + ##exec requestStartMonitor() + ``` + + - After this request is executed, the messages about monitoring blocks (`##get_block block num is : n`) will appear on your first console. + + ``` + 81680a4dc06a4685b8219b22fd002023: Sending packet OPEN data {'sid': '81680a4dc06a4685b8219b22fd002023', 'upgrades': ['websocket'], 'pingTimeout': 60000, 'pingInterval': 25000} + on connect (sessionid: 81680a4dc06a4685b8219b22fd002023) + ##called getValidatorInstance() + ##IrohaConnector.__init__ + 81680a4dc06a4685b8219b22fd002023: Sending packet MESSAGE data 0 + 81680a4dc06a4685b8219b22fd002023: Received request to upgrade to websocket + 81680a4dc06a4685b8219b22fd002023: Received packet MESSAGE data 2["test-event"] + received event "test-event" from 81680a4dc06a4685b8219b22fd002023 [/] + ##IrohaConnector.cb() + 81680a4dc06a4685b8219b22fd002023: Upgrade to websocket successful + 81680a4dc06a4685b8219b22fd002023: Received packet MESSAGE data 2["nop"] + received event "nop" from 81680a4dc06a4685b8219b22fd002023 [/] + received nop + ##IrohaConnector.nop() + 81680a4dc06a4685b8219b22fd002023: Received packet MESSAGE data 2["startMonitor"] + received event "startMonitor" from 81680a4dc06a4685b8219b22fd002023 [/] + on startMonitor + ##called monitoring_routine() + ##get_block block num is : 1 + ##get_block block num is : 2 + ##get_block block num is : 3 + ... + ##get_block block num is : 12 + ``` + + - After 180 seconds on the second console, run requestStopMonitor and the test script will stop running. + + ``` + ##exec requestStopMonitor() + ``` diff --git a/packages-python/cactus_validator_socketio_iroha/testcli/package.json b/packages-python/cactus_validator_socketio_iroha/testcli/package.json index 3a7559f248..9930e66ad4 100644 --- a/packages-python/cactus_validator_socketio_iroha/testcli/package.json +++ b/packages-python/cactus_validator_socketio_iroha/testcli/package.json @@ -5,6 +5,6 @@ "dependencies": { "json-bigint": "^1.0.0", "jsonwebtoken": "^8.5.1", - "socket.io-client": "^2.4.0" + "socket.io-client": "4.1.3" } } diff --git a/packages/cactus-cmd-socketio-server/jest.config.js b/packages/cactus-cmd-socketio-server/jest.config.js deleted file mode 100644 index ae95635f17..0000000000 --- a/packages/cactus-cmd-socketio-server/jest.config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - preset: "ts-jest", - testEnvironment: "node", - maxWorkers: 1, - maxConcurrency: 1, - setupFilesAfterEnv: ["jest-extended"], - testTimeout: 60 * 60 * 1000, - testMatch: [`**/test/**/*.test.ts`], -}; diff --git a/packages/cactus-cmd-socketio-server/package.json b/packages/cactus-cmd-socketio-server/package.json index c8e56f84f0..f9fde3afd9 100644 --- a/packages/cactus-cmd-socketio-server/package.json +++ b/packages/cactus-cmd-socketio-server/package.json @@ -1,23 +1,15 @@ { "name": "@hyperledger/cactus-cmd-socket-server", "version": "1.0.0-rc.3", - "private": true, + "license": "Apache-2.0", "scripts": { "build": "npm run build-ts && npm run build:dev:backend:postbuild", "build-ts": "tsc", "build:dev:backend:postbuild": "npm run copy-static-assets", "copy-static-assets": "ts-node copyStaticAssets.ts" }, - "workspaces": { - "packages": [ - "src/*" - ], - "nohoist": [ - "@types/socket.io", - "@types/socket.io-client" - ] - }, "dependencies": { + "@hyperledger/cactus-common": "1.0.0-rc.3", "@types/node": "^14.0.24", "body-parser": "^1.19.0", "cookie-parser": "~1.4.4", @@ -32,13 +24,13 @@ "log4js": "^3.0.6", "morgan": "~1.9.1", "shelljs": "^0.8.4", - "socket.io": "^2.0.4", + "socket.io": "4.1.3", + "socket.io-client": "4.1.3", "ts-node": "8.9.1", "web3": "^1.2.9", "xmlhttprequest": "^1.8.0" }, "devDependencies": { - "@types/socket.io": "^2.0.4", - "@types/socket.io-client": "^1.4.36" + "@hyperledger/cactus-test-tooling": "1.0.0-rc.3" } } diff --git a/packages/cactus-cmd-socketio-server/src/main/typescript/routing-interface/util/DBAccess.ts b/packages/cactus-cmd-socketio-server/src/main/typescript/routing-interface/util/DBAccess.ts index fdf879371a..7e2292f895 100644 --- a/packages/cactus-cmd-socketio-server/src/main/typescript/routing-interface/util/DBAccess.ts +++ b/packages/cactus-cmd-socketio-server/src/main/typescript/routing-interface/util/DBAccess.ts @@ -24,9 +24,9 @@ const configContract: any = yaml.safeLoad( ); export class DBAccess { - ledgerPluginInfo: LedgerPluginInfo[]; - contractInfo: []; - blpRegistryInfo: []; + ledgerPluginInfo: LedgerPluginInfo[] = []; + contractInfo: [] = []; + blpRegistryInfo: [] = []; constructor() { // TODO: DB Access Initialization diff --git a/packages/cactus-cmd-socketio-server/src/main/typescript/verifier/Verifier.ts b/packages/cactus-cmd-socketio-server/src/main/typescript/verifier/Verifier.ts index 7a89663772..1fd8f4a65c 100644 --- a/packages/cactus-cmd-socketio-server/src/main/typescript/verifier/Verifier.ts +++ b/packages/cactus-cmd-socketio-server/src/main/typescript/verifier/Verifier.ts @@ -18,8 +18,7 @@ import { ConfigUtil } from "../routing-interface/util/ConfigUtil"; import { VerifierAuthentication } from "./VerifierAuthentication"; const XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; -import io from "socket.io-client"; -import { Socket } from "socket.io-client"; +import { Socket, io } from "socket.io-client"; const fs = require("fs"); const path = require("path"); @@ -47,7 +46,7 @@ export class Verifier implements IVerifier { apiInfo: Array = []; counterReqID = 1; eventListenerHash: { [key: string]: VerifierEventListener } = {}; // Listeners for events from Ledger - static mapUrlSocket: Map = new Map(); + static mapUrlSocket: Map = new Map(); checkValidator: (key: string, data: string) => Promise = VerifierAuthentication.verify; @@ -359,6 +358,13 @@ export class Verifier implements IVerifier { reject(err); }); + socket.on("monitor_error", (err: object) => { + logger.error("##monitor_error:", err); + // end communication + socket.disconnect(); + reject(err); + }); + socket.on("connect_timeout", (err: object) => { logger.error("####Error:", err); // end communication diff --git a/packages/cactus-cmd-socketio-server/src/main/typescript/verifier/validator-registry.ts b/packages/cactus-cmd-socketio-server/src/main/typescript/verifier/validator-registry.ts index 7f34528126..7c7a3a154e 100644 --- a/packages/cactus-cmd-socketio-server/src/main/typescript/verifier/validator-registry.ts +++ b/packages/cactus-cmd-socketio-server/src/main/typescript/verifier/validator-registry.ts @@ -8,17 +8,17 @@ const fs = require("fs"); const yaml = require("js-yaml"); -class RequestedData { +type RequestedData = { dataName: string; dataType: string; -} +}; -class ApiInfo { +type ApiInfo = { apiType: string; requestedData: Array; -} +}; -export class LedgerPluginInfo { +export type LedgerPluginInfo = { validatorID: string; validatorType: string; validatorURL: string; @@ -27,14 +27,14 @@ export class LedgerPluginInfo { ledgerAbstract: string; }; apiInfo: Array; -} +}; -class Peer { +type Peer = { name: string; requests: string; -} +}; -class SignTxInfo { +type SignTxInfo = { ethereum: { chainName: string; networkID: string; @@ -59,7 +59,7 @@ class SignTxInfo { channelName: string; chaincodeID: string; }; -} +}; export class ValidatorRegistry { ledgerPluginInfo: Array; diff --git a/packages/cactus-cmd-socketio-server/src/test/typescript/unit/DriverCommon.test.ts b/packages/cactus-cmd-socketio-server/src/test/typescript/unit/DriverCommon.test.ts index c6ca1086ac..b8ef87be3a 100644 --- a/packages/cactus-cmd-socketio-server/src/test/typescript/unit/DriverCommon.test.ts +++ b/packages/cactus-cmd-socketio-server/src/test/typescript/unit/DriverCommon.test.ts @@ -33,7 +33,7 @@ test("json2str return stringified JSON", () => { test("json2str return null when given wrong input", () => { // Circular reference input const input = {}; - input["field"] = input; + (input as any)["field"] = input; expect(DriverCommon.json2str(input)).toBeNull(); // Undefined input diff --git a/packages/cactus-cmd-socketio-server/src/test/typescript/unit/TestSocketHelpers.ts b/packages/cactus-cmd-socketio-server/src/test/typescript/unit/TestSocketHelpers.ts deleted file mode 100644 index c072c1c623..0000000000 --- a/packages/cactus-cmd-socketio-server/src/test/typescript/unit/TestSocketHelpers.ts +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Helper module for setting up client/server test sockets. - */ - -import ioServer from "socket.io"; -import io from "socket.io-client"; -import { createServer } from "http"; - -export { ioServer }; - -/** - * Create a socket.io server listening on random local port for test purposes. - * Returns [server, port] - */ -export function createListeningMockServer(): Promise< - [SocketIO.Server, string] -> { - return new Promise((resolve, reject) => { - const httpServer = createServer(); - httpServer.unref(); - - const testServer = ioServer(httpServer, { - transports: ["websocket"], - cookie: false, - }); - - httpServer.listen(0, () => { - const addrInfo = httpServer.address(); - - if (addrInfo && typeof addrInfo == "object") { - const port = addrInfo.port.toString(); - resolve([testServer, port]); - } else { - reject(Error("Couldn't create mock server")); - } - }); - }); -} - -/** - * Create client socket. - */ -export function createClientSocket(port: string): SocketIOClient.Socket { - return io(`http://localhost:${port}`, { - reconnectionAttempts: 10, - reconnectionDelay: 1000, - transports: ["websocket"], - }); -} - -/** - * Connects supplied client to the test server. - * Returns client Socket - */ -export function connectTestClient( - socket: SocketIOClient.Socket, -): Promise { - return new Promise((resolve, reject) => { - // Install setup-time error handlers - let errorHandlerFactory = (event: string) => { - return (err: object) => { - if (socket) { - socket.close(); - reject(err); - } - }; - }; - - socket.on("error", errorHandlerFactory("connect_error")); - socket.on("connect_error", errorHandlerFactory("connect_error")); - socket.on("connect_timeout", errorHandlerFactory("connect_error")); - - socket.on("connect", () => { - socket.removeAllListeners(); - resolve(socket); - }); - }); -} diff --git a/packages/cactus-cmd-socketio-server/src/test/typescript/unit/ValidatorAuthentication.test.ts b/packages/cactus-cmd-socketio-server/src/test/typescript/unit/ValidatorAuthentication.test.ts index a9de3af60c..1dc8279e72 100644 --- a/packages/cactus-cmd-socketio-server/src/test/typescript/unit/ValidatorAuthentication.test.ts +++ b/packages/cactus-cmd-socketio-server/src/test/typescript/unit/ValidatorAuthentication.test.ts @@ -78,7 +78,7 @@ test("Static method sign encrypts payload using private key", () => { log.debug("decryptedMessage:", decryptedMessage); expect(decryptedMessage).toMatchObject(message); - const decryptedJwt = decryptedMessage as jwt.JwtPayload; + const decryptedJwt = decryptedMessage as { iat: number; exp: number }; // Assert issue at expect(decryptedJwt.iat).toBeNumber(); diff --git a/packages/cactus-cmd-socketio-server/src/test/typescript/unit/Verifier.test.ts b/packages/cactus-cmd-socketio-server/src/test/typescript/unit/Verifier.test.ts index c1d654dd18..318cd07602 100644 --- a/packages/cactus-cmd-socketio-server/src/test/typescript/unit/Verifier.test.ts +++ b/packages/cactus-cmd-socketio-server/src/test/typescript/unit/Verifier.test.ts @@ -48,7 +48,7 @@ import { cloneDeep } from "lodash"; // Mock default config import * as ConfigUtil from "../../../main/typescript/routing-interface/util/ConfigUtil"; jest.mock("../../../main/typescript/routing-interface/util/ConfigUtil"); -ConfigUtil["__configMock"] = defaultConfig; +(ConfigUtil as any)["__configMock"] = defaultConfig; const XMLHttpRequest = require("xmlhttprequest"); jest.mock("xmlhttprequest"); @@ -73,12 +73,7 @@ import { VerifierEventListener, } from "../../../main/typescript/verifier/LedgerPlugin"; -import { - createListeningMockServer, - createClientSocket, - connectTestClient, - ioServer, -} from "./TestSocketHelpers"; +import { SocketIOTestSetupHelpers } from "@hyperledger/cactus-test-tooling"; ////////////////////////////// // TEST TIMEOUT @@ -167,14 +162,15 @@ describe("SocketIO Validator Tests", function () { const reqMethod = { type: "web3Eth", command: "getBalance" }; const reqArgs = ["06fc56347d91c6ad2dae0c3ba38eb12ab0d72e97"]; - let testServer: SocketIO.Server; + let testServer: SocketIOTestSetupHelpers.Server; let testServerPort: string; - let clientSocket: SocketIOClient.Socket; - let serverSocket: ioServer.Socket; + let clientSocket: SocketIOTestSetupHelpers.ClientSocket; + let serverSocket: SocketIOTestSetupHelpers.ServerSocket; let sut: Verifier; beforeAll(async () => { - [testServer, testServerPort] = await createListeningMockServer(); + [testServer, testServerPort] = + await SocketIOTestSetupHelpers.createListeningMockServer(); }); afterAll((done) => { @@ -185,7 +181,7 @@ describe("SocketIO Validator Tests", function () { }); beforeEach(async () => { - clientSocket = createClientSocket(testServerPort); + clientSocket = SocketIOTestSetupHelpers.createClientSocket(testServerPort); // Mock client socket in verifier sut = new Verifier(JSON.stringify(defaultLedgerData)); @@ -218,7 +214,7 @@ describe("SocketIO Validator Tests", function () { serverSocket = socket; }); - await connectTestClient(clientSocket); + await SocketIOTestSetupHelpers.connectTestClient(clientSocket); expect(clientSocket.connected).toBeTrue(); expect(serverSocket.connected).toBeTrue(); }); @@ -228,29 +224,6 @@ describe("SocketIO Validator Tests", function () { await expect(reqPromise).resolves.toEqual({ status: 504, amount: 0 }); // timeout }); - test.each(["connect_error", "connect_timeout"])( - "Handles socketio error event '%s'", - async (errorEvent) => { - const error = { code: 123, message: "Some test error A" }; - - const reqPromise = sut.sendSyncRequest(reqContract, reqMethod, reqArgs); - serverSocket.emit(errorEvent, error); - - await expect(reqPromise).rejects.toEqual(error); - expect(clientSocket.disconnected).toBeTrue(); - }, - ); - - test("Handles socketio client generic error", async () => { - const error = { code: 123, message: "Some test error B" }; - - const reqPromise = sut.sendSyncRequest(reqContract, reqMethod, reqArgs); - clientSocket.emit("error", error); - - await expect(reqPromise).rejects.toEqual(error); - expect(clientSocket.disconnected).toBeTrue(); - }); - test("Sends request2 with valid arguments", () => { let reqReceived = new Promise((resolve) => { serverSocket.on("request2", (req: any) => resolve(req)); @@ -402,7 +375,7 @@ describe("SocketIO Validator Tests", function () { expect(sut.eventListenerHash[appId]).toBe(listenerMock); // Connection error for monitor exit - serverSocket.emit("connect_error", { + serverSocket.emit("monitor_error", { code: 123, message: "Force exit error", }); @@ -412,34 +385,6 @@ describe("SocketIO Validator Tests", function () { return expect(sut.startMonitor(appId, options, listenerMock)).toReject(); }); - test.each(["connect_error", "connect_timeout"])( - "Handles socketio error event '%s'", - async (errorEvent) => { - const error = { code: 123, message: "Some test error" }; - - testServer.on("connection", (socket) => { - log.debug("Server socket connected", socket.id); - serverSocket = socket; - serverSocket.emit(errorEvent, error); - }); - - await expect( - sut.startMonitor(appId, options, listenerMock), - ).rejects.toEqual(error); - expect(clientSocket.disconnected).toBeTrue(); - }, - ); - - test("Handles socketio client generic error", async () => { - const error = { code: 123, message: "Some test error D" }; - - const reqPromise = sut.startMonitor(appId, options, listenerMock); - clientSocket.emit("error", error); - - await expect(reqPromise).rejects.toEqual(error); - expect(clientSocket.disconnected).toBeTrue(); - }); - test("Triggers listener callbacks when received a message from a validator", (done) => { const decryptedBlockData = "fooDecrypted321"; const eventStatus = 200; @@ -519,7 +464,9 @@ describe("SocketIO Validator Tests", function () { setTimeout( () => - serverSocket.emit("connect_error", { message: "Force close" }), + serverSocket.emit("monitor_error", { + message: "Force close", + }), 150, ); }); @@ -586,7 +533,7 @@ describe("SocketIO Validator Tests", function () { serverSocket = socket; }); - await connectTestClient(clientSocket); + await SocketIOTestSetupHelpers.connectTestClient(clientSocket); expect(clientSocket.connected).toBeTrue(); expect(serverSocket.connected).toBeTrue(); }); diff --git a/packages/cactus-cmd-socketio-server/src/test/typescript/unit/VerifierFactory.test.ts b/packages/cactus-cmd-socketio-server/src/test/typescript/unit/VerifierFactory.test.ts index 0583f043d3..0d98ffc2a3 100644 --- a/packages/cactus-cmd-socketio-server/src/test/typescript/unit/VerifierFactory.test.ts +++ b/packages/cactus-cmd-socketio-server/src/test/typescript/unit/VerifierFactory.test.ts @@ -26,6 +26,7 @@ const log: Logger = LoggerProvider.getOrCreate({ }); // Mock ledger data +jest.mock("fs"); import { LPInfoHolder } from "../../../main/typescript/routing-interface/util/LPInfoHolder"; jest.mock("../../../main/typescript/routing-interface/util/LPInfoHolder"); const mockLedgerData = "{mockLedgerData}" diff --git a/packages/cactus-cmd-socketio-server/tsconfig.json b/packages/cactus-cmd-socketio-server/tsconfig.json index abaf099b64..9a53bcdb15 100644 --- a/packages/cactus-cmd-socketio-server/tsconfig.json +++ b/packages/cactus-cmd-socketio-server/tsconfig.json @@ -16,5 +16,13 @@ "exclude": [ "copyStaticAssets.ts", "./src/main/typescript/verifier/ValidatorAuthentication.ts" + ], + "references": [ + { + "path": "../cactus-common/tsconfig.json" + }, + { + "path": "../cactus-test-tooling/tsconfig.json" + } ] } diff --git a/packages/cactus-plugin-ledger-connector-fabric-socketio/package.json b/packages/cactus-plugin-ledger-connector-fabric-socketio/package.json index 7e43648b8b..4d1ca014a7 100644 --- a/packages/cactus-plugin-ledger-connector-fabric-socketio/package.json +++ b/packages/cactus-plugin-ledger-connector-fabric-socketio/package.json @@ -28,7 +28,7 @@ "morgan": "~1.8.1", "serve-favicon": "~2.4.2", "shelljs": "^0.8.4", - "socket.io": "^2.0.4", + "socket.io": "4.1.3", "ts-node": "^9.0.0" } } diff --git a/packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/common/core/bin/www.ts b/packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/common/core/bin/www.ts index fff9c29d71..879e213202 100644 --- a/packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/common/core/bin/www.ts +++ b/packages/cactus-plugin-ledger-connector-fabric-socketio/src/main/typescript/common/core/bin/www.ts @@ -20,6 +20,7 @@ const debug = require("debug")("connector:server"); import https = require("https"); import { config } from "../config/default"; import fs = require("fs"); +import { Server } from "socket.io" // Log settings import { getLogger } from "log4js"; @@ -52,7 +53,7 @@ const sslParam = { */ const server = https.createServer(sslParam, app); // Start as an https server. -const io = require("socket.io")(server); +const io = new Server(server); /** * Listen on provided port, on all network interfaces. diff --git a/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/package.json b/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/package.json index 5e904bafac..74021f0a10 100644 --- a/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/package.json +++ b/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/package.json @@ -11,7 +11,7 @@ "dependencies": { "@types/node": "^14.14.5", "config": "^1.26.1", - "socket.io": "^2.0.4", + "socket.io-client": "4.1.3", "ts-node": "^9.0.0", "fabric-ca-client": "2.2.10", "fabric-network": "2.2.10", diff --git a/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_changeCarOwner.ts b/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_changeCarOwner.ts index 0a115437c3..68a9305b98 100644 --- a/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_changeCarOwner.ts +++ b/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_changeCarOwner.ts @@ -11,9 +11,10 @@ // //////// +import { io } from "socket.io-client"; + { // Validator test program.(socket.io client) - const io = require("socket.io-client"); const config = require("config"); // Specify the server (Validator) of the communication destination diff --git a/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_queryAllCars.ts b/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_queryAllCars.ts index 9f61c03a2a..9c1331f36e 100644 --- a/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_queryAllCars.ts +++ b/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_queryAllCars.ts @@ -11,9 +11,10 @@ // //////// +import { io } from "socket.io-client"; + { // Validator test program.(socket.io client) - const io = require("socket.io-client"); const config = require("config"); // Specify the server (Validator) of the communication destination diff --git a/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_queryCar.ts b/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_queryCar.ts index 66b5aa2c2c..9b025cca66 100644 --- a/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_queryCar.ts +++ b/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_queryCar.ts @@ -11,9 +11,10 @@ // //////// +import { io } from "socket.io-client"; + { // Validator test program.(socket.io client) - const io = require("socket.io-client"); const config = require("config"); // Specify the server (Validator) of the communication destination diff --git a/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_signTransactionOffline.ts b/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_signTransactionOffline.ts index ad002f10da..9e9416b1a2 100644 --- a/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_signTransactionOffline.ts +++ b/packages/cactus-plugin-ledger-connector-fabric-socketio/src/test/typescript/unit-test/validatorDriver_signTransactionOffline.ts @@ -16,9 +16,10 @@ * In this case, it is used only when transferring assets. */ +import { io } from "socket.io-client"; + { // Validator test program.(socket.io client) - const io = require("socket.io-client"); const config = require("config"); // Specify the server (Validator) of the communication destination diff --git a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/package.json b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/package.json index b25ff2b691..743da539d5 100644 --- a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/package.json +++ b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/package.json @@ -25,7 +25,7 @@ "morgan": "~1.8.1", "serve-favicon": "~2.4.2", "shelljs": "^0.8.4", - "socket.io": "^2.0.4", + "socket.io": "4.1.3", "web3": "^0.20.0" } } diff --git a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/main/typescript/common/core/bin/www.ts b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/main/typescript/common/core/bin/www.ts index 6953878129..030c098caa 100644 --- a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/main/typescript/common/core/bin/www.ts +++ b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/main/typescript/common/core/bin/www.ts @@ -20,6 +20,7 @@ const debug = require("debug")("connector:server"); import https = require("https"); import { config } from "../config/default"; import fs = require("fs"); +import { Server } from "socket.io" // Log settings import { getLogger } from "log4js"; @@ -52,7 +53,7 @@ const sslParam = { */ const server = https.createServer(sslParam, app); // Start as an https server. -const io = require("socket.io")(server); +const io = new Server(server); /** * Listen on provided port, on all network interfaces. diff --git a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/package.json b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/package.json index 2bb031ce4d..c6cb1b63bd 100644 --- a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/package.json +++ b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/package.json @@ -15,7 +15,7 @@ "ethereumjs-tx": "^2.1.2", "ts-node": "^9.0.0", "web3": "^1.2.9", - "socket.io": "^2.0.4" + "socket.io-client": "4.1.3" }, "devDependencies": { "typescript": "^3.9.3" diff --git a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_getNonceHex.ts b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_getNonceHex.ts index 52c2505649..e41f3a7326 100644 --- a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_getNonceHex.ts +++ b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_getNonceHex.ts @@ -14,9 +14,10 @@ // //////// +import { io } from "socket.io-client"; + { // Validator test program.(socket.io client) - const io = require("socket.io-client"); const config = require("config"); // Specify the server (Validator) of the communication destination diff --git a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_getNumericBalance.ts b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_getNumericBalance.ts index b310ff0abd..e24bb5e77c 100644 --- a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_getNumericBalance.ts +++ b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_getNumericBalance.ts @@ -14,9 +14,10 @@ // //////// +import { io } from "socket.io-client"; + { // Validator test program.(socket.io client) - const io = require("socket.io-client"); const config = require("config"); // Specify the server (Validator) of the communication destination diff --git a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_sendRawTransaction.ts b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_sendRawTransaction.ts index 5e9ce317a4..162ece0030 100644 --- a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_sendRawTransaction.ts +++ b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_sendRawTransaction.ts @@ -13,9 +13,10 @@ // //////// +import { io } from "socket.io-client"; + { // Validator test program.(socket.io client) - const io = require("socket.io-client"); const config = require("config"); // Specify the server (Validator) of the communication destination diff --git a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_transferNumericAsset.ts b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_transferNumericAsset.ts index 99cd67652d..9baa08377c 100644 --- a/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_transferNumericAsset.ts +++ b/packages/cactus-plugin-ledger-connector-go-ethereum-socketio/src/test/typescript/unit-test/validatorDriver_transferNumericAsset.ts @@ -14,9 +14,10 @@ // //////// +import { io } from "socket.io-client"; + { // Validator test program.(socket.io client) - const io = require("socket.io-client"); const config = require("config"); // Specify the server (Validator) of the communication destination diff --git a/packages/cactus-plugin-ledger-connector-sawtooth-socketio/package.json b/packages/cactus-plugin-ledger-connector-sawtooth-socketio/package.json index 832ca17915..a861153069 100644 --- a/packages/cactus-plugin-ledger-connector-sawtooth-socketio/package.json +++ b/packages/cactus-plugin-ledger-connector-sawtooth-socketio/package.json @@ -26,7 +26,7 @@ "morgan": "~1.8.1", "serve-favicon": "~2.4.2", "shelljs": "^0.8.4", - "socket.io": "^2.0.4", + "socket.io": "4.1.3", "xmlhttprequest": "^1.8.0" } } diff --git a/packages/cactus-plugin-ledger-connector-sawtooth-socketio/src/main/typescript/common/core/bin/www.ts b/packages/cactus-plugin-ledger-connector-sawtooth-socketio/src/main/typescript/common/core/bin/www.ts index 442d2190e0..e2e36ccd15 100755 --- a/packages/cactus-plugin-ledger-connector-sawtooth-socketio/src/main/typescript/common/core/bin/www.ts +++ b/packages/cactus-plugin-ledger-connector-sawtooth-socketio/src/main/typescript/common/core/bin/www.ts @@ -20,6 +20,7 @@ const debug = require("debug")("connector:server"); import https = require("https"); import { config } from "../config/default"; import fs = require("fs"); +import { Server } from "socket.io" // Log settings import { getLogger } from "log4js"; @@ -52,7 +53,7 @@ const sslParam = { */ const server = https.createServer(sslParam, app); // Start as an https server. -const io = require("socket.io")(server); +const io = new Server(server); /** * Listen on provided port, on all network interfaces. diff --git a/tools/docker/indy-testnet/README.md b/tools/docker/indy-testnet/README.md index 1f97a9b2d7..972b31c88c 100644 --- a/tools/docker/indy-testnet/README.md +++ b/tools/docker/indy-testnet/README.md @@ -16,10 +16,10 @@ One bridge network and three containers will be started by `docker-compse up` co - Containers - nginx container - proxies requests from verifiers to the validator in the python container - - NOTE: At the moment, this container does nothing. + - NOTE: At the moment, this container does nothing. - TODO: Configure to proxy requests. Enable uWSGI (towards the python container). - IP address: 172.16.0.3 on indy_net - - port 10080 is open to the world + - port 10080 is open to the world - clientbase - this is a temporary container based on template image for indy client (used by validator/Dockerfile) - immediately exits when you docker-compose up @@ -48,7 +48,7 @@ HTTP_PROXY=http://: NO_PROXY= ``` -Set `HTTP_PROXY` and `NO_PROXY` if your network requires HTTP proxy access to reach the internet. +Set `HTTP_PROXY` and `NO_PROXY` if your network requires HTTP proxy access to reach the internet. ### How to build docker images @@ -63,7 +63,7 @@ docker-compose build Use this command to start containers. ``` -docker-compse up +docker-compose up ``` Press CTRL-C to stop the containers. diff --git a/tools/docker/indy-testnet/docker-compose.yaml b/tools/docker/indy-testnet/docker-compose.yaml index c78a1f0916..15d838219c 100644 --- a/tools/docker/indy-testnet/docker-compose.yaml +++ b/tools/docker/indy-testnet/docker-compose.yaml @@ -1,13 +1,13 @@ -version: '3' +version: '3.2' -services: +services: indy_pool: container_name: indy_pool image: indy_pool build: context: ./indy_pool dockerfile: indy-pool.dockerfile - ports: + ports: - "9701:9701" - "9702:9702" - "9703:9703" @@ -32,7 +32,7 @@ services: - type: bind source: "./nginx/nginx.conf" target: "/etc/nginx/nginx.conf" - ports: + ports: - "10080:80" networks: indy_net: @@ -63,7 +63,6 @@ services: networks: indy_net: - name: indy_net driver: bridge ipam: driver: default diff --git a/tools/docker/indy-testnet/validator/requirements.txt b/tools/docker/indy-testnet/validator/requirements.txt index f4998f9b98..b5f2a995e9 100644 --- a/tools/docker/indy-testnet/validator/requirements.txt +++ b/tools/docker/indy-testnet/validator/requirements.txt @@ -1,4 +1,5 @@ base58==2.1.0 +bidict==0.21.4 certifi==2021.5.30 cffi==1.14.6 charset-normalizer==2.0.3 @@ -7,7 +8,7 @@ cryptography==3.4.7 dnspython==1.16.0 eventlet==0.31.1 Flask==2.0.1 -Flask-SocketIO==4.3.2 +Flask-SocketIO==5.1.1 gevent==21.1.2 greenlet==1.1.0 idna==3.2 @@ -16,8 +17,8 @@ Jinja2==3.0.1 MarkupSafe==2.0.1 pycparser==2.20 PyJWT==2.1.0 -python-engineio==3.14.2 -python-socketio==4.6.1 +python-engineio==4.3.0 +python-socketio==5.5.0 python3-indy==1.16.0 PyYAML==5.4.1 requests==2.26.0