As far as I have seen most Hyperledger Fabric examples deal with the idea to create channels and thus private ledgers to apply view and data restrictions between parties. (e.g. https://courses.edx.org/courses/course-v1:LinuxFoundationX+LFS171x+3T2017/courseware/f0db5224eb0e4bbb8cc1e93a6819012c/8a27d35a4ae34e2ea5d2c43e8b3cb71c/?activate_block_id=block-v1%3ALinuxFoundationX%2BLFS171x%2B3T2017%2Btype%40sequential%2Bblock%408a27d35a4ae34e2ea5d2c43e8b3cb71c)
But as far as I know these channels can't be created/bootstrapped via API, only via scripting.
Two questions - If you have a lot of different parties like insurers and customers
How should one handle this situation without a Client API and
How to deal with these many channels/ledgers then in the future?
Thanks
Oliver
You can create a channel either with the peer CLI, or with using one of the SDKs.
Now, what really happens in both of them is that they simply issue a gRPC call to the ordering service's Broadcast gRPC service, with a custom crafted message that contains the identity material (PEMs) of the organizations, parameters, etc. (everything in the configtx.yaml)
So, if you just look at the implementation of how an SDK does that - you should be able to do that yourself.
Related
For the past few days i am trying to learn blockchain, more specifically in using hyperledger fabric
However, while i am quite familiar building centralized app, i am so new in grasp this whole new concept, and got some question in mind i haven't found answer, yet.
If its decentralized, does the script will run as desktop background process in every machine connected to the network through internet?
Since
no way it could be "decentralized" if its hosted on 3rd party server
blockchain platform seems could seamlessly write/read local files, which certainly not possible at the case of hosted in 3rd party server
existing blockchain application (i.e bitcoin) written for desktop (c++)
If it does desktop process, in the case of creating website interface to run the application, do we need API to communicate? And if so, how the API could be made to communicate between all machine in the network?
Moreover in the case of storing sensitive data like password, since its stored locally in every machine, does it means we will rely only on encryption being used? I assume common AES256 will work? Or need multi layer encryption (as in XMR) to make it harder for people trying to decrypt those sensitive information?
Any input is greatly appreciated. Thank you in advance!
I'll answer your questions for Hyperledger Fabric since that's what you tagged this post for.
Presumably the "script" you mean is chaincode, the blockchain back-end part of the decentralized application. It runs on endorsers (part of Fabric peers), specifically all endorsers that are specified in the endorsement policy and have installed the chaincode. The endorsement policy specifies how many endorsers need to agree for chaincode transactions to go through, i.e. 3/5. These peers can be hosted by multiple organizations in different places, that's why it's decentralized.
You need to use the Hyperledger Fabric SDK to communicate with your chaincode (get data, send transactions).
Decentralized apps don't really use user-password combo for identity management. Users have public/private keypairs which they need to keep locally. Only if you want to encrypt the private key you'd need a password for the user to decrypt it locally. You use the private key to sign transactions and to authenticate with the network (which determines your access rights, i.e. user vs admin)
I can recommend the Fabric paper as a learning resource
Also check out the docs, they cover many of your questions
I would recommend first taking a step back and finding out what are the best use cases for Web3 vs Web2. There are a number of projects that seem to have been shoehorned into using Web3 when they could have been created more quickly and efficiently using
Web2 technologies.
Ask yourself these questions before jumping on board the decentralized Web3 bandwagon:
Is an Immutable Ledger the Best Fit for Your Back-end?
Does Your Back-end Work Best as Decentralized Computing?
Do You Need Scalability or High Transaction Volumes?
Only when you understand the problem you are trying to solve, can you determine the best technologies for the job.
To help answer the above questions, you can use the following article as a resource: https://www.scalablepath.com/back-end/choosing-web3-for-software-project
I've only really just started looking into Hyperledger Fabric and have been asked to create an e-commerce platform (e-bay style) that uses the platform.
However, I am stuck with defining the appropriate architecture for the Hyperledger network, or if it is even appropriate to for this scenario, mainly because I do not know the number of organisations that will be part of the network at the start. Also how would this work having a single client on the front-end that users (in this case they would be organisations) would use to login, register, etc and how would this reflect on the Hyperledger network?
Would each new user be a new node on the network?
I first thought I could create a base network with just a ETCDRAFT orderer, a Fabric CA node, CouchBase, Fabric CLI node and a main Channel, and then add new organisations as they came along, but I wouldn't have anywhere to store the chain code as far I understand it.
I also thought of having the same structure but with an additional Peer node that would essentially represent the e-commerce platform itself, and new organisations (users on the ecommerce platform) would be added as users on the network, but that kind of defeats the purpose of a network in my view.
I know this might be a noob question but I am struggling a bit to define my initial set-up so that I can start writing the chain code, API and client, so any clarity on how this should ideally look in terms of network structure would be much appreciated.
The problem statement is quite vague in itself.
I am trying to answer the question with my assumptions.
Let consider e-commerce website like Amazon.
How many participants in there of blockchain network?
The sellers and buyers consider them as identities of a single organization not "Node".
The peers would be the various department running in the amazon like dep1,dep2 etc.
Lets say there are 100 banks on the street, they trade each other but they also don't want to share the data with the other banks who is not the part of the transaction. so basically in that case they will have to create a dedicated channel for each possible combination, so assuming 100 banks each trading with each other 100 x 9 = 900. If i put them in same channel they will get to see the data for the transaction they are not part of, so only option i have left is to keep them on a separate channel but is there any scalability issue with having too many participants in the network. how is really going to scale in Hyperledger Fabric or How can we manage this type of use case in Hyperledger Fabric ?
Seems like you duplicate the question
I have answered in your previous question
How to prevent third party to seeing the data on same channel in Hyperledger Fabric?
There is one very important feature provided by the Hyper-ledger fabric for scenarios like these. Its called Private Data. A set of Organizations in a consortium can hide the data from other organizations using this feature, and avoid creating a new channel altogether.
Please see below link for detailed explanation. It has everything , including an use case which will help in understanding the practical usage of private data.
Private Data in Hyperledger fabric
I am little confused bw fabric and sawtooth for supply chain application development from documentation it appears that sawtooth is best for supply chain but all the validator node keeps the copy of the distributed ledger there is no concept of channels and private data.
Sawtooth has an open source solution for supply chain.
Fabric Channels may solve your use case. It doesn't scale if you need several channels. You can also have multiple blockchains with Sawtooth, which is essentially what a channel is anyway.
The blockchain concept is that all data is transaparent and viewable and auditable by everyone. That doesn't always work in some use cases and is an active research area. Encrypting payload data and storing some data off-chain are some solutions.
I have been researching online a lot, and I have hit a roadblock.
My current situation is that I have a hash inside my blockchain, and this would reference a file that will return this from off chain. My question is that would using IPFS and Storj even be possible using Hyperledger Composer? If so, how would the integration process work? My case right now would require the use of Hyperledger due to its architecture over Ethereum, so it is much preferable to use Hyperledger.
Besides this, I would also like to create a custom front end. Is it possible to work on custom CSS and code, for example, using Angular?
yes - firstly see storage options discussed in this thread -> Best practice to save files in blockchain -
In Composer you could store the hash as a string on an asset in your model etc etc and you can retrieve via IPFS client search etc once you've got your asset (eg by name or ID) etc .- lastly see this announce for current status of Composer FYI