|
|
|
@ -25,6 +25,7 @@ import ( |
|
|
|
|
"github.com/ethereum/go-ethereum/cmd/devp2p/internal/v4test" |
|
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
|
"github.com/ethereum/go-ethereum/crypto" |
|
|
|
|
"github.com/ethereum/go-ethereum/internal/flags" |
|
|
|
|
"github.com/ethereum/go-ethereum/p2p/discover" |
|
|
|
|
"github.com/ethereum/go-ethereum/p2p/enode" |
|
|
|
|
"github.com/ethereum/go-ethereum/params" |
|
|
|
@ -49,32 +50,34 @@ var ( |
|
|
|
|
Usage: "Sends ping to a node", |
|
|
|
|
Action: discv4Ping, |
|
|
|
|
ArgsUsage: "<node>", |
|
|
|
|
Flags: v4NodeFlags, |
|
|
|
|
} |
|
|
|
|
discv4RequestRecordCommand = &cli.Command{ |
|
|
|
|
Name: "requestenr", |
|
|
|
|
Usage: "Requests a node record using EIP-868 enrRequest", |
|
|
|
|
Action: discv4RequestRecord, |
|
|
|
|
ArgsUsage: "<node>", |
|
|
|
|
Flags: v4NodeFlags, |
|
|
|
|
} |
|
|
|
|
discv4ResolveCommand = &cli.Command{ |
|
|
|
|
Name: "resolve", |
|
|
|
|
Usage: "Finds a node in the DHT", |
|
|
|
|
Action: discv4Resolve, |
|
|
|
|
ArgsUsage: "<node>", |
|
|
|
|
Flags: []cli.Flag{bootnodesFlag}, |
|
|
|
|
Flags: v4NodeFlags, |
|
|
|
|
} |
|
|
|
|
discv4ResolveJSONCommand = &cli.Command{ |
|
|
|
|
Name: "resolve-json", |
|
|
|
|
Usage: "Re-resolves nodes in a nodes.json file", |
|
|
|
|
Action: discv4ResolveJSON, |
|
|
|
|
Flags: []cli.Flag{bootnodesFlag}, |
|
|
|
|
Flags: v4NodeFlags, |
|
|
|
|
ArgsUsage: "<nodes.json file>", |
|
|
|
|
} |
|
|
|
|
discv4CrawlCommand = &cli.Command{ |
|
|
|
|
Name: "crawl", |
|
|
|
|
Usage: "Updates a nodes.json file with random nodes found in the DHT", |
|
|
|
|
Action: discv4Crawl, |
|
|
|
|
Flags: []cli.Flag{bootnodesFlag, crawlTimeoutFlag}, |
|
|
|
|
Flags: flags.Merge(v4NodeFlags, []cli.Flag{crawlTimeoutFlag}), |
|
|
|
|
} |
|
|
|
|
discv4TestCommand = &cli.Command{ |
|
|
|
|
Name: "test", |
|
|
|
@ -119,6 +122,13 @@ var ( |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
var v4NodeFlags = []cli.Flag{ |
|
|
|
|
bootnodesFlag, |
|
|
|
|
nodekeyFlag, |
|
|
|
|
nodedbFlag, |
|
|
|
|
listenAddrFlag, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func discv4Ping(ctx *cli.Context) error { |
|
|
|
|
n := getNodeArg(ctx) |
|
|
|
|
disc := startV4(ctx) |
|
|
|
|