hyperledger-composer-dev-tutorial icon indicating copy to clipboard operation
hyperledger-composer-dev-tutorial copied to clipboard

TypeError: adminConnection.createProfile is not a function

Open simonmullaney opened this issue 7 years ago • 10 comments

Hey Zach - thanks for the videos - they are brilliant!

I'm just getting this error when I'm trying to test the directory. I think the createProfile function was removed from the composer-admin module. Do you have any workaround for this?

Thanks again!

simonmullaney avatar Nov 29 '17 13:11 simonmullaney

Glad you like them! May I ask at what command you are getting this error? I know they have released a new version since this tutorial so if you could copy/paste the error log that might help.

zachgoll avatar Nov 29 '17 14:11 zachgoll

Yeah I'm just after checking my adminconnection.js file and it doesn't have a createProfile function anymore.

I'm just using npm test in my project folder. I get the following error in my terminal:

"before all" hook: TypeError: adminConnection.createProfile is not a function at Context.

I checked composer-logs to see if there were any logs in there but there wasn't.

simonmullaney avatar Nov 29 '17 14:11 simonmullaney

Which version of Composer are you running? In the latest version it doesn't look like this method is available.

zachgoll avatar Nov 29 '17 14:11 zachgoll

Yes, the createProfile function isn't there...

I'm using the latest version - v0.15.2

simonmullaney avatar Nov 29 '17 14:11 simonmullaney

The core devs have been making all sorts of changes with this new Identity Card syntax, and by the looks of the new sample network (https://github.com/hyperledger/composer-sample-networks/blob/master/packages/perishable-network/test/perishable.js), they are relying on MemoryCardStore class from Common API for testing.

I will try and get back to this repo and update, but for now, I think you might download the new sample network and work from there.

Sorry I couldn't be of more help. This industry is moving at 100mph!!

zachgoll avatar Nov 29 '17 15:11 zachgoll

I will say that most of the Composer documentation is pretty good, and if you follow my 5 part video series (even if you have to revert back to v0.15.0 to do so), you should have a framework of understanding that applies to the new versions. Working through new syntax is definitely the challenge at this point.

zachgoll avatar Nov 29 '17 15:11 zachgoll

No worries Zach - I know the way!

I'll have a further look into it, and maybe take up the issue with the Hyperledger dev's to see if they know how to solve it...

Thanks again!

simonmullaney avatar Nov 29 '17 15:11 simonmullaney

Yeah for sure - ill post the fix here when I figure it :)

simonmullaney avatar Nov 29 '17 15:11 simonmullaney

Hey Zach - the fix was in that file you attached -> https://github.com/hyperledger/composer-sample-networks/blob/master/packages/perishable-network/test/perishable.js

You just have to connect as they do in it :)

simonmullaney avatar Nov 30 '17 09:11 simonmullaney

Awesome, glad you got it figured out! Feel free to submit a PR or the lines of code you changed for future users of this repo :)

zachgoll avatar Nov 30 '17 14:11 zachgoll