I am looking some solution for hyperledger explorer as I am trying to integrate with my fabric network which has 1 Orderer and 2 Org nodes.
I have successfully setup hyperledger explorer with one node but I need for two nodes which can show the blocks and transaction on both nodes?
Thanks in advance
You have to add node address in config.json file and enable gossip external endpoint on both nodes
CORE_PEER_GOSSIP_EXTERNALENDPOINT
I had the same problem and the issue was, that I didn't set up the anchor peers. I recommend going through the official documentation, but in case you need some general pointers, you should do it in the following way: in config.tx set up anchor peers for each organisation, use configtxgen after creating channels to update them with anchor peers, when you join all the standard peers to a channel, update it once again with the appropriate anchor peer using the peer channel update command.
Related
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/
I have setup a hyperledger fabric network with 1 orderer node, but i want to know how to add new orderer node to a running production hyperledger network using Solo conesuss algorithm
As the name Solo implies, it's a single entity so you can't add another ordering node. You would never use Solo for production either. You should use raft which can have multiple ordering nodes (but you need to understand the implications of multiple ordering nodes using raft so definitely refer to the hyperledger fabric documentation).
I've a hyperledger fabric based network setup up and running which is having solo orderer. Now, I need to migrate the orderer from solo to Kafka. Can I do this without affecting the existing network? Seamlessly I want to upgrade. The channel and data should not be lost. Please let me know if it is feasible.
In the documentation says that if orderer type is set then it cannot be changed.
No, you need to first bring down the network, update the config file then restart the network. There is no way to do this dynamically.
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 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.