So far I have followed the hyperledger developer tutorial, but I have a couple of questions basically the same I pressume. Let us assume that I have running my application as stated in the developer tutorial in machine A.
The first question is: How can I modify the ledger in machine A from B when they are in the same network?.
The second is: How can I modify the ledger in machine A from B when they are in different networks?.
The Composer Developer tutorial (and in fact all of the Compose tutorials) focus on the Composer aspects of developing and deploying a Business Network. They do not focus much on the Fabric issues of multi-org and multi machine. The Developer tutorial uses a very simple development Fabric of 1 Peer in 1 Organisation, and some automated scripts set this up for the developer to concentrate on the Model and the code.
For background on Hyperledger Fabric and experimentation with multi peer, multi org Fabrics I would suggest looking at the Fabric tutorials.
To get more of a view of Multi-Org from a Composer perspective I would suggest looking at the Composer Multi-Org Tutorial.
Be aware that the above 2 references simulate multi-org Fabrics, but actually run on a single machine for simplicity. There are other tutorials and blogs available in various places for running on multi-machine configurations e.g. https://www.skcript.com/svr/setting-up-a-blockchain-business-network-with-hyperledger-fabric-and-composer-running-in-multiple-physical-machine/
Related
I'm a novice in fabric development and I am at the beginning of the road. I could not find a suitable integrated tutorial from the base, so i follow hyperledger fabric from latest version documents. From Here I understood a number of concepts such as working with the test network, the commercial paper network, how to work with and develop smart contracts and ... . But I'm a little confused. The fabric document is not coherent and step by step and I could not figure out how to write my target network from scratch (like config my own network, write yaml file and scripts), so does anyone know the instructions for building a hyperledger fabric network from scratch step by step?
I've been studying the Hyperledger Fabric framework reading the docs for quite a while now but I'm getting a little lost in the middle of all that info. My question is: Is there any guidelines/"Step by step" on how to design a blockchain network from scratch? If you are starting a new project, where do you start?
Because I think I would understand it way more quicker if I actually started coding a little instead of reading and reading and reading...
Thanks a lot!
Edit 1:
I've chosen #kekomal answer as the correct one but I'd like to thank #Isha Padalia for the awesome VS Code extension and tutorial.
If you are really interested in learning and diving into Hyperledger Fabric, avoid byfn script. It performs a lot of magic for building a very simple Hyperledger Fabric network. After that, you have a network that you don't know how has been created and you have absolutely no idea of how to start deploying your custom network. There are daily questions here from people who started that way and are absolutely lost.
I find interesting this tutorial: https://medium.com/beyondi/setup-the-hyperledger-fabric-network-from-scratch-b82913b47549. Take into account that it is a little bit outdated.
You can complement it with this newer tutorial: https://www.blockchainexpert.uk/blog/how-to-deploy-hyperledger-fabric-network-from-scratch. Don't only run the steps. Analyze the files in https://github.com/blockchain-expert/hyperledger-fabric-network-from-scratch. Try playing with configtx.yaml, crypto-config.yaml and docker-compose files to customize your network and understand what you are doing.
Customize your organizations, your consortiums, your ordering service, your peers... Create your channels, join them, update your anchor peers... And understand what you are doing.
After that, if your network had one orderer, deploy a new one with more than one (with Raft consensus). If your network was using cryptogen, deploy a new one using Fabric-CAs instead. Or you can follow by playing with chaincodes.
NOTE: Apart from Hyperledger Fabric itself, it is essential to have basic notions of docker and PKI.
You are a beginner in Hypelredger fabric development then you have first cleared the concept of the orderer, peer, CA, and organization concept. And then first you have to start IBM Blockchain Platform VS Code extension for fabric. It will provide a local fabric environment to create, test and deploy a fabric smart contract. Also generate 1 peer, 1 orderer, 1 CA service under VS code environment.
Here is a link to start development with VS code extension.
Hope it will help you:)
hi #d3v9 start from here https://hyperledger-fabric.readthedocs.io/en/release-1.4/build_network.html. also you can find some great article on medium
Hyperledger Composer is a platform for accelerating the development process of Business Network Application. Why is it deprecated and what are the alternatives to composer for development of BNAs?
According to IBM, there are following three problems with Hyperledger Composer:
Composer has been designed from the start to support multiple blockchain platforms, not just Fabric - but this design has come at a cost. This design has meant that there are two completely different programming models - the Fabric programming model (chaincode) and the Composer programming model (business networks). This has caused significant confusion to users, with them needing to make a "choice" between the two programming models, with very few similarities between the two. In this particular case choice has been a bad thing, with many users opting not to use the "optional" part past the initial exploration or POC stage.
This design has also made it a lot harder for us to adopt and expose the latest Fabric features. For example, one of the questions we are constantly getting at the moment is "when can I use the Fabric v1.2 private data feature with Composer?". Whilst we've taken some steps (getNativeAPI) to assist with this problem, it is extremely difficult for us to keep up with and aligned with the latest features in Fabric when we are trying to maintain a design that keeps us blockchain platform independent. This has meant that users have understandably stopped using Composer and instead have reverted to developing with Fabric.
Finally, those of you that have used Composer will likely be fans of our simple, easy-to-use APIs (JavaScript and REST) for building applications that interact with a blockchain network. There is a lot of code behind the scenes to enable these APIs that doesn't really belong in Composer. What we have ended up doing is glossing over the underlying, low-level Fabric APIs instead of pushing improvements directly into these Fabric APIs. Today it takes ~50 lines of code to submit a transaction using the Fabric APIs, whilst in Composer it takes ~5 lines of code, and that's wrong - Composer's value should not come from just making Fabric easier to use.
Please read this for details.
The only problem with Composer is that IBM, et al abandoned it. Composer was (to an extent kind of still is) an effective way for users of Fabric to proof of concept (POC) business solutions for prospective customers -- and for users wanting to justify internal budgets to attempt to deploy projects internally. Using real-world business logic.
Composer should be the business logic stack that sits on top of Fabric and allows users to deploy without having to get down into the weeds.
I don't need to know that I need an orderer or CA for every org -- but I do need to know that I have 6 orgs who will participate in my network, two of them need to communicate using private data on a separate channel from the others and I do need to know what my business use cases rules are. An automated tool or script should allow me to launch an internal network **locally* and go from there. Yes, I will need to know fabric details or have someone on hand that does to be able to tweak my networks -- but Composer let me POC these.
There is no -- as in zero -- equivalent for Fabric -- in fact there is no tool to allow one to easily clone fabric samples for their own use and easily plug in their own network / org settings.
And the IBM VS Code plugin tool is garbage if you're wanting to setup an internal, standalone network without going to the IBM cloud. Really? Seriously?
Without Composer -- or a tool like it -- investing in Hyperledger Fabric is a huge financial & resource gamble and time sink. Period. The code changes almost weekly, there are significant bugs, the community is reticent to fix what at times are glaring documentation issues and address hardware sizing issues. Not to mention the cost to assign engineers and software architects to test what is not-yet-ready-for-prime-time software. Forget the amount of time that is needed to just get familiar with the documentation and fabric components to be able to architect business-grade networks.
Regarding the points made in the answer above:
There should be two distinct programming models because the BNA approach works from a business deployment point of view. To say that having a Composer stack with it's API on top of Fabric "confuses" users is like the old saying "if the customer is too stupid to know how to use the deeply technical product the customer is too stupid" -- that's fundamentally wrong.
I shouldn't have to refresh my knowledge of combustion engines every time I get into a vehicle and press the start button -- I know where I have to go, how I will get there and know how to operate the vehicle to do so. And if I want to tweak or otherwise modify the vehicle, its engine, electrical system, etc. I get out the equivalent of fabric documentation and learn to use those tools or hire a mechanic that already knows how to use them.
And the design did not make it harder to adopt and expose the latest features of Fabric -- what the development team failed to do was to implement those features in Composer in lock step with releases of Fabric. This was a dev team deployment issue and not an end user issue. And to say -- not imply, say -- that the community didn't step up to the plate was a load of crap. If IBM wanted to support it, it could have - it has the personnel, financial and global resources to do so.
Within real-world settings the business perspective of blockchain / distributed ledger viability for enterprise applications is less than enthusiastic -- in fact it's doubtful at best. The number one compliant we get from prospects globally (NA, EMEA) is no one can adequately demo this. No kidding -- showing a prospect via a terminal window that car ownership can move from one user to another is going to solve their business needs? Really? Via a terminal window no less.
For us to POC a complex use case and be able to back of the napkin demo it we now have to write entire fabric apps or hope we can cobble through fixing a fabric samples example -- and in the process work through the bugs in samples.
We've spent hundreds upon hundreds of hours building out POC use cases only to have Composer go by the way side, Fabric version x not work with the just released Fabric version xx, have prerequisite software versions change or issues with god forbid Raft or Kafka that haven't been fully tested prior to "alpha" next greatest thing Fabric release. etc., etc, etc.
And to the writers last point above -- the value of Composer should absolutely be making Fabric easier to use for basic network stand up and POCs. No one is suggesting that getting into the weeds with Fabric is a bad thing -- but from a BUSINESS point of view having something like Composer to POC before committing to projects it's essential.
Will we continue to work with Fabric and hope that the development team catches up with real-world business needs -- probably. All those IBM and other training sessions for composer we've put employees through for the most part have been a waste.
So, from a team who is trying so very hard to justify what is good about Hyperledger and Fabric -- please don't just sack something like Composer in the future. Because we're not going to invest in personnel and train them if this is just the next big thing to go by the wayside. I have 15 teams deployed with prospects globally working prospective use cases and implementations -- trying to tweak and push customer-centric use case demos to them has been Hyperledger Fabric hell.
One persons rather small opinion. GR
I think the reasons are clear from the previous comments, but for your last question one option hundreds of devs are taking is using Convector. Convector is a Hyperledger Labs project that was created before Hyperledger Composer was deprecated but that looks similar to developers. It follows a model controller pattern (similar to Composer assets and transactions) however it compiles natively to Fabric code and does not create a runtime.
Code created with Convector can be taken to production and include all sorts of helpers like an API generator, a development environment bootstrapper (one command to create a local network), decorators for making models more predictable, unit tests by default (CI/CD friendly), tens of code samples and real-life projects to use as reference.
Convector has a community of hundreds of devs, some of them migrated from Composer rather easily, others it is the first tool they get to know for Fabric. The main difference about why Convector won't go away anytime soon even if it looks and feels similar to Composer is its decoupled architecture and capability to use and run natively with Fabric.
If you'd like to join the community there people will help you migrate from Composer to Convector. You can join here.
Here's a blog post mapping concepts from Hyperledger Composer to Convector.
Small recap about Convector:
Looks familiar to Hyperledger Composer.
Same code can be taken to production.
Run natively and scales natively with Fabric.
An ecosystem of tools: unit tests, developer environment, API generator, etc.
Great and friendly community in Discord.
--
Disclaimer: I work with Covalent, the developers of Convector. Convector is a free open source Apache 2.0 group of projects.
Since more than one month, I am working on creating a multi Organization Hyperledger Fabric Application.
I started with Composer, used playground to test my business logic. Then deployed it to the Locally running Fabric Network and used the COMPOSER REST Server to interact with the Blockchain.
The problem started when I wanted to use my Node Application with this network. I can't get my head around participants, network cards, importing these cards, binding these cards, having a wallet for these cards, Activating these cards, enrolling them and doing all this from the NODE Application.
I want One tutorial which will help me connecting a NODE application to a Blockchain network with a Business card and explain everything in layman terms.
Bottom Line: I want to develop a node application, which will use the REST server-generated for the locally running Hyperledger Fabric using Composer. Any suggestion on End-to-End tutorials or step by step method to understand these concepts will be really appreciated.
what you need can be found here:
https://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html
it covers everything you need to create a fully fledged application using the node SDK. Make sure you follow all the resources including the Setting up your first network tutorial. The link is on that page.
The problem with composer is that it is not developed anymore by IBM:
https://lists.hyperledger.org/g/composer/message/125
as such I would not recommend you spend any more time on it.
Other than the fact that Composer makes deployment and testing of prototype business networks easier and the fact that we don't have to know golang to develop chaincode, what is the difference in the functionalities that these interfaces provide that may lead one to choose one over the other?
This article can probably provide you with the answers you need:
https://blog.selman.org/2017/07/08/getting-started-with-blockchain-development/
Hyperledger Composer is both an application development framework and set of powerful tools which simplifies and expedites the creation of blockchain applications and smart contracts that are ultimately executed on the Hyperledger Fabric blockchain. Composer has its own runtime, that is generic chaincode and hosts and interprets the business network deployed - so your smart contract need only use Javascript, not chaincode in Go a (which is Fabric's domain) s you mentioned. It also has a modeling facility to create your business network model and to define such controls as Access Control lists and queries to be executed.
This architecture link should help you with further understanding -> https://www.slideshare.net/SimonStone8/hyperledger-composer-architecture
Furthermore see the Hyperledger Composer docs, see here:
https://hyperledger.github.io/composer/
TO see the Hyperledger Fabric docs - see here:
https://hyperledger-fabric.readthedocs.io/en/latest/