-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm test error #42
Comments
@mmourani , the test suite as well as the project itself are supposed to be run inside of a container, which is a part of the fabric deployment suite ( see https://github.com/olegabu/fabric-starter). docker exec -it api.org1.example.com sh -c "cd /fabric-starter-rest && npm run test" |
@dundro ah ok thank you very much for the quick reply and for the details above. I actually copied fabric-starter and fabric-starter-rest and I was modifying the code to suit my needs. what I am doing now is testing the code to see how I can effectively use this as a development environment and testing having the following configuration: and then I go to fabric-starter-rest and start testing the network and how every command react on the fabric. 1 - so then I run npm run test then I need to check as well the swagger API but I was not able to see how you have published it and where it is located. I will then use something like postman to send request to the REST API and verify what end points are available. what do you think ? so you have any other ideas for a dev environment building chaincode on javascript ? |
@mmourani , fabric-starter-rest is already baked in the fabric-starter environment, you can see it running as "api.org1.example.com" container. So you don't need to download the fabric-starter-rest source code or to run it explicitly for chaincode development purposes. All of the services including Swagger are already available, just check it out at http://localhost:4000/api-docs (be sure that api.org1.example.com exposes the right port like this : 0.0.0.0:4000->3000/tcp ) |
@dundro thank for the clarification. I was able to see the API at http://localhost:4000/api-docs#/. I could see swagger for the following: config, chaincode, users, channels, orgs. Is it possible to see as well the participants, assets, queries, etc ? |
@mmourani, you can access the ledger data (assets) through chaincode query or chaincode invocation . |
hello @dundro and thank you for taking the time to explain the system structure. to be more explicit here, I was mainly working on hyperledger composer building the DB structure with the classes and relationships, then adding assets and transactions, queries and ACL. I was then using yeoman hyperledger generator for the webapp and composer-rest-server for the API. The ideal situation would be for me to stay on the same course so I do rapid development but it seems that composer will no longer be supported and I need an alternative. So basically I am trying to understand how to do the same thing I was doing but using your templates and configuration. it is still not clear to me how to write the chaincode ( I can install and instantiate with no issues) but how do I create the DB structure and then make it available on the REST API for someone to use the end points from the Web and Mobile phone apps ? for example I will create participants (users, banks, suppliers, etc), assets (coins, cars, etc) and transactions (CRUD on participants for example) and access them through the APIs and make them visible like the ones you have now.I hope it is clear what I am trying to do. Or should I change all the scripts and try to make composer working so I can develop the chaincode and test like I use to do ? and how do I make composer working here if needed ? |
It is not necessary to explicitly configure DB structure, you can just write and deploy chaincode, that puts and gets State. For example, using javascript You already can use chaincode functionality with Fabric SDK for Go, Node, Java or use the so called API Node , included in the project - it exposes lots of usefull REST services including a way to invoke a chaincode adn state querying |
hi, I get the bellow error when running npm test - unable to create the channel common
[2019-03-14T17:36:05.099] [TRACE] FabricStarterClientTest - logged in with password
✓ registers with random username and password then logs in without password (611ms)
Create-Join channel
#createChannelCommon
[2019-03-14T17:36:05.259] [INFO] FabricStarterClient - common
/bin/sh: /usr/bin/wget: No such file or directory
exec: /bin/sh: /usr/bin/wget: No such file or directory
/bin/sh: /usr/bin/wget: No such file or directory
exec: /bin/sh: /usr/bin/wget: No such file or directory
/bin/sh: /usr/bin/wget: No such file or directory
exec: /bin/sh: /usr/bin/wget: No such file or directory
The text was updated successfully, but these errors were encountered: