Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TFS
controller
Commits
1573e9cc
Commit
1573e9cc
authored
7 months ago
by
Javier Diaz
Browse files
Options
Downloads
Patches
Plain Diff
Code Cleanup
parent
c45dd3fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!294
Release TeraFlowSDN 4.0
,
!259
Resolve "(CTTC) Replace DLT Gateway functionality with an opensource and Hyper Ledger v2.4+ compliant version"
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
manifests/dltservice.yaml
+3
-31
3 additions, 31 deletions
manifests/dltservice.yaml
src/dlt/gateway/dltApp/src/fabricConnect.ts
+2
-11
2 additions, 11 deletions
src/dlt/gateway/dltApp/src/fabricConnect.ts
with
5 additions
and
42 deletions
manifests/dltservice.yaml
+
3
−
31
View file @
1573e9cc
...
...
@@ -22,7 +22,6 @@ data:
MSP_ID
:
"
Org1MSP"
#Change according to your blockchain configuration
PEER_ENDPOINT
:
"
10.1.1.96:7051"
#Change to required peer address according to your blockchain deployment#
PEER_HOST_ALIAS
:
"
peer0.org1.adrenaline.com"
#Change according to your blockchain configuration
CRYPTO_PATH
:
"
/test-network/organizations/peerOrganizations/org1.adrenaline.com"
KEY_DIRECTORY_PATH
:
"
/etc/hyperledger/fabric-keystore/keystore"
CERT_DIRECTORY_PATH
:
"
/etc/hyperledger/fabric-signcerts/signcerts.pem"
TLS_CERT_PATH
:
"
/etc/hyperledger/fabric-ca-crt/ca.crt"
...
...
@@ -92,37 +91,10 @@ spec:
-
name
:
ca-crt
mountPath
:
/etc/hyperledger/fabric-ca-crt
readOnly
:
true
envFrom
:
-
configMapRef
:
name
:
dlt-config
env
:
-
name
:
CHANNEL_NAME
valueFrom
:
configMapKeyRef
:
name
:
dlt-config
key
:
CHANNEL_NAME
-
name
:
CHAINCODE_NAME
valueFrom
:
configMapKeyRef
:
name
:
dlt-config
key
:
CHAINCODE_NAME
-
name
:
MSP_ID
valueFrom
:
configMapKeyRef
:
name
:
dlt-config
key
:
MSP_ID
-
name
:
PEER_ENDPOINT
valueFrom
:
configMapKeyRef
:
name
:
dlt-config
key
:
PEER_ENDPOINT
-
name
:
PEER_HOST_ALIAS
valueFrom
:
configMapKeyRef
:
name
:
dlt-config
key
:
PEER_HOST_ALIAS
-
name
:
CRYPTO_PATH
valueFrom
:
configMapKeyRef
:
name
:
dlt-config
key
:
CRYPTO_PATH
-
name
:
KEY_DIRECTORY_PATH
value
:
"
/etc/hyperledger/fabric-keystore/keystore"
-
name
:
CERT_DIRECTORY_PATH
...
...
This diff is collapsed.
Click to expand it.
src/dlt/gateway/dltApp/src/fabricConnect.ts
+
2
−
11
View file @
1573e9cc
...
...
@@ -25,8 +25,6 @@ const channelName = getEnvVar('CHANNEL_NAME');
const
chaincodeName
=
getEnvVar
(
'
CHAINCODE_NAME
'
);
const
mspId
=
getEnvVar
(
'
MSP_ID
'
);
// Path to crypto materials.
const
cryptoPath
=
getEnvVar
(
'
CRYPTO_PATH
'
);
// Path to user private key directory.
const
keyDirectoryPath
=
getEnvVar
(
'
KEY_DIRECTORY_PATH
'
);
...
...
@@ -114,21 +112,15 @@ async function newGrpcConnection(): Promise<grpc.Client> {
async
function
newIdentity
():
Promise
<
Identity
>
{
//const certPath = await getFirstDirFileName(certDirectoryPath);
console
.
log
(
"
DEBUG
"
,
certDirectoryPath
);
//
console.log("DEBUG", certDirectoryPath);
const
credentials
=
await
fs
.
readFile
(
certDirectoryPath
);
return
{
mspId
,
credentials
};
}
//async function getFirstDirFileName(dirPath: string): Promise<string> {
// const files = await fs.readdir(dirPath);
// const filePath = path.join(dirPath, files[0]);
// const realFilePath = await fs.readlink(filePath);
// return path.join(dirPath, realFilePath);
//}
async
function
newSigner
():
Promise
<
Signer
>
{
//const keyPath = await getFirstDirFileName(keyDirectoryPath);
console
.
log
(
"
DEBUG2
"
,
keyDirectoryPath
);
//
console.log("DEBUG2", keyDirectoryPath);
const
privateKeyPem
=
await
fs
.
readFile
(
keyDirectoryPath
);
const
privateKey
=
crypto
.
createPrivateKey
(
privateKeyPem
);
return
signers
.
newPrivateKeySigner
(
privateKey
);
...
...
@@ -171,7 +163,6 @@ async function displayInputParameters(): Promise<void> {
console
.
log
(
`channelName:
${
channelName
}
`
);
console
.
log
(
`chaincodeName:
${
chaincodeName
}
`
);
console
.
log
(
`mspId:
${
mspId
}
`
);
console
.
log
(
`cryptoPath:
${
cryptoPath
}
`
);
console
.
log
(
`keyDirectoryPath:
${
keyDirectoryPath
}
`
);
console
.
log
(
`certDirectoryPath:
${
certDirectoryPath
}
`
);
console
.
log
(
`tlsCertPath:
${
tlsCertPath
}
`
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment