moved samples under asset-transfer-basic

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
This commit is contained in:
sapthasurendran 2022-06-28 14:16:44 +05:30
parent f3949f316c
commit f5322c8b0b
12 changed files with 21 additions and 5 deletions

View file

@ -101,14 +101,14 @@ generate a certificate on the file system for use by the sample. The private key
For HSM support you need to ensure you include the `pkcs11` build tag.
```
cd hsm-samples-gateway/go
cd application-gateway-hsm/go
go run -tags pkcs11 hsm-sample.go
```
### Node SDK
```
cd hsm-samples-gateway/node
cd application-gateway-hsm/node
npm install
npm run build
npm start

View file

@ -33,7 +33,7 @@ import (
const (
mspID = "Org1MSP"
certPath = "../crypto-material/hsm/HSMUser/signcerts/cert.pem"
tlsCertPath = "../../test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
tlsCertPath = "../../../test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
peerEndpoint = "localhost:7051"
)

View file

@ -22,7 +22,7 @@ const utf8Decoder = new TextDecoder();
const certPath = path.resolve(__dirname, '..', '..', 'crypto-material', 'hsm', user, 'signcerts', 'cert.pem');
const tlsCertPath = path.resolve('..', '..','test-network','organizations','peerOrganizations', 'org1.example.com', 'peers', 'peer0.org1.example.com', 'tls', 'ca.crt');
const tlsCertPath = path.resolve('..', '..', '..', 'test-network','organizations','peerOrganizations', 'org1.example.com', 'peers', 'peer0.org1.example.com', 'tls', 'ca.crt');
const peerEndpoint = 'localhost:7051';
async function main() {

View file

@ -4,7 +4,7 @@ set -eo pipefail
# define the CA setup
CA_HOST=localhost
CA_URL=${CA_HOST}:7054
TLS_CERT='../../test-network/organizations/fabric-ca/org1/tls-cert.pem'
TLS_CERT='../../../test-network/organizations/fabric-ca/org1/tls-cert.pem'
# try to locate the Soft HSM library
POSSIBLE_LIB_LOC=('/usr/lib/softhsm/libsofthsm2.so' \

View file

@ -103,6 +103,22 @@ node dist/app.js
popd
stopNetwork
# Run typescript HSM gateway application
createNetwork
print "Initializing Typescript HSM gateway application"
pushd ../asset-transfer-basic/application-typescript-hsm
print "Setup SoftHSM"
export SOFTHSM2_CONF=$PWD/softhsm2.conf
softhsm2-util --init-token --slot 0 --label "ForFabric" --pin 98765432 --so-pin 1234
print "install dependencies"
npm install
print "Building app.ts"
npm run build
print "Running the output app"
node dist/app.js
popd
stopNetwork
# Run Go gateway application
createNetwork
print "Initializing Go gateway application"