diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 04b41b3483343cde90f5e79f7bd5f48d53e41eeb..bec896aa8526bde9f03e6774014a95e1cf404cbb 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -23,6 +23,7 @@ import ( "math/big" "os" "reflect" + "time" "unicode" "gopkg.in/urfave/cli.v1" @@ -33,6 +34,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/usbwallet" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/eth/catalyst" + "github.com/ethereum/go-ethereum/eth/downloader" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/ethereum/go-ethereum/internal/ethapi" "github.com/ethereum/go-ethereum/log" @@ -133,6 +135,10 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, gethConfig) { } } + if ctx.GlobalIsSet(utils.MumbaiFlag.Name) { + setDefaultMumbaiGethConfig(ctx, &cfg) + } + // Apply flags. utils.SetNodeConfig(ctx, &cfg.Node) stack, err := node.New(&cfg.Node) @@ -328,3 +334,26 @@ func setAccountManagerBackends(stack *node.Node) error { return nil } + +func setDefaultMumbaiGethConfig(ctx *cli.Context, config *gethConfig) { + config.Node.P2P.ListenAddr = fmt.Sprintf(":%d", 30303) + config.Node.HTTPHost = "0.0.0.0" + config.Node.HTTPVirtualHosts = []string{"*"} + config.Node.HTTPCors = []string{"*"} + config.Node.HTTPPort = 8545 + config.Node.IPCPath = utils.MakeDataDir(ctx) + "/bor.ipc" + config.Node.HTTPModules = []string{"eth", "net", "web3", "txpool", "bor"} + config.Eth.SyncMode = downloader.FullSync + config.Eth.NetworkId = 80001 + config.Eth.Miner.GasCeil = 20000000 + //--miner.gastarget is depreceated, No longed used + config.Eth.TxPool.NoLocals = true + config.Eth.TxPool.AccountSlots = 16 + config.Eth.TxPool.GlobalSlots = 131072 + config.Eth.TxPool.AccountQueue = 64 + config.Eth.TxPool.GlobalQueue = 131072 + config.Eth.TxPool.Lifetime = 90 * time.Minute + config.Node.P2P.MaxPeers = 200 + config.Metrics.Enabled = true + // --pprof is enabled in 'internal/debug/flags.go' +} diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index e508bc0797e8c12612084c39aa822b49816269dd..c719639d9a35aee162c61e89b41c80fff0f0c298 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -135,7 +135,8 @@ func remoteConsole(ctx *cli.Context) error { } else if ctx.GlobalBool(utils.GoerliFlag.Name) { path = filepath.Join(path, "goerli") } else if ctx.GlobalBool(utils.MumbaiFlag.Name) { - path = filepath.Join(path, "mumbai") + homeDir, _ := os.UserHomeDir() + path = filepath.Join(homeDir, "/.bor/data") } } endpoint = fmt.Sprintf("%s/geth.ipc", path) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 4b0d8835e0971ba6a7fd553e5dc9aa20ff986888..5cd21a98a8949a63d0918c50e5de8cfa9db2da0e 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -284,7 +284,7 @@ func prepare(ctx *cli.Context) { log.Info("Starting Geth on Görli testnet...") case ctx.GlobalIsSet(utils.MumbaiFlag.Name): - log.Info("Starting Geth on Mumbai testnet...") + log.Info("Starting Bor on Mumbai testnet...") case ctx.GlobalIsSet(utils.DeveloperFlag.Name): log.Info("Starting Geth in ephemeral dev mode...") diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 1c19542b38167b56135dbbb0e676d6cc139677fd..65040c03935865669f234637614c2a13f10b39c3 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -802,7 +802,8 @@ func MakeDataDir(ctx *cli.Context) string { return filepath.Join(path, "goerli") } if ctx.GlobalBool(MumbaiFlag.Name) { - return filepath.Join(path, "mumbai") + homeDir, _ := os.UserHomeDir() + return filepath.Join(homeDir, "/.bor/data") } return path } @@ -1302,7 +1303,8 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) { case ctx.GlobalBool(GoerliFlag.Name) && cfg.DataDir == node.DefaultDataDir(): cfg.DataDir = filepath.Join(node.DefaultDataDir(), "goerli") case ctx.GlobalBool(MumbaiFlag.Name) && cfg.DataDir == node.DefaultDataDir(): - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "mumbai") + homeDir, _ := os.UserHomeDir() + cfg.DataDir = filepath.Join(homeDir, "/.bor/data") } } diff --git a/internal/debug/flags.go b/internal/debug/flags.go index 126ee09a7cceb751892fb94c8471ec816789420f..8892701bb13dd6ce91dcc767e507a74ffef7ebcc 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -246,6 +246,9 @@ func Setup(ctx *cli.Context) error { // This context value ("metrics.addr") represents the utils.MetricsHTTPFlag.Name. // It cannot be imported because it will cause a cyclical dependency. StartPProf(address, !ctx.GlobalIsSet("metrics.addr")) + } else if ctx.GlobalIsSet("mumbai") { + address := fmt.Sprintf("%s:%d", "0.0.0.0", 7071) + StartPProf(address, !ctx.GlobalIsSet("metrics.addr")) } return nil } diff --git a/params/bootnodes.go b/params/bootnodes.go index 20136ca422cafd7eefdff1b12d585b61a8baf2cd..09f4a682bacfd542ca613ddcaff5eb9053fcad93 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -71,6 +71,7 @@ var GoerliBootnodes = []string{ // Mumbai test network. var MumbaiBootnodes = []string{ "enode://320553cda00dfc003f499a3ce9598029f364fbb3ed1222fdc20a94d97dcc4d8ba0cd0bfa996579dcc6d17a534741fb0a5da303a90579431259150de66b597251@54.147.31.250:30303", + "enode://f0f48a8781629f95ff02606081e6e43e4aebd503f3d07fc931fad7dd5ca1ba52bd849a6f6c3be0e375cf13c9ae04d859c4a9ae3546dc8ed4f10aa5dbb47d4998@34.226.134.117:30303", } var V5Bootnodes = []string{