Skip to content

Commit

Permalink
add calibnet and mainnet in version
Browse files Browse the repository at this point in the history
  • Loading branch information
deaswang committed Jan 20, 2021
1 parent 48c6c55 commit 6a5a2f6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build/params_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func init() {
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))

BuildType |= Build2k
BuildType = Build2k
}

const BlockDelaySecs = uint64(4)
Expand Down
2 changes: 2 additions & 0 deletions build/params_calibnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ func init() {
SetAddressNetwork(address.Testnet)

Devnet = true

BuildType = BuildCalibnet
}

const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
Expand Down
2 changes: 1 addition & 1 deletion build/params_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package build

func init() {
InsecurePoStValidation = true
BuildType |= BuildDebug
BuildType = BuildDebug
}

// NOTE: Also includes settings from params_2k
2 changes: 2 additions & 0 deletions build/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ func init() {
}

Devnet = false

BuildType = BuildMainnet
}

const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
Expand Down
16 changes: 11 additions & 5 deletions build/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,25 @@ var CurrentCommit string
var BuildType int

const (
BuildDefault = 0
Build2k = 0x1
BuildDebug = 0x3
BuildDefault = 0
BuildMainnet = 0x1
Build2k = 0x2
BuildDebug = 0x3
BuildCalibnet = 0x4
)

func buildType() string {
switch BuildType {
case BuildDefault:
return ""
case BuildDebug:
return "+debug"
case BuildMainnet:
return "+mainnet"
case Build2k:
return "+2k"
case BuildDebug:
return "+debug"
case BuildCalibnet:
return "+calibnet"
default:
return "+huh?"
}
Expand Down

0 comments on commit 6a5a2f6

Please sign in to comment.