add: mumbai geth config updated

This commit is contained in:
Krishna Upadhyaya 2021-09-02 19:55:04 +05:30
parent 2f40184dd1
commit 6f54d66cac
6 changed files with 40 additions and 4 deletions

View file

@ -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'
}

View file

@ -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)

View file

@ -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...")

View file

@ -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")
}
}

View file

@ -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
}

View file

@ -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{