diff --git a/src/dlt/gateway/Dockerfile b/src/dlt/gateway/Dockerfile index 78e735c09480ca27559d0e57b934b993547d4a78..ace9cb22ee691efd7565120034a6a1ef36a27aaf 100644 --- a/src/dlt/gateway/Dockerfile +++ b/src/dlt/gateway/Dockerfile @@ -38,11 +38,8 @@ COPY src/dlt/gateway/dltApp/src/ ./src # Install dependencies RUN npm install - - # Expose the port that the gRPC service runs on EXPOSE 50051 # Command to run the service CMD ["node", "src/dltGateway.js"] -#CMD ["sh", "-c", "sleep 3600"] # Keep the container running for testing diff --git a/src/dlt/gateway/README.md b/src/dlt/gateway/README.md index ae05ed6c65a33f3fb6c8393036cd89d4615608e9..4a38545eae7492e8ec5abac4fdf209da51b00aff 100644 --- a/src/dlt/gateway/README.md +++ b/src/dlt/gateway/README.md @@ -2,9 +2,15 @@ ## Description -The DLT Gateway consists of a **fabricConnect.ts** TypeScript file, which contains the logic for identification management (certificates required for the MSP), connection management to the blockchain, and finally, it exposes a contract object with all the required information for interacting with the chaincode. The **fabricConnect.ts** is coded following the Fabric Gateway API recommendations from Hyperledger Fabric 2.4+. The compiled **fabricConnect.ts** logic is imported into a **dltGateway.js** file, which contains the gRPC logic for interaction with the TFS controller. Testing code for various performance tests is included inside the [/tests](./tests/) folder. +The DLT Gateway consists of a **fabricConnect.ts** TypeScript file, which contains the logic for identification +management (certificates required for the MSP), connection management to the blockchain, and finally, it exposes a +contract object with all the required information for interacting with the chaincode. The **fabricConnect.ts** is +coded following the Fabric Gateway API recommendations from Hyperledger Fabric 2.4+. The compiled **fabricConnect.ts** +logic is imported into a **dltGateway.js** file, which contains the gRPC logic for interaction with the TFS controller. +Testing code for various performance tests is included inside the [/tests](./tests/) folder. -The chaincode is written in Go, providing a reference for the operations that are recorded in the blockchain. This chaincode must already be deployed in a working Hyperledger Fabric blockchain. +The chaincode is written in Go, providing a reference for the operations that are recorded in the blockchain. This +chaincode must already be deployed in a working Hyperledger Fabric blockchain. ## Requisites @@ -12,16 +18,18 @@ The chaincode is written in Go, providing a reference for the operations that ar * Docker * Kubernetes (K8s) -Sign and TLS certificates, and private key of the MSP user from the Hyperledger Fabric deployment must be copied to the [/keys](./keys/) directory inside this repository. - - Example: - - ```bash - cp ~/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/tls/ca.crt src/dlt/gateway/keys/ - - cp ~/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/signcerts/User1@org1.example.com-cert.pem src/dlt/gateway/keys/cert.pem - - cp ~/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/keystore/priv_sk src/dlt/gateway/keys/ - ``` - -These files are essential for establishing the identity and secure connection to the blockchain. Make sure you replace the paths with your actual file locations from your Hyperledger Fabric deployment. +Sign and TLS certificates, and private key of the MSP user from the Hyperledger Fabric deployment must be copied to the +[/keys](./keys/) directory inside this repository. + +Example: + +```bash +cp ~/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/tls/ca.crt src/dlt/gateway/keys/ + +cp ~/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/signcerts/User1@org1.example.com-cert.pem src/dlt/gateway/keys/cert.pem + +cp ~/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/keystore/priv_sk src/dlt/gateway/keys/ +``` + +These files are essential for establishing the identity and secure connection to the blockchain. Make sure you replace +the paths with your actual file locations from your Hyperledger Fabric deployment. diff --git a/src/dlt/gateway/dltApp/package.json b/src/dlt/gateway/dltApp/package.json index 5eabc2dff8cc819fa1db189a0b3dec0c37f7d245..9d29b5287e1d3085c1cede9ab73b23189f3228d3 100644 --- a/src/dlt/gateway/dltApp/package.json +++ b/src/dlt/gateway/dltApp/package.json @@ -16,7 +16,7 @@ "start": "node dist/dlt_gateway.js" }, "engineStrict": true, - "author": "CTTC-Javier", + "author": "Javier Jose Diaz (CTTC)", "license": "Apache-2.0", "dependencies": { "@grpc/grpc-js": "^1.10.8", diff --git a/src/dlt/gateway/keys/.gitignore b/src/dlt/gateway/keys/.gitignore index 28d89119f5c02c8c24e26c4325c657c2e0eb09f4..b54a37fc5e1fa51616f1de2ef20651cb28504040 100644 --- a/src/dlt/gateway/keys/.gitignore +++ b/src/dlt/gateway/keys/.gitignore @@ -1,3 +1,3 @@ ca.crt cert.pem -priv_sk \ No newline at end of file +priv_sk diff --git a/src/dlt/gateway/resources/System.png b/src/dlt/gateway/resources/System.png deleted file mode 100644 index f8c6b79f08e44842e7a486ede2477b987cbeb9d7..0000000000000000000000000000000000000000 Binary files a/src/dlt/gateway/resources/System.png and /dev/null differ diff --git a/src/dlt/gateway/samples/sampleTopo.json b/src/dlt/gateway/samples/sampleTopo.json index 435d0bfbe44a9f42fb0ff7a84dc9c746be7a0ef3..67115d4be322ed8567688c51a68a95c2b0800138 100644 --- a/src/dlt/gateway/samples/sampleTopo.json +++ b/src/dlt/gateway/samples/sampleTopo.json @@ -27,4 +27,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/src/dlt/gateway/samples/updatedTopo.json b/src/dlt/gateway/samples/updatedTopo.json index 17f927c891829ce8eb12f43cc8fe015b7645deca..74b084b9d9c48de89ddf6122f46316a74c1a4fca 100644 --- a/src/dlt/gateway/samples/updatedTopo.json +++ b/src/dlt/gateway/samples/updatedTopo.json @@ -14,4 +14,4 @@ "connections": ["node1"] } ] -} \ No newline at end of file +} diff --git a/src/dlt/gateway/tests/testEvents.js b/src/dlt/gateway/tests/testEvents.js index 8d209723eaf7999de3b5829308099f0c0ffd78f4..6e18e803202232a9613264dd49e6beee14546d14 100644 --- a/src/dlt/gateway/tests/testEvents.js +++ b/src/dlt/gateway/tests/testEvents.js @@ -28,7 +28,7 @@ const packageDefinition = protoLoader.loadSync(PROTO_PATH, { const dltProto = grpc.loadPackageDefinition(packageDefinition).dlt; const client = new dltProto.DltGatewayService( - '10.1.1.96:32001', //Replace with TFS server IP_ADDRESS + '127.0.0.1:32001', // Replace with TFS server IP_ADDRESS grpc.credentials.createInsecure() ); diff --git a/src/dlt/gateway/tests/testGateway.js b/src/dlt/gateway/tests/testGateway.js index dde6b3efc8427c5a1d3f9e35a8938a8d1aac21ee..b08f648daf6f257f44ec94cd13dabccce67cd803 100644 --- a/src/dlt/gateway/tests/testGateway.js +++ b/src/dlt/gateway/tests/testGateway.js @@ -31,7 +31,7 @@ const packageDefinition = protoLoader.loadSync(PROTO_PATH, { const dltProto = grpc.loadPackageDefinition(packageDefinition).dlt; const client = new dltProto.DltGatewayService( - '10.1.1.96:32001', + '127.0.0.1:32001', // Replace with TFS server IP_ADDRESS grpc.credentials.createInsecure() );