diff --git a/hsm-samples-gateway/.gitignore b/asset-transfer-basic/application-gateway-hsm/.gitignore similarity index 100% rename from hsm-samples-gateway/.gitignore rename to asset-transfer-basic/application-gateway-hsm/.gitignore diff --git a/hsm-samples-gateway/README.md b/asset-transfer-basic/application-gateway-hsm/README.md similarity index 98% rename from hsm-samples-gateway/README.md rename to asset-transfer-basic/application-gateway-hsm/README.md index 9481fa16..b6953253 100644 --- a/hsm-samples-gateway/README.md +++ b/asset-transfer-basic/application-gateway-hsm/README.md @@ -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 diff --git a/hsm-samples-gateway/ca-client-config/.gitignore b/asset-transfer-basic/application-gateway-hsm/ca-client-config/.gitignore similarity index 100% rename from hsm-samples-gateway/ca-client-config/.gitignore rename to asset-transfer-basic/application-gateway-hsm/ca-client-config/.gitignore diff --git a/hsm-samples-gateway/ca-client-config/fabric-ca-client-config-template.yaml b/asset-transfer-basic/application-gateway-hsm/ca-client-config/fabric-ca-client-config-template.yaml similarity index 100% rename from hsm-samples-gateway/ca-client-config/fabric-ca-client-config-template.yaml rename to asset-transfer-basic/application-gateway-hsm/ca-client-config/fabric-ca-client-config-template.yaml diff --git a/hsm-samples-gateway/go/hsm-sample.go b/asset-transfer-basic/application-gateway-hsm/go/hsm-sample.go similarity index 97% rename from hsm-samples-gateway/go/hsm-sample.go rename to asset-transfer-basic/application-gateway-hsm/go/hsm-sample.go index 423f9b1a..79a98758 100644 --- a/hsm-samples-gateway/go/hsm-sample.go +++ b/asset-transfer-basic/application-gateway-hsm/go/hsm-sample.go @@ -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" ) diff --git a/hsm-samples-gateway/node/.eslintrc.yaml b/asset-transfer-basic/application-gateway-hsm/node/.eslintrc.yaml similarity index 100% rename from hsm-samples-gateway/node/.eslintrc.yaml rename to asset-transfer-basic/application-gateway-hsm/node/.eslintrc.yaml diff --git a/hsm-samples-gateway/node/.gitignore b/asset-transfer-basic/application-gateway-hsm/node/.gitignore similarity index 100% rename from hsm-samples-gateway/node/.gitignore rename to asset-transfer-basic/application-gateway-hsm/node/.gitignore diff --git a/hsm-samples-gateway/node/package.json b/asset-transfer-basic/application-gateway-hsm/node/package.json similarity index 100% rename from hsm-samples-gateway/node/package.json rename to asset-transfer-basic/application-gateway-hsm/node/package.json diff --git a/hsm-samples-gateway/node/src/hsm-sample.ts b/asset-transfer-basic/application-gateway-hsm/node/src/hsm-sample.ts similarity index 96% rename from hsm-samples-gateway/node/src/hsm-sample.ts rename to asset-transfer-basic/application-gateway-hsm/node/src/hsm-sample.ts index 4b231b34..dd592ccf 100644 --- a/hsm-samples-gateway/node/src/hsm-sample.ts +++ b/asset-transfer-basic/application-gateway-hsm/node/src/hsm-sample.ts @@ -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() { diff --git a/hsm-samples-gateway/node/tsconfig.json b/asset-transfer-basic/application-gateway-hsm/node/tsconfig.json similarity index 100% rename from hsm-samples-gateway/node/tsconfig.json rename to asset-transfer-basic/application-gateway-hsm/node/tsconfig.json diff --git a/hsm-samples-gateway/scripts/generate-hsm-user.sh b/asset-transfer-basic/application-gateway-hsm/scripts/generate-hsm-user.sh similarity index 96% rename from hsm-samples-gateway/scripts/generate-hsm-user.sh rename to asset-transfer-basic/application-gateway-hsm/scripts/generate-hsm-user.sh index 0a7969b7..6252c2a1 100755 --- a/hsm-samples-gateway/scripts/generate-hsm-user.sh +++ b/asset-transfer-basic/application-gateway-hsm/scripts/generate-hsm-user.sh @@ -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' \ diff --git a/ci/scripts/run-test-network-basic.sh b/ci/scripts/run-test-network-basic.sh index a8931055..f6b54390 100755 --- a/ci/scripts/run-test-network-basic.sh +++ b/ci/scripts/run-test-network-basic.sh @@ -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"