You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/network/network.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,13 +84,16 @@ While it's now technically possible to drive transactions using the peer CLI, th
84
84
85
85
## Using an application on the channel
86
86
87
-
After a smart contract has been committed, client applications can be used to invoke transactions on a chaincode. This completes the structure we showed in the first image:
87
+
After a smart contract has been committed, client applications can be used to invoke transactions on a chaincode,
88
+
via the Fabric Gateway service (the gateway). This completes the structure we showed in the first image:
88
89
89
90

90
91
91
92
Just like peers and orderers, a client application has an identity that associates it with an organization. In our example, client application A1 is associated with organization R1 and is connected to C1.
92
93
93
-
Once a chaincode has been installed on a peer node and defined on a channel it can be [invoked](../glossary.html#invoke) by a client application. Client applications do this by sending transaction proposals to peers owned by the organizations specified by the endorsement policy. The transaction proposal serves as input to the chaincode, which uses it to generate an endorsed transaction response, which is returned by the peer node to the client application.
94
+
Once a chaincode has been installed on a peer node and defined on a channel it can be [invoked](../glossary.html#invoke) by a client application. Client applications do this by sending transaction proposals to the gateway. The target peer --- a peer in the same organization submitting the proposal --- then runs the transaction and forwards the proposal to peers in the organizations required by the endorsement policy. The transaction proposal serves as input to the chaincode, which uses it to generate an endorsed transaction response, which is returned by the target peer to the client application.
95
+
96
+
Note: Instead of delegating transaction endorsement to the gateway, the client application can specify the endorsing organizations and collect the endorsements --- refer to the [v2.3 Applications and Peers](https://hyperledger-fabric.readthedocs.io/en/release-2.3/peers/peers.html#applications-and-peers) topic for details.
94
97
95
98
We can see that our peer organizations, R1 and R2, are fully participating in the channel. Their applications can access the ledger L1 via smart contract S5 to generate transactions that will be endorsed by the organizations specified in the endorsement policy and written to the ledger.
Copy file name to clipboardExpand all lines: docs/source/orderer/ordering_service.md
+50-44Lines changed: 50 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,41 +74,45 @@ process with three phases that ensures all of the peers in a blockchain network
74
74
keep their ledgers consistent with each other.
75
75
76
76
In the first phase, a client application sends a transaction proposal to
77
-
a subset of peers that will invoke a smart contract to produce a proposed
78
-
ledger update and then endorse the results. The endorsing peers do not apply
79
-
the proposed update to their copy of the ledger at this time. Instead, the
80
-
endorsing peers return a proposal response to the client application. The
77
+
the Fabric Gateway service. The target peer --- a peer in the same organization
78
+
submitting the proposal --- then runs the transaction. The gateway also forwards
79
+
the proposal to peers in the organizations required by the endorsement policy. The
81
80
endorsed transaction proposals will ultimately be ordered into blocks in phase
82
-
two, and then distributed to all peers for final validation and commit in
83
-
phase three.
81
+
two, and then distributed to all peers for final validation and commitment to
82
+
the ledger in phase three.
83
+
84
+
Note: Instead of delegating to the gateway, the client application can manage
85
+
transaction endorsement by using a Fabric v2.3 SDK --- refer to the [v2.3 Applications and Peers](https://hyperledger-fabric.readthedocs.io/en/release-2.3/peers/peers.html#applications-and-peers) topic for details.
84
86
85
87
For an in-depth look at the first phase, refer back to the [Peers](../peers/peers.html#phase-1-proposal) topic.
86
88
87
89
### Phase two: Ordering and packaging transactions into blocks
88
90
89
-
After the completion of the first phase of a transaction, a client
90
-
application has received an endorsed transaction proposal response from a set of
91
-
peers. It's now time for the second phase of a transaction.
91
+
With successful completion of the first transaction phase (proposal), the client
92
+
application has received an endorsed transaction proposal response from the
93
+
Fabric Gateway service for signing. For an endorsed transaction, the gateway service
94
+
forwards the transaction to the ordering service, which orders it with
95
+
other endorsed transactions, and packages them all into a block.
92
96
93
-
In this phase, application clients submit transactions containing endorsed
94
-
transaction proposal responses to an ordering service node. The ordering service
95
-
creates blocks of transactions which will ultimately be distributed to
96
-
all peers on the channel for final validation and commit in phase three.
97
+
The ordering service creates these blocks of transactions, which will ultimately
98
+
be distributed to all peers on the channel for validation and commitment to
99
+
the ledger in phase three. The blocks themselves are also ordered and are the
100
+
basic components of a blockchain ledger.
97
101
98
102
Ordering service nodes receive transactions from many different application
99
-
clients concurrently. These ordering service nodes work together to collectively
100
-
form the ordering service. Its job is to arrange batches of submitted transactions
101
-
into a well-defined sequence and package them into *blocks*. These blocks will
102
-
become the *blocks* of the blockchain!
103
+
clients (via the gateway) concurrently. These ordering service nodes collectively
104
+
form the ordering service, which may be shared by multiple channels.
103
105
104
106
The number of transactions in a block depends on channel configuration
105
107
parameters related to the desired size and maximum elapsed duration for a
106
108
block (`BatchSize` and `BatchTimeout` parameters, to be exact). The blocks are
107
-
then saved to the orderer's ledger and distributed to all peers that have joined
108
-
the channel. If a peer happens to be down at this time, or joins the channel
109
-
later, it will receive the blocks after reconnecting to an ordering service
110
-
node, or by gossiping with another peer. We'll see how this block is processed
111
-
by peers in the third phase.
109
+
then saved to the orderer's ledger and distributed to all peers on the channel.
110
+
If a peer happens to be down at this time, or joins
111
+
the channel later, it will receive the blocks by gossiping with another peer.
112
+
We'll see how this block is processed by peers in the third phase.
113
+
114
+
<!-- diagram and diagram summary need updating for gateway method.
115
+
commenting out for short term
112
116
113
117

114
118
@@ -122,6 +126,8 @@ transaction order is T1,T2,T3,T4,T6,T5 -- which may not be the order in which
122
126
these transactions arrived at the orderer! (This example shows a very
123
127
simplified ordering service configuration with only one ordering node.)*
124
128
129
+
-->
130
+
125
131
It's worth noting that the sequencing of transactions in a block is not
126
132
necessarily the same as the order received by the ordering service, since there
127
133
can be multiple ordering service nodes that receive transactions at approximately
@@ -135,36 +141,36 @@ packaged into multiple different blocks that compete to form a chain.
135
141
In Hyperledger Fabric, the blocks generated by the ordering service are
136
142
**final**. Once a transaction has been written to a block, its position in the
137
143
ledger is immutably assured. As we said earlier, Hyperledger Fabric's finality
138
-
means that there are no **ledger forks** --- validated transactions will never
139
-
be reverted or dropped.
144
+
means that there are no **ledger forks** --- validated and committed transactions
145
+
will never be reverted or dropped.
140
146
141
147
We can also see that, whereas peers execute smart contracts and process transactions,
142
148
orderers most definitely do not. Every authorized transaction that arrives at an
143
-
orderer is mechanically packaged in a block --- the orderer makes no judgement
149
+
orderer is then mechanically packaged into a block --- the orderer makes no judgement
144
150
as to the content of a transaction (except for channel configuration transactions,
145
151
as mentioned earlier).
146
152
147
153
At the end of phase two, we see that orderers have been responsible for the simple
148
154
but vital processes of collecting proposed transaction updates, ordering them,
149
-
and packaging them into blocks, ready for distribution.
155
+
and packaging them into blocks, ready for distribution to the gateway service.
150
156
151
-
### Phase three: Validation and commit
157
+
### Phase three: Validation and commitment
152
158
153
-
The third phase of the transaction workflow involves the distribution and
154
-
subsequent validation of blocks from the orderer to the peers, where they can be
155
-
committed to the ledger.
159
+
The third phase of the transaction workflow involves the distribution of
160
+
ordered and packaged blocks from the ordering service to the channel peers
161
+
for validation and commitment to the ledger.
156
162
157
-
Phase 3 begins with the orderer distributing blocks to all peers connected to
158
-
it. It's also worth noting that not every peer needs to be connected to an orderer ---
163
+
Phase three begins with the ordering service distributing blocks to all channel
164
+
peers. It's worth noting that not every peer needs to be connected to an orderer ---
159
165
peers can cascade blocks to other peers using the [**gossip**](../gossip.html)
160
-
protocol.
161
-
162
-
Each peer will validate distributed blocks independently, but in a deterministic
163
-
fashion, ensuring that ledgers remain consistent. Specifically, each peer in the
164
-
channel will validate each transaction in the block to ensure it has been endorsed
165
-
by the required organization's peers, that its endorsements match, and that
166
-
it hasn't become invalidated by other recently committed transactions which may
167
-
have been in-flight when the transaction was originally endorsed. Invalidated
166
+
protocol --- although receiving blocks directly from the ordering service is
167
+
recommended.
168
+
169
+
Each peer will validate distributed blocks independently, ensuring that ledgers
170
+
remain consistent. Specifically, each peer in the channel will validate each
171
+
transaction in the block to ensure it has been endorsed
172
+
by the required organizations, that its endorsements match, and that
173
+
it hasn't become invalidated by other recently committed transactions. Invalidated
168
174
transactions are still retained in the immutable block created by the orderer,
169
175
but they are marked as invalid by the peer and do not update the ledger's state.
170
176
@@ -178,10 +184,10 @@ ledger L1 on P2. Once this process is complete, the ledger L1 has been
178
184
consistently updated on peers P1 and P2, and each may inform connected
179
185
applications that the transaction has been processed.*
180
186
181
-
In summary, phase three sees the blocks generated by the ordering service applied
182
-
consistently to the ledger. The strict ordering of transactions into blocks
183
-
allows each peer to validate that transaction updates are consistently applied
184
-
across the blockchain network.
187
+
In summary, phase three sees the blocks of transactions created by the ordering
188
+
service applied consistently to the ledger by the peers. The strict
189
+
ordering of transactions into blocks allows each peer to validate that transaction
190
+
updates are consistently applied across the channel.
185
191
186
192
For a deeper look at phase 3, refer back to the [Peers](../peers/peers.html#phase-3-validation-and-commit) topic.
0 commit comments