IBM-Blockchain-Archive / SDK-Demo

Sample Node.js program to demonstrate the HFC SDK APIs interacting with Starter and High Security Bluemix networks
29 stars 64 forks source link

What do you do if you delete you keyValStore-<network-id> #14

Closed adi-ads closed 8 years ago

adi-ads commented 8 years ago

I am getting the following error -

ERROR: failed to enroll admin : Error: Identity or token does not match.

I tried to delete the KeyValStore reset my network and try again. Is there another way to go about this? This only happens when trying to connect to an existing bluemix service, I can create a new service and connect just fine.

dhyey20 commented 8 years ago

When you try to connect to an existing network, you must have the same KeyValStore that you have been using for that network. In other words, when you get a new network on Bluemix, make sure you delete the old KeyValStore and start over fresh.

The token that you get from enrolling the user like admin in this case are stored in the KVS and once you have the enrolled the user, you wont get the token back from the network(SDK call). Thus, making it important that you have the KVS intact.

The only way around this is to backup the KVS, and not have it in some temporary directory. And always delete the old KVS which was being used with the old network.

adi-ads commented 8 years ago

Got it, thanks