Skip to content

Commit b4fe5b9

Browse files
Merge branch 'main' of https://github.com/zondervancalvez/cactus into zondervancalvez/issue1876
2 parents d7fa656 + ebea0f2 commit b4fe5b9

File tree

4 files changed

+20
-37
lines changed

4 files changed

+20
-37
lines changed

examples/cactus-example-cbdc-bridging-backend/src/main/typescript/infrastructure/cbdc-bridging-app-dummy-infrastructure.ts

+10-34
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ import {
99
} from "@hyperledger/cactus-common";
1010
import {
1111
BesuTestLedger,
12-
DEFAULT_FABRIC_2_AIO_FABRIC_VERSION,
1312
DEFAULT_FABRIC_2_AIO_IMAGE_NAME,
14-
DEFAULT_FABRIC_2_AIO_IMAGE_VERSION,
13+
FABRIC_25_LTS_AIO_FABRIC_VERSION,
14+
FABRIC_25_LTS_AIO_IMAGE_VERSION,
15+
FABRIC_25_LTS_FABRIC_SAMPLES_ENV_INFO_ORG_1,
16+
FABRIC_25_LTS_FABRIC_SAMPLES_ENV_INFO_ORG_2,
1517
FabricTestLedgerV1,
1618
} from "@hyperledger/cactus-test-tooling";
1719
import { PluginKeychainMemory } from "@hyperledger/cactus-plugin-keychain-memory";
@@ -86,46 +88,20 @@ export class CbdcBridgingAppDummyInfrastructure {
8688
this.fabric = new FabricTestLedgerV1({
8789
publishAllPorts: true,
8890
imageName: DEFAULT_FABRIC_2_AIO_IMAGE_NAME,
89-
imageVersion: DEFAULT_FABRIC_2_AIO_IMAGE_VERSION,
91+
imageVersion: FABRIC_25_LTS_AIO_IMAGE_VERSION,
9092
envVars: new Map([
91-
["FABRIC_VERSION", DEFAULT_FABRIC_2_AIO_FABRIC_VERSION],
93+
["FABRIC_VERSION", FABRIC_25_LTS_AIO_FABRIC_VERSION],
9294
]),
9395
logLevel: level || "DEBUG",
9496
});
9597
}
9698

9799
public get org1Env(): NodeJS.ProcessEnv & DeploymentTargetOrgFabric2x {
98-
return {
99-
CORE_LOGGING_LEVEL: "debug",
100-
FABRIC_LOGGING_SPEC: "debug",
101-
CORE_PEER_LOCALMSPID: "Org1MSP",
102-
103-
ORDERER_CA: `${this.orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem`,
104-
105-
FABRIC_CFG_PATH: "/etc/hyperledger/fabric",
106-
CORE_PEER_TLS_ENABLED: "true",
107-
CORE_PEER_TLS_ROOTCERT_FILE: `${this.orgCfgDir}peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt`,
108-
CORE_PEER_MSPCONFIGPATH: `${this.orgCfgDir}peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp`,
109-
CORE_PEER_ADDRESS: "peer0.org1.example.com:7051",
110-
ORDERER_TLS_ROOTCERT_FILE: `${this.orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem`,
111-
};
100+
return FABRIC_25_LTS_FABRIC_SAMPLES_ENV_INFO_ORG_1;
112101
}
113102

114103
public get org2Env(): NodeJS.ProcessEnv & DeploymentTargetOrgFabric2x {
115-
return {
116-
CORE_LOGGING_LEVEL: "debug",
117-
FABRIC_LOGGING_SPEC: "debug",
118-
CORE_PEER_LOCALMSPID: "Org2MSP",
119-
120-
FABRIC_CFG_PATH: "/etc/hyperledger/fabric",
121-
CORE_PEER_TLS_ENABLED: "true",
122-
ORDERER_CA: `${this.orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem`,
123-
124-
CORE_PEER_ADDRESS: "peer0.org2.example.com:9051",
125-
CORE_PEER_MSPCONFIGPATH: `${this.orgCfgDir}peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp`,
126-
CORE_PEER_TLS_ROOTCERT_FILE: `${this.orgCfgDir}peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt`,
127-
ORDERER_TLS_ROOTCERT_FILE: `${this.orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem`,
128-
};
104+
return FABRIC_25_LTS_FABRIC_SAMPLES_ENV_INFO_ORG_2;
129105
}
130106

131107
public async start(): Promise<void> {
@@ -411,7 +387,7 @@ export class CbdcBridgingAppDummyInfrastructure {
411387
sourceFiles,
412388
ccName: contractName,
413389
targetOrganizations: [this.org1Env, this.org2Env],
414-
caFile: `${this.orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem`,
390+
caFile: FABRIC_25_LTS_FABRIC_SAMPLES_ENV_INFO_ORG_1.ORDERER_TLS_ROOTCERT_FILE,
415391
ccLabel: "asset-reference-contract",
416392
ccLang: ChainCodeProgrammingLanguage.Typescript,
417393
ccSequence: 1,
@@ -538,7 +514,7 @@ export class CbdcBridgingAppDummyInfrastructure {
538514
sourceFiles,
539515
ccName: contractName,
540516
targetOrganizations: [this.org1Env, this.org2Env],
541-
caFile: `${this.orgCfgDir}ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem`,
517+
caFile: FABRIC_25_LTS_FABRIC_SAMPLES_ENV_INFO_ORG_1.ORDERER_TLS_ROOTCERT_FILE,
542518
ccLabel: "cbdc",
543519
ccLang: ChainCodeProgrammingLanguage.Javascript,
544520
ccSequence: 1,

examples/test-run-transaction/supply-chain-app-stub/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dependencies": {
77
"body-parser": "1.20.2",
88
"cors": "2.8.5",
9-
"express": "4.18.2",
9+
"express": "4.19.2",
1010
"moment": "2.29.4",
1111
"ts-node": "10.9.1",
1212
"typescript": "5.3.3",

packages/cactus-plugin-ledger-connector-besu/src/main/typescript/plugin-ledger-connector-besu.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Server } from "http";
22
import { Server as SecureServer } from "https";
3+
import { setTimeout } from "timers/promises";
34

45
import type { Server as SocketIoServer } from "socket.io";
56
import type { Socket as SocketIoSocket } from "socket.io";
@@ -788,8 +789,14 @@ export class PluginLedgerConnectorBesu
788789
const startedAt = new Date();
789790

790791
do {
792+
const now = Date.now();
793+
const elapsedTime = now - startedAt.getTime();
794+
timedOut = now >= startedAt.getTime() + timeoutMs;
795+
this.log.debug("%s tries=%n elapsedMs=%n", fnTag, tries, elapsedTime);
796+
if (tries > 0) {
797+
await setTimeout(1000);
798+
}
791799
tries++;
792-
timedOut = Date.now() >= startedAt.getTime() + timeoutMs;
793800
if (timedOut) {
794801
break;
795802
}

tools/ci.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function mainTask()
115115
fi
116116

117117
docker --version
118-
docker-compose --version
118+
docker compose version
119119
node --version
120120
npm --version
121121
java -version

0 commit comments

Comments
 (0)