-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: show network name in binary versions (#1642)
* fix boostd-data maddr, enhance build * add CQL migrator * refactor migrator * modify migrate query * remove idx from migrate query * remove CQL migrator * undo go mod changes, fix mainnet build * undo yugabyte changes * remove extra line
- Loading branch information
Showing
9 changed files
with
150 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//go:build calibnet | ||
// +build calibnet | ||
|
||
package build | ||
|
||
import ( | ||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
func init() { | ||
SetAddressNetwork(address.Testnet) | ||
BuildType = BuildCalibnet | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//go:build !calibnet && !debug && !2k | ||
// +build !calibnet,!debug,!2k | ||
|
||
package build | ||
|
||
import ( | ||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
func init() { | ||
SetAddressNetwork(address.Mainnet) | ||
BuildType = BuildMainnet | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//go:build debug || 2k | ||
// +build debug 2k | ||
|
||
package build | ||
|
||
import ( | ||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
func init() { | ||
SetAddressNetwork(address.Testnet) | ||
BuildType = BuildDebug | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,38 @@ | ||
package build | ||
|
||
var CurrentCommit string | ||
var BuildType int | ||
|
||
const ( | ||
BuildMainnet = 0x1 | ||
Build2k = 0x2 | ||
BuildDebug = 0x3 | ||
BuildCalibnet = 0x4 | ||
BuildInteropnet = 0x5 | ||
BuildButterflynet = 0x7 | ||
) | ||
|
||
func BuildTypeString() string { | ||
switch BuildType { | ||
case BuildMainnet: | ||
return "+mainnet" | ||
case Build2k: | ||
return "+2k" | ||
case BuildDebug: | ||
return "+debug" | ||
case BuildCalibnet: | ||
return "+calibnet" | ||
case BuildInteropnet: | ||
return "+interopnet" | ||
case BuildButterflynet: | ||
return "+butterflynet" | ||
default: | ||
return "+huh?" | ||
} | ||
} | ||
|
||
const BuildVersion = "2.0.0-rc1" | ||
|
||
func UserVersion() string { | ||
return BuildVersion + CurrentCommit | ||
return BuildVersion + BuildTypeString() + CurrentCommit | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,47 @@ | ||
package build | ||
|
||
import ( | ||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
var CurrentCommit string | ||
|
||
func SetAddressNetwork(n address.Network) { | ||
address.CurrentNetwork = n | ||
} | ||
|
||
var BuildType int | ||
|
||
const ( | ||
BuildMainnet = 0x1 | ||
Build2k = 0x2 | ||
BuildDebug = 0x3 | ||
BuildCalibnet = 0x4 | ||
BuildInteropnet = 0x5 | ||
BuildButterflynet = 0x7 | ||
) | ||
|
||
func BuildTypeString() string { | ||
switch BuildType { | ||
case BuildMainnet: | ||
return "+mainnet" | ||
case Build2k: | ||
return "+2k" | ||
case BuildDebug: | ||
return "+debug" | ||
case BuildCalibnet: | ||
return "+calibnet" | ||
case BuildInteropnet: | ||
return "+interopnet" | ||
case BuildButterflynet: | ||
return "+butterflynet" | ||
default: | ||
return "+huh?" | ||
} | ||
} | ||
|
||
const BuildVersion = "1.4.0" | ||
|
||
func UserVersion() string { | ||
return BuildVersion + CurrentCommit | ||
return BuildVersion + BuildTypeString() + CurrentCommit | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//go:build calibnet | ||
// +build calibnet | ||
|
||
package build | ||
|
||
import ( | ||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
func init() { | ||
SetAddressNetwork(address.Testnet) | ||
BuildType = BuildCalibnet | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//go:build !calibnet && !debug && !2k | ||
// +build !calibnet,!debug,!2k | ||
|
||
package build | ||
|
||
import ( | ||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
func init() { | ||
SetAddressNetwork(address.Mainnet) | ||
BuildType = BuildMainnet | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//go:build debug || 2k | ||
// +build debug 2k | ||
|
||
package build | ||
|
||
import ( | ||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
func init() { | ||
SetAddressNetwork(address.Testnet) | ||
BuildType = BuildDebug | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters