Search code examples
hyperledger-fabrichyperledgerhyperledger-composer

Hyperledger: The current identity, with the name 'admin' and the identifier <ID> has not been registered


I was in charge of solving a problem in Hyperledger which consists of identity expiration, unfortunately i do not have much details about the network itself, i've tried to delete the card using:

composer card delete admin@network

And using import:

composer card import -f admin.card

Both card and bna are the in the same directory, but when doing so if i try to ping the network it shows the following error:

Hyperledger: The current identity, with the name 'admin' and the identifier <ID> has not been registered

I just need to recover this admin user without loosing or changing anything in the network.


Solution

  • Have you check the listed cards on the network?

    composer card list
    

    for identity expiration and can't get access to your network, you can try this.

    Set your machine datetime before the card expired. go to your network directory ex. cd ~/example-network. then request new identity:

    composer identity request -c PeerAdmin@hlfv1 -u admin -s adminpw newadmin
    

    create new admin card:

    composer card create -p config/connection.json -u newadmin -n example-network -c newadmin/admin-pub.pem -k newadmin/admin-priv.pem
    

    import created card:

    composer card import -f [email protected]
    

    extract created card (it's actually compressed file), i recommend to extract into new directory called newadmin.

    bind new identity:

    composer identity bind -c oldadmin@example-network --participantId resource:org.hyperledger.composer.system.NetworkAdmin#admin --certificateFile newadmin/credentials/certificate
    

    set back your machine datetime. now you have access to your network again.

    composer network ping -c newadmin@example-network
    

    cheers.