Merge pull request #820 from filecoin-project/fix/multi-miner-genesis-init

Fix/multi miner genesis init
This commit is contained in:
Łukasz Magiera 2019-12-09 21:34:51 +01:00 committed by GitHub
commit f16756cc54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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,
}