Gateway: Network Interactions Management
A Hyperledger Fabric network configuration can change over time. Peers, orderers, and CA components - contributed by the different organizations in the network - can be added or removed depending on different reasons, such as increased or reduced business demand, both planned and unplanned outages, etc.
A gateway manages the network interactions on behalf of the application, allowing the application to focus on the business logic. A gateway also helps an application developer avoid the code pieces dependent on the network configuration.
The gateway accepts two types of configurations: a connection profile and connection options.
A connection profile describes a static network topology in JSON or YAML format. The SDK will use this topology in conjunction with connection options to manage the transaction submission and notification processes.
Сonnection options represent dynamic gateway configurations, such as a user identity to connect to the network, event handling options, etc. Service discovery can be enabled in connection options as well. If service discovery is enabled, a connection profile can contain minimal required network topology, including a number of known peers that use service discovery to reach the available network components. Otherwise, a connection profile should contain a sufficient network topology definition to allow a gateway to interact with a network on behalf of the application, including network channels, organizations, orderers, peers, and their roles.
🚩Service discovery can only be used if enabled in blockchain network configurations. You can read more about service discovery in the Hyperledger Fabric documentation.
It is possible to use multiple gateways within one application. They can act on behalf of different users, connect to different blockchain networks, etc.
Last updated
Was this helpful?