Make devnets work again
This commit is contained in:
parent
7714537239
commit
1ad2c4dab0
@ -59,7 +59,7 @@ var genesisNewCmd = &cli.Command{
|
|||||||
return xerrors.New("seed genesis new [genesis.json]")
|
return xerrors.New("seed genesis new [genesis.json]")
|
||||||
}
|
}
|
||||||
out := genesis.Template{
|
out := genesis.Template{
|
||||||
NetworkVersion: network.Version0,
|
NetworkVersion: build.NewestNetworkVersion,
|
||||||
Accounts: []genesis.Actor{},
|
Accounts: []genesis.Actor{},
|
||||||
Miners: []genesis.Miner{},
|
Miners: []genesis.Miner{},
|
||||||
VerifregRootKey: gen.DefaultVerifregRootkeyActor,
|
VerifregRootKey: gen.DefaultVerifregRootkeyActor,
|
||||||
|
@ -96,7 +96,6 @@ var preSealCmd = &cli.Command{
|
|||||||
},
|
},
|
||||||
&cli.IntFlag{
|
&cli.IntFlag{
|
||||||
Name: "network-version",
|
Name: "network-version",
|
||||||
Value: 0,
|
|
||||||
Usage: "specify network version",
|
Usage: "specify network version",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -134,7 +133,12 @@ var preSealCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
sectorSize := abi.SectorSize(sectorSizeInt)
|
sectorSize := abi.SectorSize(sectorSizeInt)
|
||||||
|
|
||||||
spt, err := miner.SealProofTypeFromSectorSize(sectorSize, network.Version(c.Uint64("network-version")))
|
nv := build.NewestNetworkVersion
|
||||||
|
if c.IsSet("network-version") {
|
||||||
|
nv = network.Version(c.Uint64("network-version"))
|
||||||
|
}
|
||||||
|
|
||||||
|
spt, err := miner.SealProofTypeFromSectorSize(sectorSize, nv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,9 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/lotus/build"
|
||||||
|
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
@ -48,7 +51,12 @@ func (api *api) Spawn() (nodeInfo, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sbroot := filepath.Join(dir, "preseal")
|
sbroot := filepath.Join(dir, "preseal")
|
||||||
genm, ki, err := seed.PreSeal(genMiner, abi.RegisteredSealProof_StackedDrg2KiBV1, 0, 2, sbroot, []byte("8"), nil, false)
|
spt, err := miner.SealProofTypeFromSectorSize(2<<10, build.NewestNetworkVersion)
|
||||||
|
if err != nil {
|
||||||
|
return nodeInfo{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
genm, ki, err := seed.PreSeal(genMiner, spt, 0, 2, sbroot, []byte("8"), nil, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nodeInfo{}, xerrors.Errorf("preseal failed: %w", err)
|
return nodeInfo{}, xerrors.Errorf("preseal failed: %w", err)
|
||||||
}
|
}
|
||||||
@ -71,6 +79,7 @@ func (api *api) Spawn() (nodeInfo, error) {
|
|||||||
template.VerifregRootKey = gen.DefaultVerifregRootkeyActor
|
template.VerifregRootKey = gen.DefaultVerifregRootkeyActor
|
||||||
template.RemainderAccount = gen.DefaultRemainderAccountActor
|
template.RemainderAccount = gen.DefaultRemainderAccountActor
|
||||||
template.NetworkName = "pond-" + uuid.New().String()
|
template.NetworkName = "pond-" + uuid.New().String()
|
||||||
|
template.NetworkVersion = build.NewestNetworkVersion
|
||||||
|
|
||||||
tb, err := json.Marshal(&template)
|
tb, err := json.Marshal(&template)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user