Skip to content

Commit

Permalink
main,utils: init --messnet flag
Browse files Browse the repository at this point in the history
Signed-off-by: meows <[email protected]>
  • Loading branch information
meowsbits committed Sep 13, 2020
1 parent 5c5b001 commit 62f29e8
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmd/echainspec/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ var defaultChainspecValues = map[string]ctypes.Configurator{
"rinkeby": params.DefaultRinkebyGenesisBlock(),
"goerli": params.DefaultGoerliGenesisBlock(),
"yolov1": params.DefaultYoloV1GenesisBlock(),
"messnet": params.DefaultMessNetGenesisBlock(),

"social": params.DefaultSocialGenesisBlock(),
"ethersocial": params.DefaultEthersocialGenesisBlock(),
Expand Down
2 changes: 2 additions & 0 deletions cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ The export-preimages command export hash preimages to an RLP encoded stream`,
utils.SyncModeFlag,
utils.FakePoWFlag,
utils.ClassicFlag,
utils.MessNetFlag,
utils.MordorFlag,
utils.KottiFlag,
utils.SocialFlag,
Expand Down Expand Up @@ -221,6 +222,7 @@ Use "ethereum dump 0" to dump the genesis block.`,
utils.AncientFlag,
utils.CacheFlag,
utils.ClassicFlag,
utils.MessNetFlag,
utils.MordorFlag,
utils.KottiFlag,
utils.SocialFlag,
Expand Down
2 changes: 2 additions & 0 deletions cmd/geth/consolecmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ func remoteConsole(ctx *cli.Context) error {
path = filepath.Join(path, "kotti")
} else if ctx.GlobalBool(utils.ClassicFlag.Name) {
path = filepath.Join(path, "classic")
} else if ctx.GlobalBool(utils.MessNetFlag.Name) {
path = filepath.Join(path, "messnet")
} else if ctx.GlobalBool(utils.MordorFlag.Name) {
path = filepath.Join(path, "mordor")
} else if ctx.GlobalBool(utils.SocialFlag.Name) {
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/consolecmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func TestConsoleCmdNetworkIdentities(t *testing.T) {
{[]string{"--social"}, 28, 28, params.SocialGenesisHash.Hex()},
{[]string{"--ethersocial"}, 1, 31102, params.EthersocialGenesisHash.Hex()},
{[]string{"--yolov1"}, 133519467574833, 133519467574833, params.YoloV1GenesisHash.Hex()},
{[]string{"--messnet"}, 6161, 6161, "0xb2957ab683ae69176b2eb7858f2baedb93752cb7cb45284529d543eebe20652e"},
}
for i, p := range chainIdentityCases {

Expand Down
4 changes: 4 additions & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ var (
utils.DeveloperFlag,
utils.DeveloperPeriodFlag,
utils.ClassicFlag,
utils.MessNetFlag,
utils.MordorFlag,
utils.SocialFlag,
utils.MixFlag,
Expand Down Expand Up @@ -314,6 +315,9 @@ func checkMainnet(ctx *cli.Context) bool {
case ctx.GlobalIsSet(utils.ClassicFlag.Name):
log.Info("Starting Geth on Ethereum Classic...")

case ctx.GlobalIsSet(utils.MessNetFlag.Name):
log.Info("Starting Geth on MessNet...")

case ctx.GlobalIsSet(utils.MordorFlag.Name):
log.Info("Starting Geth on Mordor testnet...")

Expand Down
1 change: 1 addition & 0 deletions cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ var AppHelpFlagGroups = []flags.FlagGroup{
utils.RinkebyFlag,
utils.YoloV1Flag,
utils.RopstenFlag,
utils.MessNetFlag,
utils.SyncModeFlag,
utils.ExitWhenSyncedFlag,
utils.GCModeFlag,
Expand Down
12 changes: 10 additions & 2 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ var (
}
NetworkIdFlag = cli.Uint64Flag{
Name: "networkid",
Usage: "Network identifier (integer, 1=Mainnet, 2=Morden (disused), 3=Ropsten, 4=Rinkeby, 5=Goerli, 6=Kotti, YoloV1=133519467574833, developer=1337)",
Usage: "Network identifier (integer, 1=Mainnet, 2=Morden (disused), 3=Ropsten, 4=Rinkeby, 5=Goerli, 6=Kotti, YoloV1=133519467574833, 6161=MessNet, developer=1337)",
Value: eth.DefaultConfig.NetworkId,
}
ClassicFlag = cli.BoolFlag{
Expand Down Expand Up @@ -179,6 +179,10 @@ var (
Name: "goerli",
Usage: "Görli network: pre-configured proof-of-authority test network",
}
MessNetFlag = cli.BoolFlag{
Name: "messnet",
Usage: "MESS network: temporary dedicated test network for MESS testing",
}
DeveloperFlag = cli.BoolFlag{
Name: "dev",
Usage: "Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled",
Expand Down Expand Up @@ -1299,6 +1303,8 @@ func dataDirPathForCtxChainConfig(ctx *cli.Context, baseDataDirPath string) stri
return filepath.Join(baseDataDirPath, "ropsten")
case ctx.GlobalBool(ClassicFlag.Name):
return filepath.Join(baseDataDirPath, "classic")
case ctx.GlobalBool(MessNetFlag.Name):
return filepath.Join(baseDataDirPath, "messnet")
case ctx.GlobalBool(MordorFlag.Name):
return filepath.Join(baseDataDirPath, "mordor")
case ctx.GlobalBool(SocialFlag.Name):
Expand Down Expand Up @@ -1560,7 +1566,7 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node, cfg *whisper.Config) {
// SetEthConfig applies eth-related command line flags to the config.
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
// Avoid conflicting network flags
CheckExclusive(ctx, DeveloperFlag, LegacyTestnetFlag, RopstenFlag, RinkebyFlag, GoerliFlag, YoloV1Flag, ClassicFlag, KottiFlag, MordorFlag, EthersocialFlag, SocialFlag)
CheckExclusive(ctx, DeveloperFlag, LegacyTestnetFlag, RopstenFlag, RinkebyFlag, GoerliFlag, YoloV1Flag, ClassicFlag, KottiFlag, MordorFlag, EthersocialFlag, SocialFlag, MessNetFlag)
CheckExclusive(ctx, LegacyLightServFlag, LightServeFlag, SyncModeFlag, "light")
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
CheckExclusive(ctx, GCModeFlag, "archive", TxLookupLimitFlag)
Expand Down Expand Up @@ -1908,6 +1914,8 @@ func genesisForCtxChainConfig(ctx *cli.Context) *genesisT.Genesis {
switch {
case ctx.GlobalBool(ClassicFlag.Name):
genesis = params.DefaultClassicGenesisBlock()
case ctx.GlobalBool(MessNetFlag.Name):
genesis = params.DefaultMessNetGenesisBlock()
case ctx.GlobalBool(MordorFlag.Name):
genesis = params.DefaultMordorGenesisBlock()
case ctx.GlobalBool(SocialFlag.Name):
Expand Down
2 changes: 1 addition & 1 deletion params/config_classic.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var (
ExpDiffPeriod = big.NewInt(100000) // Exponential diff period for diff bomb & ECIP1010

MessNetConfig = &coregeth.CoreGethChainConfig{
NetworkID: 1,
NetworkID: 6161,
Ethash: new(ctypes.EthashConfig),
ChainID: big.NewInt(6161),

Expand Down

0 comments on commit 62f29e8

Please sign in to comment.