Skip to content

Commit

Permalink
test(cactus-test-verifier-client): replace socketio connector with et…
Browse files Browse the repository at this point in the history
…h openapi

- Replace deprecated cactus-plugin-ledger-connector-go-ethereum-socketio with
    openapi-based cactus-plugin-ledger-connector-ethereum.
- Replace binding of `0.0.0.0` with `127.0.0.1` in tests and scripts
    to solve possible issues with running tests in cloud environments.

Signed-off-by: Michal Bajer <[email protected]>
  • Loading branch information
outSH authored and petermetz committed Dec 5, 2023
1 parent 73fc74d commit f757215
Show file tree
Hide file tree
Showing 16 changed files with 132 additions and 413 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const mockAppConfig = {
},
],
logLevel: sutLogLevel,
applicationHostInfo: { hostName: "0.0.0.0", hostPort: 0 },
applicationHostInfo: { hostName: "127.0.0.1", hostPort: 0 },
socketOptions: {
rejectUnauthorized: false,
reconnection: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test("get,set,has,delete alters state as expected for AzureCredentialType.InMemo
expressApp.use(bodyParser.json({ limit: "250mb" }));
const server = http.createServer(expressApp);
const listenOptions: IListenOptions = {
hostname: "0.0.0.0",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export async function setupBenchmarkEnvironment(
path: Constants.SocketIoConnectionPathV1,
});
const addressInfo = (await Servers.listen({
hostname: "0.0.0.0",
hostname: "127.0.0.1",
port: 0,
server: httpServer,
})) as AddressInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe("Ethereum contract deploy and invoke using keychain tests", () => {
await ledger.start();

const listenOptions: IListenOptions = {
hostname: "0.0.0.0",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe("Ethereum contract deploy and invoke using keychain tests", () => {
await ledger.start();

const listenOptions: IListenOptions = {
hostname: "0.0.0.0",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe("invokeRawWeb3EthMethod Tests", () => {
});

const listenOptions: IListenOptions = {
hostname: "0.0.0.0",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe("Running ethereum transactions with different gas configurations", () =
await ledger.start();

const listenOptions: IListenOptions = {
hostname: "0.0.0.0",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe(testCase, () => {
await ledger.start();

const listenOptions: IListenOptions = {
hostname: "0.0.0.0",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ describe("Sawtooth monitoring endpoints tests", () => {

log.info("Setup ApiServer...");
const listenOptions: IListenOptions = {
hostname: "0.0.0.0",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ describe("Ethereum persistence plugin tests", () => {
defaultAccountAddress = account.address;

const addressInfo = (await Servers.listen({
hostname: "0.0.0.0",
hostname: "127.0.0.1",
port: 0,
server: connectorServer,
})) as AddressInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe(testCase, () => {
await besuTestLedger.start();

const listenOptions: IListenOptions = {
hostname: "0.0.0.0",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe(testCase, () => {
expressApp.use(bodyParser.json({ limit: "250mb" }));
server = http.createServer(expressApp);
const listenOptions: IListenOptions = {
hostname: "0.0.0.0",
hostname: "127.0.0.1",
port: 0,
server,
};
Expand Down
21 changes: 13 additions & 8 deletions packages/cactus-test-verifier-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,27 @@
"dist/*"
],
"scripts": {
"stress-test": "node --expose-gc --no-opt dist/main/typescript/verifier-with-go-eth-stress-check.js",
"stress-test-inspect": "node --expose-gc --inspect-brk --no-opt dist/main/typescript/verifier-with-go-eth-stress-check.js"
"stress-test": "node --expose-gc --no-opt dist/lib/main/typescript/verifier-with-go-eth-stress-check.js",
"stress-test-inspect": "node --expose-gc --inspect-brk --no-opt dist/lib/main/typescript/verifier-with-go-eth-stress-check.js"
},
"dependencies": {
"@hyperledger/cactus-api-client": "2.0.0-alpha.2",
"@hyperledger/cactus-cmd-api-server": "2.0.0-alpha.2",
"@hyperledger/cactus-common": "2.0.0-alpha.2",
"@hyperledger/cactus-plugin-ledger-connector-go-ethereum-socketio": "2.0.0-alpha.2",
"@hyperledger/cactus-core": "2.0.0-alpha.2",
"@hyperledger/cactus-core-api": "2.0.0-alpha.2",
"@hyperledger/cactus-plugin-ledger-connector-ethereum": "2.0.0-alpha.2",
"@hyperledger/cactus-test-geth-ledger": "2.0.0-alpha.2",
"@hyperledger/cactus-test-tooling": "2.0.0-alpha.2",
"@hyperledger/cactus-verifier-client": "2.0.0-alpha.2",
"body-parser": "1.20.2",
"express": "4.18.2",
"log4js": "6.4.1",
"web3": "1.7.3",
"web3-core": "1.7.3"
"socket.io": "4.5.4"
},
"devDependencies": {
"@types/node": "14.18.54"
"@types/body-parser": "1.19.4",
"@types/express": "4.17.19",
"@types/node": "14.18.54",
"web3-eth-accounts": "4.0.3"
},
"engines": {
"node": ">=10",
Expand Down
Loading

0 comments on commit f757215

Please sign in to comment.