After starting Hyperledger composer rest server, I could get all the REST API’s pertaining to my Business network definition. However, I would also like to query world state and other Fabric related features.
In this case, Should I use combination of both Fabric Rest Composer API + Fabric SDK APIs ?
The Composer REST Server is simply showing you the world state, just abstracting away the details of access so as a developer you only have to worry about CRUD operations.
If you're just doing CRUD, Composer should have you fully covered as their default implementation is CouchDB.
Not sure what other features you would want to use to require Fabric SDK. Composer has great documentation on using most Fabric features without going against the grain of Composer.
In addition to ChrisMcQueen answer ...
You can also write Queries in Composer to access the data via the REST server.
Composer has the concepts of Registries for Assets, Participants and Transactions - if you don't use Composer you will have to define, generate and manage these things yourself. You can't access these registries through the Fabric SDK.
Related
I had developed an application using composer. But it is now deprecated. So i'm trying at least to use the chaincode generated using composer.
Is it possible to interact with the chaincode generated using composer through 'peer chaincode' command?
Composer doesn't generate chaincode. A business network is tightly bound to the composer framework. A business network is an implementation written to the composer specification and contains the composer runtime to understand and interpret that implementation at runtime. Therefore a Composer Business network is not standalone chaincode.
The client side of composer for client application provides the necessary operational tools as well as the business application apis in order to correctly interact with a business network. Although technically you could work out how to invoke a business network from client code without using composer it would not be trivial.
I am pretty new to Hyperledger fabric and try to understand what all topics I need to learn so that I am able to create one full application.
Like for Ethereum , I followed below steps.
1. Setup Ethereum development environment.
2. Used the solidity language to develop the smart contract and used remix as beginner to create smart contract.
3. Use of Truffle Framework for development, testing etc.
4. deploy the smart contract to blockchain either from remix or using truffle framework.
5. Use Web3 to access that smart contract function deployed on blockchain from front end.
Please help me with me similar steps for Hyperledger Fabric.
I heard about lot of terms like composer, modeling language, ACL, Scripts files under that. I also heard about Go language and SDK there.
My understanding is that, first of all Hyperledger Fabric need to be setup on the local system that I am able to do and next step is do the development of DAPP.
One option to that development is by using Hyperledger composer but I dont see use of Go language there. So I wanted to know if composer if the only option to do the development or we have any other way.
Hyperledger Composer is a tool, that simplifies application development on top of the Hyperledger Fabric blockchain infrastructure.
If you are interested in the blockchain infrastructure, start with the Fabric tutorials.
If you are interested in blockchain applications, start with the Composer tutorials.
The Fabric tutorials includes the development in to way:
You can use either Go language to write chain code or you can use composer language.
You can try both.
There is also Fabric Java SDK available for building Java client applications that interact with the blockchain.
I advise you at first to deploy a first hyperledger network in localhost (use docker-compose). You can help yourself with the fabric-sample https://github.com/hyperledger/fabric-samples.
You must understand the mechanisms of transactions (proposal, endorsement etc.) the roles of each component.
After that learning to deploy a chaincode, learn the development of GO chaincodes linked to hyperledger fabric.
Then you can approach the hyperledger SDK (NodeJS or Java).
Start with Hyperledger Composer, its a hyperledger fabric building tool: (https://hyperledger.github.io/composer/latest/introduction/introduction.html)
Composer allows you to experiment and play around with Hyperledger Fabric Blockchain through an online web interface. No need to jump into core building blocks when using Composer. The language used is mostly javascript / yml based so its easy to pick up.
Next step is to work directly with Hyperledger Fabric. But by the time you would have gone through Composer that will be your decision.
About the languages used, Hyperledger Fabric blockchain can be setup using GO, Node or Java.
as a start you can try hyperledger composer which is tool made to accelerate the implementation of your blockchain application smart contracts, ACL to your participant so to understand whats going on pleas follow the documentation in the following link
and you will find this online composer playground very helpful to get your hands on implementation and test your application flow then you can export your application file as .bna file and deploy it on your hyperledger fabric framework.
after that you have to install the prerequisites for hyperledger localy which you can find in the following link
after that you have to decide the type of fabric your going to use will it be single organization fabric which will use solo messaging server to handle synchronization between order peer and your peer.However, you can use multi organization fabric to be your framework which rely upon kafka and zookeeper to manage state between your multi orders and deploy your application.However, you can find node fabric SDK to manage your hyperledger fabric.
Am working on Hyperledger composer.I have developed the Chaincode in Go language. Is it possible to deploy the Chaincode written in Go language on a Hyperledger Composer Environment? Am using the latest composer version:0.19.12. please guide..
I dont think that is possible. Hyperledger Composer interacts with the Javascript runtime and does not communicate in any way with the GO runtime.
Hyperledger Composer business networks are capable of invoking chaincode from TP functions in the business network. So you can get a business network to interact with your GO Chaincode. You would use the getNativeAPI method inside a business network to get access to the stub and then can then perform an invokeChaincode request on that stub.
Hyperledger Composer doesn't provide a Fabric network, it requires a fabric network to be deployed to (a business network is, at the end of the day, chaincode).
I am using hyperledger composer for transaction invocation and all the stuffs related to resource(participants, assets etc) manipulation. I have generated the server using composer-rest-server, and also generated the angular frontend using yeoman generator.
This makes me to ask what is the use of fabric sdk? Will I need it in the above mentioned scenario?
Please clarify, thanks.
There are two ways to write chaincode in Hyperledger Fabric,
1) Using GoLang
2) Using NodeJS
In order to connect Hyperledger Fabric and Invoke chaincode transaction. You will require SDK. Based on your application technology stack, You can either use Fabric NodeJS SDK, Fabric Java SDK and Fabric Python SDK.
On other hand; Hyperledger composer is different way of writing chaincode, which is guide of framework which can help you to accelerate your chaincode development. If you have developed business network using composer, then you can either use "composer rest server" or "composer-admin" and "composer-client" node module. You dont need to use any SDK in order to interact with Business network deployed on hyperledger fabric. Kindly refer following diagram for more clarity.
If we can build a business network in composer playground online(or) locally and then deploy network in fabric, make a REST call from an angular app (user facing) to connect to blockchain.
Do I still need to learn about the fabric implementation or its infrastructure, When composer has provided me with necessary toolings to work with blockchain.
What am I missing in this ?
ps:I am still in the early phase of learning hyperledger and so not very clear as to use which and when.
Composer just provide necessary tools to work with blockchain.
But if you want to build your own blockchain network, You need to learn about fabric.
In composer guide, it mainly showed two fabric networks: One organization Hyperledger Fabric and Two organizations Hyperledger Fabric.
Let's say if you want to add one more organization or add one more peer node for each organization. You can't implement the requirements just utilize composer.
I'm also quite new to this. So if I understand well your answer lissdy, if I follow the developer tutorial (https://hyperledger.github.io/composer/tutorials/developer-tutorial.html) my network will be deployed but with only one peer ? And I need to use fabric to go further ?