Skip to content

Commit

Permalink
better startup params
Browse files Browse the repository at this point in the history
  • Loading branch information
bibibong committed Jan 9, 2021
1 parent 22adf2e commit 4528641
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 30 deletions.
28 changes: 7 additions & 21 deletions build/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ package build

import (
"context"
"os"
"strings"

"github.com/EpiK-Protocol/go-epik/lib/addrutil"
"golang.org/x/xerrors"

rice "github.com/GeertJohan/go.rice"

"github.com/libp2p/go-libp2p-core/peer"
)

Expand All @@ -17,24 +15,12 @@ func BuiltinBootstrap() ([]peer.AddrInfo, error) {
return nil, nil
}

var out []peer.AddrInfo

b := rice.MustFindBox("bootstrap")
err := b.Walk("", func(path string, info os.FileInfo, err error) error {
if err != nil {
return xerrors.Errorf("failed to walk box: %w", err)
}

if !strings.HasSuffix(path, ".pi") {
return nil
}
spi := b.MustString(path)
if spi == "" {
return nil
}
pi, err := addrutil.ParseAddresses(context.TODO(), strings.Split(strings.TrimSpace(spi), "\n"))
out = append(out, pi...)
return err
})
return out, err
spi := b.MustString(BootstrappersFile)
if spi == "" {
return nil, nil
}

return addrutil.ParseAddresses(context.TODO(), strings.Split(strings.TrimSpace(spi), "\n"))
}
2 changes: 1 addition & 1 deletion build/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func MaybeGenesis() []byte {
log.Warnf("loading built-in genesis: %s", err)
return nil
}
genBytes, err := builtinGen.Bytes("testnet.car")
genBytes, err := builtinGen.Bytes(GenesisFile)
if err != nil {
log.Warnf("loading built-in genesis: %s", err)
}
Expand Down
11 changes: 3 additions & 8 deletions build/params_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
package build

import (
"math"
"os"

"github.com/EpiK-Protocol/go-epik/chain/actors/policy"
"github.com/filecoin-project/go-state-types/abi"
)

const BootstrappersFile = ""
const GenesisFile = ""

// const UpgradeBreezeHeight = -1
// const BreezeGasTampingDuration = 0

Expand All @@ -34,11 +34,6 @@ func init() {
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))

if os.Getenv("EPIK_DISABLE_V2_ACTOR_MIGRATION") == "1" {
UpgradeActorsV2Height = math.MaxInt64
UpgradeLiftoffHeight = 11
}

BuildType |= Build2k
}

Expand Down
3 changes: 3 additions & 0 deletions build/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}

const BootstrappersFile = "bootstrappers.pi"
const GenesisFile = "testnet.car"

// const UpgradeBreezeHeight = 41280
// const BreezeGasTampingDuration = 120

Expand Down
3 changes: 3 additions & 0 deletions build/params_testground.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ var (

Devnet = true
ZeroAddress = MustParseAddress("f3yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaby2smx7a")

BootstrappersFile = ""
GenesisFile = ""
)

const BootstrapPeerThreshold = 1

0 comments on commit 4528641

Please sign in to comment.