setup enough fake peer IDs for miner generation

This commit is contained in:
whyrusleeping 2019-12-09 19:40:54 +01:00
parent 1490cf6b9c
commit b444771427

View File

@ -87,6 +87,7 @@ func MakeGenesis(outFile, presealInfo string) func(bs dtypes.ChainBlockstore, w
return nil, err
}
var fakePeerIDs []peer.ID
minerAddresses := make([]address.Address, 0, len(preseals))
for s := range preseals {
a, err := address.NewFromString(s)
@ -97,10 +98,11 @@ func MakeGenesis(outFile, presealInfo string) func(bs dtypes.ChainBlockstore, w
return nil, xerrors.New("expected ID address")
}
minerAddresses = append(minerAddresses, a)
fakePeerIDs = append(fakePeerIDs, peer.ID("peer"+a.String()))
}
gmc := &gen.GenMinerCfg{
PeerIDs: []peer.ID{"peer ID 1"},
PeerIDs: fakePeerIDs,
PreSeals: preseals,
MinerAddrs: minerAddresses,
}