Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 4c37896

Browse files
author
Peter Somogyvari
committed
squash! - content checkpoint 1 - deploy contract postman json
1 parent b8d7845 commit 4c37896

7 files changed

Lines changed: 104 additions & 14 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Cacti Workshop 2023
2+
3+
```sh
4+
docker compose -f ./examples/docker-compose-harmonia.yml up
5+
```
6+
7+
```sh
8+
curl --location 'http://127.0.0.1:8080/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-corda/list-flows' \
9+
--header 'Content-Type: application/json' \
10+
--data '{}'
11+
```
12+

examples/cacti-example-harmonia-backend/corda-contract-deployment-http-request-body.json

Lines changed: 54 additions & 0 deletions
Large diffs are not rendered by default.

examples/cacti-example-harmonia-frontend/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@
5757
"@hyperledger/cactus-api-client": "2.0.0-alpha.2",
5858
"@hyperledger/cactus-common": "2.0.0-alpha.2",
5959
"@hyperledger/cactus-core-api": "2.0.0-alpha.2",
60-
"@hyperledger/cactus-example-supply-chain-business-logic-plugin": "2.0.0-alpha.2",
61-
"@hyperledger/cactus-plugin-consortium-manual": "2.0.0-alpha.2",
6260
"@hyperledger/cactus-plugin-ledger-connector-besu": "2.0.0-alpha.2",
6361
"@hyperledger/cactus-plugin-ledger-connector-corda": "2.0.0-alpha.2",
6462
"@ionic-native/core": "5.36.0",
Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
11
services:
2-
backend:
3-
build: ./cacti-example-harmonia-backend/
4-
ports:
5-
- "4000:4000"
6-
frontend:
7-
build: ./cacti-example-harmonia-frontend/
2+
# backend:
3+
# build: ./cacti-example-harmonia-backend/
4+
# ports:
5+
# - "4000:4000"
6+
# frontend:
7+
# build: ./cacti-example-harmonia-frontend/
8+
9+
connector-corda-jvm:
10+
image: ghcr.io/hyperledger/cactus-connector-corda-server:2023-08-25-ea5522b
11+
network_mode: host
12+
depends_on:
13+
- ledger-corda
14+
environment:
15+
- SPRING_APPLICATION_JSON={"logging":{"level":{"root":"INFO","net.corda":"INFO","org.hyperledger.cactus":"DEBUG"}},"cactus":{"corda":{"node":{"host":"127.0.0.1"},"rpc":{"port":10003,"username":"user1","password":"password"}}}}
16+
# ports:
17+
# - 8080:8080
18+
19+
ledger-corda:
20+
image: ghcr.io/hyperledger/cactus-corda-4-8-all-in-one-obligation:2023-11-03-86d6b38
21+
network_mode: host
22+
privileged: true
23+
# ports:
24+
# - 20022:22 # SSH
25+
# - 10003:10003 # RPC - Notary
26+
# - 10008:10008 # RPC - Party A
27+
# - 10011:10011 # RPC - Party B
28+
# - 10014:10014 # RPC - Party C

packages/cactus-plugin-ledger-connector-corda/src/main-server/kotlin/gen/kotlin-spring/src/main/kotlin/org/hyperledger/cactus/plugin/ledger/connector/corda/server/impl/ApiPluginLedgerConnectorCordaServiceImpl.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ class ApiPluginLedgerConnectorCordaServiceImpl(
292292
try {
293293
ssh.disconnect()
294294
logger.debug("Disconnected OK from SSH host ${cred.hostname}:${cred.port}")
295+
Thread.sleep(5000)
295296
} catch (ex: Exception) {
296297
logger.warn("Disconnect failed from SSH host ${cred.hostname}:${cred.port}. Ignoring since we are done anyway...")
297298
}

packages/cactus-plugin-ledger-connector-corda/src/test/typescript/integration/deploy-cordapp-jars-to-nodes-v4.8-express.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ const logLevel: LogLevelDesc = "TRACE";
3737

3838
// Skipping this until we figure out how to make the test case stable
3939
// https://github.com/hyperledger/cactus/issues/1598
40-
test.skip("Tests are passing on the JVM side", async (t: Test) => {
40+
test("Tests are passing on the JVM side", async (t: Test) => {
4141
test.onFailure(async () => {
4242
await Containers.logDiagnostics({ logLevel });
4343
});
4444

4545
const ledger = new CordaTestLedger({
4646
imageName: "ghcr.io/hyperledger/cactus-corda-4-8-all-in-one-obligation",
47-
imageVersion: "2021-08-31--feat-889",
47+
imageVersion: "2023-11-03-86d6b38",
4848
logLevel,
4949
});
5050
t.ok(ledger, "CordaTestLedger v4.8 instantaited OK");
@@ -111,7 +111,7 @@ test.skip("Tests are passing on the JVM side", async (t: Test) => {
111111
const connector = new CordaConnectorContainer({
112112
logLevel,
113113
imageName: "ghcr.io/hyperledger/cactus-connector-corda-server",
114-
imageVersion: "2021-11-23--feat-1493",
114+
imageVersion: "2023-08-25-ea5522b",
115115
envVars: [envVarSpringAppJson],
116116
});
117117
t.ok(CordaConnectorContainer, "CordaConnectorContainer instantiated OK");
@@ -143,7 +143,7 @@ test.skip("Tests are passing on the JVM side", async (t: Test) => {
143143
expressApp.use(bodyParser.json({ limit: "250mb" }));
144144
const server = http.createServer(expressApp);
145145
const listenOptions: IListenOptions = {
146-
hostname: "localhost",
146+
hostname: "127.0.0.1",
147147
port: 0,
148148
server,
149149
};
@@ -230,6 +230,10 @@ test.skip("Tests are passing on the JVM side", async (t: Test) => {
230230
"Deployed jar file count equals count in request OK",
231231
);
232232

233+
const str = JSON.stringify(depReq, null, 2);
234+
const fs = await import("fs-extra");
235+
await fs.writeFile("./corda-contract-deployment-http-request-body.json", str);
236+
233237
const flowsRes2 = await apiClient.listFlowsV1();
234238
t.ok(flowsRes2.status === 200, "flowsRes2.status === 200 OK");
235239
t.comment(`apiClient.listFlowsV1() => ${JSON.stringify(flowsRes2.data)}`);

packages/cactus-test-tooling/src/main/typescript/corda-connector/corda-connector-container.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ export class CordaConnectorContainer {
205205

206206
public async getSupervisorDLocalhostUrl(): Promise<string> {
207207
const port = await this.getSupervisorDPublicPort();
208-
return `http://localhost:${port}`;
208+
return `http://127.0.0.1:${port}`;
209209
}
210210

211211
public async getApiLocalhostUrl(): Promise<string> {
212212
const port = await this.getApiPublicPort();
213-
return `http://localhost:${port}`;
213+
return `http://127.0.0.1:${port}`;
214214
}
215215

216216
public getContainer(): Container {

0 commit comments

Comments
 (0)