Гиперледжер Фабри c с SOFTHSM - PullRequest
0 голосов
/ 17 марта 2020

Здравствуйте, я пытаюсь использовать softhsm с fabri c с помощью https://hyperledger-fabric-ca.readthedocs.io/en/release-1.4/users-guide.html#configuring -an-hsm Я скачал образ и сделал двоичные файлы с GO_TAGS=pkcs11 make docker, а также двоичные файлы и docker изображение было сгенерировано сейчас, когда я пытаюсь запустить программу, я получаю эту ошибку

2020/03/17 10:29:49 [INFO] Configuration file location: /etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
2020/03/17 10:29:49 [INFO] Starting server in home directory: /etc/hyperledger/fabric-ca-server
2020/03/17 10:29:49 [DEBUG] Set log level: 
2020/03/17 10:29:49 [INFO] Server Version: 1.4.7-snapshot-505df12
2020/03/17 10:29:49 [INFO] Server Levels: &{Identity:2 Affiliation:1 Certificate:1 Credential:1 RAInfo:1 Nonce:1}
2020/03/17 10:29:49 [DEBUG] Making server filenames absolute
2020/03/17 10:29:49 [DEBUG] Initializing default CA in directory /etc/hyperledger/fabric-ca-server
2020/03/17 10:29:49 [DEBUG] Init CA with home /etc/hyperledger/fabric-ca-server and config {Version:1.4.4 Cfg:{Identities:{PasswordAttempts:10 AllowRemove:false} Affiliations:{AllowRemove:false}} CA:{Name: Keyfile: Certfile:ca-cert.pem Chainfile:ca-chain.pem} Signing:0xc000184520 CSR:{CN:fabric-ca-server Names:[{C:US ST:North Carolina L: O:Hyperledger OU:Fabric SerialNumber:}] Hosts:[f1aa0a0d80c6 localhost] KeyRequest:0xc00031cc60 CA:0xc00031cce0 SerialNumber:} Registry:{MaxEnrollments:-1 Identities:[{ Name:**** Pass:**** Type:client Affiliation: MaxEnrollments:0 Attrs:map[hf.AffiliationMgr:1 hf.GenCRL:1 hf.IntermediateCA:1 hf.Registrar.Attributes:* hf.Registrar.DelegateRoles:* hf.Registrar.Roles:* hf.Revoker:1]  }]} Affiliations:map[ordererorg:<nil> peerorg1:<nil>] LDAP:{ Enabled:false URL:ldap://****:****@<host>:<port>/<base> UserFilter:(uid=%s) GroupFilter:(memberUid=%s) Attribute:{[uid member] [{ }] map[groups:[{ }]]} TLS:{false [] { }}  } DB:{ Type:sqlite3 Datasource:fabric-ca-server.db TLS:{false [] { }}  } CSP:0xc000180270 Client:<nil> Intermediate:{ParentServer:{ URL: CAName:  } TLS:{Enabled:false CertFiles:[] Client:{KeyFile: CertFile:}} Enrollment:{ Name: Secret:**** CAName: AttrReqs:[] Profile: Label: CSR:<nil> Type:x509  }} CRL:{Expiry:24h0m0s} Idemix:{IssuerPublicKeyfile: IssuerSecretKeyfile: RevocationPublicKeyfile: RevocationPrivateKeyfile: RHPoolSize:1000 NonceExpiration:15s NonceSweepInterval:15m}}
2020/03/17 10:29:49 [DEBUG] CA Home Directory: /etc/hyperledger/fabric-ca-server
2020/03/17 10:29:49 [DEBUG] Checking configuration file version '1.4.4' against server version: '1.4.7-snapshot-505df12'
2020/03/17 10:29:49 [DEBUG] Initializing BCCSP: &{ProviderName:PKCS11 SwOpts:<nil> PluginOpts:<nil> Pkcs11Opts:0xc000128e00}
2020/03/17 10:29:49 [DEBUG] Initializing BCCSP with PKCS11 options &{SecLevel:256 HashFamily:SHA2 Ephemeral:false FileKeystore:0xc0001843c0 DummyKeystore:<nil> Library:/home/cdac/hyperledger-fabric-hsm/softhsm/lib/libsofthsm2.so Label:ForFabric Pin:98765432 SoftVerify:false Immutable:false}
2020/03/17 10:29:49 [DEBUG] Closing server DBs
Error: Failed to get BCCSP with opts: Could not initialize BCCSP PKCS11: Failed initializing PKCS11 library /home/cdac/hyperledger-fabric-hsm/softhsm/lib/libsofthsm2.so ForFabric: Instantiate failed [/home/cdac/hyperledger-fabric-hsm/softhsm/lib/libsofthsm2.so]

Мой конфиг такой же, как указано на сайте

#############################################################################
bccsp:
#    sw:
#      hash: SHA2
#      security: 256
#      filekeystore:
#        keystore: msp/keystore
   default: PKCS11
   pkcs11:
     Library: /home/cdac/hyperledger-fabric-hsm/softhsm/lib/libsofthsm2.so
     Pin: 98765432
     Label: ForFabric
     hash: SHA2
     security: 256
     filekeystore:
     # The directory used for the software file-based keystore
       keystore: msp/keystore

Любая идея, где проблема может быть

...