Hyperledger Fabric: What's the relationship between MSP and Fabric CA - hyperledger-fabric

For BYFN, If the network is started with ./byfn.sh -m up. How is MSP work without CA containers?

Please consider to take a look on my previous answer for "What is the difference between MSP and Fabric CA?" first.
Now to expand a bit on this:
For BYFN, If the network is started with ./byfn.sh -m up. How is MSP work without CA containers?
In build your first network example, used cryptogen tool which primarily used in testing and demo scenarios to quickly setup crypto materials required to initialize the MSP, basically it generates certificates needed to operate network entities. Therefore there is no actually need to use Fabric-CA, however there is a different example which I advise you to explore which make use of Fabric-CA as well instead of relying on cryptogen.

Related

how to start hyper ledger fabric without fabric-samples?

I am going to build my own hyperledger fabric network , but I cannot see how to start my project without the fabric-sample, because all the tutorials I found did not tell me how. How can I get those folders and stuffs for my own project? .
You could go through the scripts of Fabric-samples to see what it does as a reference but in general the algorithm is the following:
define the participants in your network in crypto-config.yaml and generate their crypto materials with either cryptogen (but not for production network!) or manually.
define the network parameters like different policies, ordered type, consortium etc in configtx.yaml and generate a genesis block from it using configtxgen tool
having that you may run required nodes like peers belonging to different organizations, orderers and certificate authorities servers and actually start the network, the channels, install chaincodes as it all referenced in Fabric docs: https://hyperledger-fabric.readthedocs.io/en/release-2.2/

Hyperledger Fabric: Where to find a production quality sample?

we are wondering where can we find a production quality sample for HL Fabric? we have studied the samples included with official release and have found that:
the balance-transfer sample shows how to write a HL Fabric app and make transactions and queries on the chaincode but uses the cryptogen tool which is not recommended for use in production
The fabric-ca app on the other hand shows how to spin up a network without using cryptogen but does not show how to write an app that can then be used to do transactions, make queries, enroll new users and so on
So we are looking for a sample that combines the best of above two apps. Does such a sample exist? Writing an app to get the benefits of both turned out to be harder than we thought e.g., fabric-ca sample does not output any network-config which is needed by balance-transfer and we are facing difficulty figuring out what the network-config should look like in this case. Also we see conflicting code between node and typescript in balance-transfer (although both are javascript) etc.
In the latest master of Hyperledger Fabric, there is a new and much more detailed sample--the commercial paper.
The tutorial covers the whole lifecycle of a chaincode.

How to execute the given "js files" on the Fabric network?

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 :)

Creating orderer node in Hyperledger Fabric

I am new to Hyperledger Fabric and am starting a new project which is to transfer asset from one person to another. Here are the steps which I think I need to follow to achieve the completion of the project, do tell me if I am wrong or I missed something:
Create an orderer node.
Create a channel.
Create peers and endorser nodes.
Connect each peer and endorser node to channel.
Write chaincode and endorsing policies.
Create transaction to update ledger state.
If I am right, can someone help me with creation of orderer node, or provide me a link which helps. Also wanted to ask that orderer node creation is possible using node SDK.
In Hyperledger Fabric there are 3 types of nodes. Each node is a process running on some machine (perhaps in a container) and communicates with other nodes in the network.
The nodes are:
- Orderer node
- Peer node
- Client node that embeds a client SDK in some language/framework (node.js, golang, java).
You can't create a node on its own. Each node, is correlated with some organization and has its own certificates and private key.
You can take a look at https://github.com/hyperledger/fabric-samples/ (read the https://hyperledger-fabric.readthedocs.io/en/latest/getting_started.html to understand how) and this would allow you to grasp better the core concepts.
After that when you'll be more certain and more knowledgeable, you could also try to deploy your own setup of Fabric on multiple machines.
You can take a look at https://github.com/yacovm/fabricDeployment to how to do so.
There are two aspects to deploying Hyperledger Fabric... the operational aspects (deploying the containers that run the orderer, peer, ca, etc runtime components) and the transactional aspects (creating channels and issuing transaction proposals etc).
Suggest that you look into the tutorials provided. Specifically, I would start with "building your first network". This example gets into the details of how to deploy the network, create a channel and issue transactions.

what crypto-config.yaml and configtx.yaml generate msp and orderer.blcok about Fabric sample chaincode-docker-devmode

I know cryptogen could generate msp ,and configtxgen tools could generate genesis.block and myc.tx, I want to know what crypto-config.yaml and configtx.yaml could generate them, and where to explain notion about them detail??
cryptogen is just a convenience tool to make it easier to get up and running with a sample network quickly without having to go through the process of setting up certificate authorities and gathering the cryptographic material required for X509-based MSPs. Not sure exactly what answer you are looking for, but it basically generates MSPs per the specification outlined here. The format for crypto-config.yaml itself is described in the yaml file itself. You can generate a template file without generating the actual crypto material using cryptogen showtemplate. The generated yaml should provide the details / options which are available. It is also possible to generate MSPs using the fabric-ca and fabric-ca-client as well.
For configtxgen and configtx.yaml, have you looked at http://hyperledger-fabric.readthedocs.io/en/latest/configtx.html and http://hyperledger-fabric.readthedocs.io/en/latest/configtxgen.html ?

Resources