I am writing this to ask the question if we can build a network layer on top of the hyperledger fabric network.
I am actually working on a research project where I want to add encryption layer on the hyperedger fabric network.
I just want to know, if there are any starting points where I can work for this.
The basic idea is that, the encryption will be taking place in api layer and decryption will take place at peer level. If the decryption is successful, then only we should trigger the chaincode function. Can we do that ?
Please give your valuable suggestions on this.
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.
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
I'm studying Hyperledger Fabric with the documentation(https://hyperledger-fabric.readthedocs.io/en/release-1.0/write_first_app.html)
I'm done with two samples, which is "Building Your First network" & "Writing Your First Application"
I'm also done adding 1 extra peer to each organization, by modifying certain files, as well as done trying all commands on "Writing Your Fist Application" session.
Now, I'd like to execute the same commands(e.g. Querying all cars, Adding new cars or whatever) on the first network where I have built up, not on the test Fabcar network.
The thing is that I really have no idea what to do and how to do, even though I know how to handle NodeJS program(by Writing Application webpage)
So I'd like to ask you some questions.
Should I modify some files in order to "move" all necessary things to my network? if so, which file should I modify?
By any chance, Could you please tell me the correct steps to make it? I feel like I need to install and instantiate the required smart contract on my peers. Am I right?
I really appreciate your help in advance.
To answer your question, you would need to read some documentation online that will help you understand the architecture and how you can build up the packages as hyperledger fabric provided freedom to users to create use case specific configurations.
To start with.
Make sure you have have understood the concept of peer, orderer, couchdb, ca authority. Those 4 things you need to play with most of the times.
Assuming you have installed nodejs and able to run node through terminal, Read through the following example
Tuna Fish example, it help you to understand the concept of injecting, updating, querying blockchin ledger. Also, It will help understand the usage of Nodejs backend and angularjs basic UI. or use the other examples as you have seen on the fabric-samples github repository. Fabric Samples. Balance Transfer will help you understand the channel and chaincode operations using Node JS. Build your first network will help you understand the configuration files(concentrate on docker-compose.yaml, scipt.js and byfn.js)
Then to answer your questions.
you just have to modify the mount drive config variables in docker-componse-cli.yaml. Then you can edit your startup script based on how you want to move chaincode to your peer.
you need to install chaincode on all the peers that are part of that channel. And you only need to instantiate chaincode once per channel.
Installation and instantiation combination is a powerful feature because it allows for a peer to interact with the same chaincode container across multiple channels. The only prerequisite is for the actual chaincode source files to be installed on the peer's file system. As such, if a piece of common chaincode is being used across dozens of channels, a peer would need only a single chaincode container to perform read/writes on all the channel ledgers.
To run the node js files on the fabric network.
welcome to blockchain world :)
I have been working on hyperledger fabric for some time. But I don’t understand where hyperledger composer comes in place . I do understand that it helps in visualizing the logic and transaction. But what I don’t get is how do you integrate it with fabric network? what does it create? Is it chaincode if not then what?
The Compose runtime is chain code that executes the business network archive artefacts created by the end-user.
Perhaps this will help?
https://blog.selman.org/2017/07/08/getting-started-with-blockchain-development/
The tech answer is that Hyperledger Composer is an abstraction layer over Hyperledger Fabric.
The practical answer is that it is awesome. Think how Angular and hundreds of other frameworks make web programming easier.
It is a framework where you can write your blockchain in Javascript and specify your data objects in an easy to understand text file. Throw in some querying, ACL stuff and pathways to use some nice opensource tools that let you do things like generate a Web API automatically and play around in a web environment without installing anything.
We are using it for the Integra Ledger Legal blockchain. (www.integraledger.com). I just spent the day working in it.