Skip to content

Commit df31db1

Browse files
committed
feat(weaver): weaver fabric driver connector implementation
Signed-off-by: Carlos Amaro <[email protected]>
1 parent 5fb3635 commit df31db1

File tree

23 files changed

+514
-221
lines changed

23 files changed

+514
-221
lines changed

packages/cactus-plugin-ccmodel-hephaestus/src/main/typescript/plugin-ccmodel-hephaestus.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ export class CcModelHephaestus implements ICactusPlugin, IPluginWebService {
260260
private createReceiptFromRunTxReqWithTxId(
261261
data: IRunTxReqWithTxId,
262262
): FabricV2TxReceipt {
263+
if (!data.request.signingCredential) {
264+
throw new Error(
265+
`Cannot create FabricV2TxReceipt if signingCredential is missing in IRunTxReqWithTxId`,
266+
);
267+
}
263268
return {
264269
caseID: this.caseID,
265270
blockchainID: LedgerType.Fabric2,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CONNECTION_PROFILE=path_to_connection_profile
2+
RELAY_ENDPOINT=localhost:9080
3+
RELAY_TLS=false
4+
RELAY_TLSCA_CERT_PATH=path_to_tls_ca_cert_pem_for_relay
5+
DRIVER_ENDPOINT=localhost:9090
6+
DRIVER_TLS=false
7+
DRIVER_TLS_CERT_PATH=path_to_tls_cert_pem_for_driver
8+
DRIVER_TLS_KEY_PATH=path_to_tls_key_pem_for_driver
9+
NETWORK_NAME=network1
10+
DRIVER_CONFIG=
11+
INTEROP_CHAINCODE=interop
12+
MOCK=false
13+
DB_PATH=driverdbs
14+
WALLET_PATH=
15+
DEBUG=true
16+
LEVELDB_LOCKED_MAX_RETRIES=
17+
LEVELDB_LOCKED_RETRY_BACKOFF_MSEC=
18+
ENABLE_MONITOR=false
19+
MONITOR_SYNC_PERIOD=
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.env
2+
wallet-network1/*.id
3+
!wallet-network1/relay.id
4+
wallet-network2/*.id
5+
!wallet-network2/relay.id
6+
driverdbs
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"admin":{
3+
"name":"admin",
4+
"secret":"adminpw"
5+
},
6+
"relay": {
7+
"name":"relay",
8+
"affiliation":"org1.department1",
9+
"role": "client",
10+
"attrs": [{ "name": "relay", "value": "true", "ecert": true }]
11+
},
12+
"mspId":"Org1MSP",
13+
"caUrl":""
14+
}

packages/cactus-plugin-ledger-connector-fabric/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"dist/*"
4444
],
4545
"scripts": {
46+
"start-fabric-weaver-driver": "node ./dist/lib/main/typescript/plugin-ledger-connector-fabric-cli.js",
4647
"codegen": "yarn run --top-level run-s 'codegen:*'",
4748
"codegen:openapi": "npm run generate-sdk",
4849
"codegen:proto": "buf generate --verbose",
@@ -71,6 +72,7 @@
7172
"bl": "6.1.0",
7273
"bn.js": "4.12.0",
7374
"dockerode": "3.3.0",
75+
"dotenv": "17.2.3",
7476
"elliptic": "6.6.1",
7577
"express": "5.1.0",
7678
"fabric-ca-client": "2.5.0-snapshot.23",
@@ -82,11 +84,12 @@
8284
"google-protobuf": "3.21.2",
8385
"http-errors": "2.0.0",
8486
"http-status-codes": "2.1.4",
87+
"http2": "^3.3.7",
8588
"joi": "17.13.3",
8689
"json5": "2.2.3",
8790
"jsrsasign": "11.0.0",
88-
"lodash": "4.17.21",
8991
"level": "8.0.0",
92+
"lodash": "4.17.21",
9093
"long": "5.2.3",
9194
"multer": "1.4.5-lts.1",
9295
"ngo": "2.7.0",

packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/api/openapi.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,6 @@ components:
782782
- contractName
783783
- methodName
784784
- params
785-
- signingCredential
786785
type: object
787786
RunTransactionResponseType:
788787
description: Response format from transaction / query execution
@@ -916,7 +915,6 @@ components:
916915
- invocationType
917916
- methodName
918917
- params
919-
- signingCredential
920918
type: object
921919
RunTransactionResponse:
922920
example:

packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_invoke_request.go

Lines changed: 22 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cactus-plugin-ledger-connector-fabric/src/main/go/generated/openapi/go-client/model_run_transaction_request.go

Lines changed: 22 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cactus-plugin-ledger-connector-fabric/src/main/json/openapi.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@
448448
"RunInvokeRequest": {
449449
"type": "object",
450450
"required": [
451-
"signingCredential",
452451
"channelName",
453452
"contractName",
454453
"methodName",
@@ -519,7 +518,6 @@
519518
"RunTransactionRequest": {
520519
"type": "object",
521520
"required": [
522-
"signingCredential",
523521
"channelName",
524522
"contractName",
525523
"invocationType",

packages/cactus-plugin-ledger-connector-fabric/src/main/kotlin/generated/openapi/kotlin-client/src/main/kotlin/org/openapitools/client/models/RunInvokeRequest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,19 @@ import com.squareup.moshi.JsonClass
2424
/**
2525
*
2626
*
27-
* @param signingCredential
2827
* @param channelName
2928
* @param contractName
3029
* @param methodName
3130
* @param params
3231
* @param transientData
3332
* @param gatewayOptions
33+
* @param signingCredential
3434
* @param policies List of endorsers
3535
*/
3636

3737

3838
data class RunInvokeRequest (
3939

40-
@Json(name = "signingCredential")
41-
val signingCredential: FabricSigningCredential,
42-
4340
@Json(name = "channelName")
4441
val channelName: kotlin.String,
4542

@@ -58,6 +55,9 @@ data class RunInvokeRequest (
5855
@Json(name = "gatewayOptions")
5956
val gatewayOptions: GatewayOptions? = null,
6057

58+
@Json(name = "signingCredential")
59+
val signingCredential: FabricSigningCredential? = null,
60+
6161
/* List of endorsers */
6262
@Json(name = "policies")
6363
val policies: kotlin.collections.List<kotlin.String>? = arrayListOf()

0 commit comments

Comments
 (0)