marija
marija

Reputation: 63

Failed to enroll admin in Hyperledger Fabric Javascript application

I followed instructions for writing my first app using Hyperledger Fabric, but when starting the app with node app.js I get this error:

   $ node app.js
Loaded the network configuration located at C:\Users\marij\Desktop\hyper\fabric-
samples\test-network\organizations\peerOrganizations\org1.example.com\connection
-org1.json
Built a CA Client named ca-org1
Built a file system wallet at C:\Users\marij\Desktop\hyper\fabric-samples\asset-
transfer-basic\application-javascript\wallet
2021-06-03T18:30:33.180Z - error: [FabricCAClientService.js]: Failed to enroll a
dmin, error:%o message=Calling enroll endpoint failed with error [Error: connect
 ECONNREFUSED 127.0.0.1:7054], stack=Error: Calling enroll endpoint failed with
error [Error: connect ECONNREFUSED 127.0.0.1:7054]
    at ClientRequest.<anonymous> (C:\Users\marij\Desktop\hyper\fabric-samples\as
set-transfer-basic\application-javascript\node_modules\fabric-ca-client\lib\Fabr
icCAClient.js:327:19)
    at ClientRequest.emit (events.js:315:20)
    at TLSSocket.socketErrorListener (_http_client.js:469:9)
    at TLSSocket.emit (events.js:315:20)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21), errno=
-4078, code=ECONNREFUSED, syscall=connect, address=127.0.0.1, port=7054
Failed to enroll admin user : Error: Calling enroll endpoint failed with error [
Error: connect ECONNREFUSED 127.0.0.1:7054]
An identity for the admin user does not exist in the wallet
Enroll the admin user before retrying
******** FAILED to run the application: Error: Identity not found in wallet: app
User

Wallet folder is empty.

Also, I didn't make any modifications in given code and I used test-network.

Upvotes: 0

Views: 567

Answers (1)

kamlesh nagware
kamlesh nagware

Reputation: 89

your wallet didn't have admin identity, you first need to enroll admin user and then try to register and enroll other user.

Upvotes: 1

Related Questions