@@ -24,6 +24,7 @@ import (
24
24
gossipcommon "github.com/hyperledger/fabric/gossip/common"
25
25
"github.com/hyperledger/fabric/gossip/discovery"
26
26
27
+ "github.com/hyperledger/fabric/common/localmsp"
27
28
"github.com/hyperledger/fabric/protos/common"
28
29
gossip_proto "github.com/hyperledger/fabric/protos/gossip"
29
30
"github.com/hyperledger/fabric/protos/orderer"
@@ -175,39 +176,37 @@ func (b *blocksProviderImpl) RequestBlocks(ledgerInfoProvider LedgerInfo) error
175
176
}
176
177
177
178
func (b * blocksProviderImpl ) seekOldest () error {
178
- return b .client .Send (& common.Envelope {
179
- Payload : utils .MarshalOrPanic (& common.Payload {
180
- Header : & common.Header {
181
- ChannelHeader : utils .MarshalOrPanic (& common.ChannelHeader {
182
- ChannelId : b .chainID ,
183
- }),
184
- SignatureHeader : utils .MarshalOrPanic (& common.SignatureHeader {}),
185
- },
186
- Data : utils .MarshalOrPanic (& orderer.SeekInfo {
187
- Start : & orderer.SeekPosition {Type : & orderer.SeekPosition_Oldest {Oldest : & orderer.SeekOldest {}}},
188
- Stop : & orderer.SeekPosition {Type : & orderer.SeekPosition_Specified {Specified : & orderer.SeekSpecified {Number : math .MaxUint64 }}},
189
- Behavior : orderer .SeekInfo_BLOCK_UNTIL_READY ,
190
- }),
191
- }),
192
- })
179
+ seekInfo := & orderer.SeekInfo {
180
+ Start : & orderer.SeekPosition {Type : & orderer.SeekPosition_Oldest {Oldest : & orderer.SeekOldest {}}},
181
+ Stop : & orderer.SeekPosition {Type : & orderer.SeekPosition_Specified {Specified : & orderer.SeekSpecified {Number : math .MaxUint64 }}},
182
+ Behavior : orderer .SeekInfo_BLOCK_UNTIL_READY ,
183
+ }
184
+
185
+ //TODO- epoch and msgVersion may need to be obtained for nowfollowing usage in orderer/configupdate/configupdate.go
186
+ msgVersion := int32 (0 )
187
+ epoch := uint64 (0 )
188
+ env , err := utils .CreateSignedEnvelope (common .HeaderType_CONFIG_UPDATE , b .chainID , localmsp .NewSigner (), seekInfo , msgVersion , epoch )
189
+ if err != nil {
190
+ return err
191
+ }
192
+ return b .client .Send (env )
193
193
}
194
194
195
195
func (b * blocksProviderImpl ) seekLatestFromCommitter (height uint64 ) error {
196
- return b .client .Send (& common.Envelope {
197
- Payload : utils .MarshalOrPanic (& common.Payload {
198
- Header : & common.Header {
199
- ChannelHeader : utils .MarshalOrPanic (& common.ChannelHeader {
200
- ChannelId : b .chainID ,
201
- }),
202
- SignatureHeader : utils .MarshalOrPanic (& common.SignatureHeader {}),
203
- },
204
- Data : utils .MarshalOrPanic (& orderer.SeekInfo {
205
- Start : & orderer.SeekPosition {Type : & orderer.SeekPosition_Specified {Specified : & orderer.SeekSpecified {Number : height }}},
206
- Stop : & orderer.SeekPosition {Type : & orderer.SeekPosition_Specified {Specified : & orderer.SeekSpecified {Number : math .MaxUint64 }}},
207
- Behavior : orderer .SeekInfo_BLOCK_UNTIL_READY ,
208
- }),
209
- }),
210
- })
196
+ seekInfo := & orderer.SeekInfo {
197
+ Start : & orderer.SeekPosition {Type : & orderer.SeekPosition_Specified {Specified : & orderer.SeekSpecified {Number : height }}},
198
+ Stop : & orderer.SeekPosition {Type : & orderer.SeekPosition_Specified {Specified : & orderer.SeekSpecified {Number : math .MaxUint64 }}},
199
+ Behavior : orderer .SeekInfo_BLOCK_UNTIL_READY ,
200
+ }
201
+
202
+ //TODO- epoch and msgVersion may need to be obtained for nowfollowing usage in orderer/configupdate/configupdate.go
203
+ msgVersion := int32 (0 )
204
+ epoch := uint64 (0 )
205
+ env , err := utils .CreateSignedEnvelope (common .HeaderType_CONFIG_UPDATE , b .chainID , localmsp .NewSigner (), seekInfo , msgVersion , epoch )
206
+ if err != nil {
207
+ return err
208
+ }
209
+ return b .client .Send (env )
211
210
}
212
211
213
212
func createGossipMsg (chainID string , payload * gossip_proto.Payload ) * gossip_proto.GossipMessage {
0 commit comments