Customizing SDK behavior
As we've seen, an application can perform three fundamental tasks: query the ledger, submit new transactions, and listen for notifications. The SDK provides applications a simple API that hides the detailed network interactions required to achieve these goals by separating what the application wants to achieve from how it is achieved.
This principle of separation of concerns means that an application can focus on business logic, and let the SDK handle all the detailed interactions with the underlying Hyperledger network components.
To provide this simplicity, the SDK makes a lot of network interaction decisions on behalf of the application. That's because a Hyperledger Fabric network can be arbitrarily complex, and complexity introduces choices.
Like a good friend, the fabric-network
package will always make a sensible default choice on behalf of the application. An obvious example might be not to use a peer that isn't running. Often...