Skip to content
Snippets Groups Projects
Commit 51765439 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Pre-merge code cleanup

parent 57d837b9
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!259Resolve "(CTTC) Replace DLT Gateway functionality with an opensource and Hyper Ledger v2.4+ compliant version"
......@@ -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
......@@ -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.
......@@ -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",
......
ca.crt
cert.pem
priv_sk
\ No newline at end of file
priv_sk
src/dlt/gateway/resources/System.png

285 KiB

......@@ -27,4 +27,4 @@
]
}
]
}
\ No newline at end of file
}
......@@ -14,4 +14,4 @@
"connections": ["node1"]
}
]
}
\ No newline at end of file
}
......@@ -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()
);
......
......@@ -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()
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment