cmd/utils: fix parsing BootstrapNodes from BootnodesFlag
This commit is contained in:
parent
0f622f3829
commit
0d482ccdc4
@ -1131,12 +1131,10 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
|
||||
switch {
|
||||
case ctx.IsSet(BootnodesFlag.Name):
|
||||
urls = SplitAndTrim(ctx.String(BootnodesFlag.Name))
|
||||
case cfg.BootstrapNodes != nil:
|
||||
return // already set, don't apply defaults.
|
||||
}
|
||||
|
||||
// don't apply defaults if BootstrapNodes is already set
|
||||
if cfg.BootstrapNodes != nil {
|
||||
return
|
||||
}
|
||||
cfg.BootstrapNodes = make([]*enode.Node, 0, len(urls))
|
||||
for _, url := range urls {
|
||||
if url != "" {
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM golang:1.19-alpine as bsc
|
||||
FROM golang:1.20-alpine as bsc
|
||||
|
||||
RUN apk add --no-cache make cmake gcc musl-dev linux-headers git bash build-base libc-dev
|
||||
|
||||
|
@ -108,7 +108,7 @@ type bucket struct {
|
||||
index int
|
||||
}
|
||||
|
||||
func newTable(t transport, db *enode.DB, cfg Config, filter NodeFilterFunc) (*Table, error) {
|
||||
func newTable(t transport, db *enode.DB, cfg Config) (*Table, error) {
|
||||
cfg = cfg.withDefaults()
|
||||
tab := &Table{
|
||||
net: t,
|
||||
@ -121,7 +121,7 @@ func newTable(t transport, db *enode.DB, cfg Config, filter NodeFilterFunc) (*Ta
|
||||
closed: make(chan struct{}),
|
||||
rand: mrand.New(mrand.NewSource(0)),
|
||||
ips: netutil.DistinctNetSet{Subnet: tableSubnet, Limit: tableIPLimit},
|
||||
enrFilter: filter,
|
||||
enrFilter: cfg.FilterFunction,
|
||||
bucketSize: bucketSize,
|
||||
}
|
||||
if cfg.IsBootnode {
|
||||
@ -142,8 +142,8 @@ func newTable(t transport, db *enode.DB, cfg Config, filter NodeFilterFunc) (*Ta
|
||||
return tab, nil
|
||||
}
|
||||
|
||||
func newMeteredTable(t transport, db *enode.DB, cfg Config, filter NodeFilterFunc) (*Table, error) {
|
||||
tab, err := newTable(t, db, cfg, filter)
|
||||
func newMeteredTable(t transport, db *enode.DB, cfg Config) (*Table, error) {
|
||||
tab, err := newTable(t, db, cfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ func init() {
|
||||
func newTestTable(t transport) (*Table, *enode.DB) {
|
||||
cfg := Config{Log: log.Root()}
|
||||
db, _ := enode.OpenDB("")
|
||||
tab, _ := newTable(t, db, cfg, nil)
|
||||
tab, _ := newTable(t, db, cfg)
|
||||
go tab.loop()
|
||||
return tab, db
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ func ListenV4(c UDPConn, ln *enode.LocalNode, cfg Config) (*UDPv4, error) {
|
||||
log: cfg.Log,
|
||||
}
|
||||
|
||||
tab, err := newMeteredTable(t, ln.Database(), cfg, cfg.FilterFunction)
|
||||
tab, err := newMeteredTable(t, ln.Database(), cfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ func newUDPv5(conn UDPConn, ln *enode.LocalNode, cfg Config) (*UDPv5, error) {
|
||||
cancelCloseCtx: cancelCloseCtx,
|
||||
}
|
||||
t.talk = newTalkSystem(t)
|
||||
tab, err := newMeteredTable(t, t.db, cfg, cfg.FilterFunction)
|
||||
tab, err := newMeteredTable(t, t.db, cfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -53,3 +53,9 @@ EnableMsgEvents = false
|
||||
ReadTimeout = 30000000000
|
||||
WriteTimeout = 30000000000
|
||||
IdleTimeout = 120000000000
|
||||
|
||||
[Node.LogConfig]
|
||||
FilePath = "bsc.log"
|
||||
MaxBytesSize = 10485760
|
||||
Level = "info"
|
||||
FileRoot = ""
|
@ -36,3 +36,9 @@ EnableMsgEvents = false
|
||||
[Node.HTTPTimeouts]
|
||||
ReadTimeout = 30000000000
|
||||
WriteTimeout = 30000000000
|
||||
|
||||
[Node.LogConfig]
|
||||
FilePath = "bsc.log"
|
||||
MaxBytesSize = 10485760
|
||||
Level = "info"
|
||||
FileRoot = ""
|
@ -13,6 +13,6 @@ echo "validator id: ${HOST_IP}"
|
||||
geth --config ${DATA_DIR}/config.toml --datadir ${DATA_DIR} --netrestrict ${CLUSTER_CIDR} \
|
||||
--verbosity ${VERBOSE} --nousb \
|
||||
--bootnodes enode://${BOOTSTRAP_PUB_KEY}@${BOOTSTRAP_IP}:${BOOTSTRAP_TCP_PORT} \
|
||||
--mine -unlock ${VALIDATOR_ADDR} --password /dev/null \
|
||||
--mine -unlock ${VALIDATOR_ADDR} --miner.etherbase ${VALIDATOR_ADDR} --password /dev/null \
|
||||
--light.serve 50 \
|
||||
--rpc.allow-unprotected-txs --txlookuplimit 15768000
|
||||
|
Loading…
Reference in New Issue
Block a user