Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flags: remove peerdb flag #657

Merged
merged 1 commit into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cmd/cmd_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func TestCmdFlags(t *testing.T) {
TCPAddrs: []string{"127.0.0.1:16003"},
Allowlist: "",
Denylist: "",
DBPath: "",
},
Feature: featureset.Config{
MinStatus: "stable",
Expand All @@ -97,7 +96,6 @@ func TestCmdFlags(t *testing.T) {
TCPAddrs: []string{"127.0.0.1:16003"},
Allowlist: "",
Denylist: "",
DBPath: "",
},
},
}
Expand Down
1 change: 0 additions & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func bindDataDirFlag(flags *pflag.FlagSet, dataDir *string) {
}

func bindP2PFlags(flags *pflag.FlagSet, config *p2p.Config) {
flags.StringVar(&config.DBPath, "p2p-peerdb", "", "Path to store a discv5 peer database. Empty default results in in-memory database.")
flags.StringSliceVar(&config.UDPBootnodes, "p2p-bootnodes", nil, "Comma-separated list of discv5 bootnode URLs or ENRs. Example: enode://<hex node id>@10.3.58.6:30303?discport=30301.")
flags.BoolVar(&config.BootnodeRelay, "p2p-bootnode-relay", false, "Enables using bootnodes as libp2p circuit relays. Useful if some charon nodes are not have publicly accessible.")
flags.BoolVar(&config.UDPBootManifest, "p2p-bootmanifest", false, "Enables using manifest ENRs as discv5 bootnodes. Allows skipping explicit bootnodes if key generation ceremony included correct IPs.")
Expand Down
1 change: 0 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ Flags:
--p2p-denylist string Comma-separated list of CIDR subnets for disallowing certain peer connections. Example: 192.168.0.0/16 would disallow connections to peers on your local network. The default is to accept all connections.
--p2p-external-hostname string The DNS hostname advertised by libp2p. This may be used to advertise an external DNS.
--p2p-external-ip string The IP address advertised by libp2p. This may be used to advertise an external IP.
--p2p-peerdb string Path to store a discv5 peer database. Empty default results in in-memory database.
--p2p-tcp-address strings Comma-separated list of listening TCP addresses (ip and port) for libP2P traffic. (default [127.0.0.1:16003])
--p2p-udp-address string Listening UDP address (ip and port) for discv5 discovery. (default "127.0.0.1:16004")
--simnet-beacon-mock Enables an internal mock beacon node for running a simnet.
Expand Down
2 changes: 0 additions & 2 deletions p2p/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ import (
)

type Config struct {
// DBPath defines the discv5 peer database file path.
DBPath string
// UDPBootnodes defines the discv5 boot node URLs.
UDPBootnodes []string
// UDPBootManifest enables using manifest ENRS as discv5 boot nodes.
Expand Down
3 changes: 2 additions & 1 deletion p2p/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ func NewUDPNode(config Config, ln *enode.LocalNode,

// NewLocalEnode returns a local enode and a peer DB or an error.
func NewLocalEnode(config Config, key *ecdsa.PrivateKey) (*enode.LocalNode, *enode.DB, error) {
db, err := enode.OpenDB(config.DBPath)
// Empty DB Path creates a new in-memory node database without a persistent backend
db, err := enode.OpenDB("")
if err != nil {
return nil, nil, errors.Wrap(err, "open peer db")
}
Expand Down