Intechanging node roles in Hyperledger Fabric - hyperledger-fabric

Can nodes interchange roles in hyperledger fabric?
Is it possible to make an endorsing or committing peer take the role of an orderer when required?

Every endorsing peer is also a committing peer.
An orderer and a peer are totally different binaries, and have completely different APIs, so - you can't have one fill the role of the other.

Related

Is there a way to link two nodes in Hyperledger fabric?

I want to have two peers within an organization in which one peer act as a client that only send transactions without storing the ledger, and the other act as normal peer. I read about having lightweight node and full node. But how to make them both related to the same organization in Hyperledger?
All peer nodes are committers in Hyperledger Fabric. Thus, every peer node stores the ledger. If a node does not store the ledger, it may be a client or some kind of proxy, but not a peer node. Please, refer to the document where you have read about lightweight and full nodes, as it may be not referring to peers.
Anyway, every node is related to its organization through its MSP.

how many chaincodes are required for 3 organizations hyperledger network

I want to build a hyperledger fabric network for 3 organizations, and I want to develop chaincode for the network. So how many chaincodes I have develop to 3 organization network. Is it like between org1 and org2 one chaincode, and org2 and org3 one chaincode. please help me through this.
If they share the channel and business logic, only one. From then, as much as you need or want.

How to add peers dynamically to an existing hyperledger fabric network using node sdk?

In all of the tutorials , I see that we can add an organization or peer manually to an existing fabric network. But how do i dynamically assign an incoming node as a peer or an orderer depending on some criteria?
I am not sure about adding peer to fabric network using node sdk, but you can definitely add peer by using CLI.
For that you need to generate crypto material for new Peer and joining the existing channel
Please follow below link for more detail
Extending Hyperledger Fabric Network: Adding a New Peer

In hyperledger fabric How to pass two orderer's in peer channel create?

I'm exploring the Hyperledger fabric with Kafka based ordering,
When I try to create a channel using CLI, I need to pass the orderer.
I have created two orderers now using Kafka, But how to pass two orderers while creating the channel.
peer channel create -o orderer0.example.com,**orderer1.example.com**
Will it work?
I think you cant. Because when you use orderer-kafka, when you send a transacción to one orderer he will use a kafka brokers to "broadcast" the transaction to all orderers on the Network.

How is state database across peers synchronized in hyperledger fabric network?

I have two organizations with 2 peers running on each organization. I created a channel and joined all the 4 peers to it. The peers use couchdb as state database. Now if I accidentally modify/delete the data stored in one of the peer's couchdb database, how does this peer recover from the changed state and get synchronized with other peers?
If you modify data in the state database, it will not be propagated to other peers. See the detailed answer in the question: Hyperledger Fabric CouchDB updates through Fauxton treated as valid updates, but no record in blockchain

Resources