@@ -44,7 +44,7 @@ class InvokeService {
4444 try {
4545 // first setup the client for this org
4646 client = await common . getClientForOrg ( orgName , userName )
47-
47+
4848 channel = await common . getChannel ( orgName , userName , channelName ) ;
4949
5050 if ( ! channel ) {
@@ -116,7 +116,12 @@ class InvokeService {
116116 }
117117
118118 } else if ( proposalResponses [ i ] . response && proposalResponses [ i ] . response . status === 200 ) {
119- logger . debug ( 'invoke chaincode proposal was good' ) ;
119+ logger . info ( 'invoke chaincode proposal was good' ) ;
120+ logger . debug ( util . format (
121+ 'Successfully sent Proposal and received ProposalResponse: Status - %s, message - "%s", metadata - "%s", endorsement signature: %s' ,
122+ proposalResponses [ i ] . response . status , proposalResponses [ i ] . response . message ,
123+ proposalResponses [ i ] . response . payload , proposalResponses [ i ] . endorsement . signature ) ) ;
124+ logger . info ( "Endored by:" , proposalResponses [ i ] . peer . name ) ;
120125 } else {
121126 // increase counter
122127 common . errorRequestCounter . inc ( ) ;
@@ -128,10 +133,12 @@ class InvokeService {
128133 }
129134
130135 if ( all_good ) {
131- logger . debug ( util . format (
132- 'Successfully sent Proposal and received ProposalResponse: Status - %s, message - "%s", metadata - "%s", endorsement signature: %s' ,
133- proposalResponses [ 0 ] . response . status , proposalResponses [ 0 ] . response . message ,
134- proposalResponses [ 0 ] . response . payload , proposalResponses [ 0 ] . endorsement . signature ) ) ;
136+ // Check write sets
137+ if ( channel . compareProposalResponseResults ( proposalResponses ) ) {
138+ logger . info ( 'All proposals compare equally!' ) ;
139+ } else {
140+ logger . warn ( 'All proposals compare differently!' )
141+ }
135142
136143 // wait for the channel-based event hub to tell us
137144 // that the commit was good or bad on each peer in our organization
@@ -212,14 +219,8 @@ class InvokeService {
212219
213220 // now see what each of the event hubs reported
214221 for ( let i in resultsPromise ) {
215- let event_hub_result = resultsPromise [ i ] ;
216- let event_hub = event_hubs [ i ] ;
217- logger . debug ( 'Event results for event hub :%s' , event_hub . getPeerAddr ( ) ) ;
218- if ( typeof event_hub_result === 'string' ) {
219- logger . debug ( event_hub_result ) ;
220- } else {
221- if ( ! error_message ) error_message = event_hub_result . toString ( ) ;
222- logger . debug ( event_hub_result . toString ( ) ) ;
222+ if ( typeof resultsPromise [ i ] === 'string' ) {
223+ committedCount ++
223224 }
224225 }
225226 }
0 commit comments