dl_
dl_

Reputation: 272

HLF v1.0 node.js fabric-client and orderers availability

I have following fabric network topology: two orgs with two peers and two orderers per organisation (along with required kafka/zookeepers).

Q: How to setup the node fabric-client to protect my app against failure of the single orderer?

The documentation says that I can add multiple orderers to the list using channel.addOrderer(orderer), but it also says that

"SDK uses only first orderer from the list"

so, my understanding is that failure of the first orderer from the list will prevent the processing of the subsequent transactions - am I right?

Upvotes: 1

Views: 358

Answers (2)

Ajay Jadhav
Ajay Jadhav

Reputation: 2467

The version v1.2.0 of Node SDK, already includes this feature where the channel may have multiple orderers, and the sendTransaction API should try the first one and then the next and so on until it succeeds in sending the transaction.

Upvotes: 0

Gari Singh
Gari Singh

Reputation: 12033

You are correct although you can easily rectify this situation. If you get a failure from sendTransaction which is related to that orderer node being down (e.g. SERVICE_UNAVAILABLE), you can use the removeOrderer method remove the orderer and then call sendTransaction again (as it will now use whatever the next orderer in the list was). You can also use addOrderer to add the orderer you removed back to the end of the list as well.

Upvotes: 2

Related Questions