diff --git a/cmd/thor/flags.go b/cmd/thor/flags.go index b2ffd58bb..5addc2d54 100644 --- a/cmd/thor/flags.go +++ b/cmd/thor/flags.go @@ -85,7 +85,7 @@ var ( } bootNodeFlag = cli.StringFlag{ Name: "bootnode", - Usage: "comma separated list of bootnode IDs", + Usage: "comma separated list of bootstrap node IDs", } allowedPeersFlag = cli.StringFlag{ Name: "allowed-peers", diff --git a/cmd/thor/main.go b/cmd/thor/main.go index 360e640b1..0f72ebe40 100644 --- a/cmd/thor/main.go +++ b/cmd/thor/main.go @@ -180,7 +180,7 @@ func defaultAction(ctx *cli.Context) error { skipLogs := ctx.Bool(skipLogsFlag.Name) - logDB, err := openLogDB(ctx, instanceDir) + logDB, err := openLogDB(instanceDir) if err != nil { return err } @@ -314,7 +314,7 @@ func soloAction(ctx *cli.Context) error { } defer func() { log.Info("closing main database..."); mainDB.Close() }() - if logDB, err = openLogDB(ctx, instanceDir); err != nil { + if logDB, err = openLogDB(instanceDir); err != nil { return err } defer func() { log.Info("closing log database..."); logDB.Close() }() diff --git a/cmd/thor/p2p/p2p.go b/cmd/thor/p2p/p2p.go index 96a54d83e..86f067b39 100644 --- a/cmd/thor/p2p/p2p.go +++ b/cmd/thor/p2p/p2p.go @@ -63,15 +63,14 @@ func New( opts.DiscoveryNodes = nil opts.KnownNodes = allowedPeers } else { - // boot nodes flag will overwrite the default bootstrap nodes and also disable remote bootstrap - // bootstrap nodes will be connected for discovery and for p2p protocols + // bootstrap nodes flag will overwrite the default discovery nodes and also disable remote discovery if len(bootstrapNodes) > 0 { - opts.RemoteDiscoveryList = "" // disable remote bootstrap - opts.DiscoveryNodes = bootstrapNodes // discovery nodes are unused given that known nodes are used for both node discovery and p2p protocol - opts.KnownNodes = bootstrapNodes // bootstrap nodes will be used for discovery and p2p + opts.RemoteDiscoveryList = "" // disable remote discovery + opts.DiscoveryNodes = bootstrapNodes // overwrite the default discovery nodes + opts.KnownNodes = bootstrapNodes // supplied bootstrap nodes can potentially be p2p node, add to the known nodes } - // cached peers will be appended to existing or flag-set bootnodes + // cached peers will be appended to existing or flag-set bootstrap nodes if len(cachedPeers) > 0 { opts.KnownNodes = dedupNodeSlice(opts.KnownNodes, cachedPeers) } diff --git a/cmd/thor/utils.go b/cmd/thor/utils.go index 3343cb800..36429a306 100644 --- a/cmd/thor/utils.go +++ b/cmd/thor/utils.go @@ -352,7 +352,7 @@ func suggestFDCache() int { return n } -func openLogDB(ctx *cli.Context, dir string) (*logdb.LogDB, error) { +func openLogDB(dir string) (*logdb.LogDB, error) { path := filepath.Join(dir, "logs.db") db, err := logdb.New(path) if err != nil {