cmd: separate BootnodesV5Flag from BootnodesFlag.

This commit is contained in:
Liang-Chi Hsieh 2017-03-13 08:09:40 +00:00
parent f3579f6460
commit d0e21cd8a9
3 changed files with 9 additions and 2 deletions

View file

@ -89,6 +89,7 @@ func init() {
utils.UnlockedAccountFlag, utils.UnlockedAccountFlag,
utils.PasswordFileFlag, utils.PasswordFileFlag,
utils.BootnodesFlag, utils.BootnodesFlag,
utils.BootnodesV5Flag,
utils.DataDirFlag, utils.DataDirFlag,
utils.KeyStoreDirFlag, utils.KeyStoreDirFlag,
utils.EthashCacheDirFlag, utils.EthashCacheDirFlag,

View file

@ -127,6 +127,7 @@ var AppHelpFlagGroups = []flagGroup{
Name: "NETWORKING", Name: "NETWORKING",
Flags: []cli.Flag{ Flags: []cli.Flag{
utils.BootnodesFlag, utils.BootnodesFlag,
utils.BootnodesV5Flag,
utils.ListenPortFlag, utils.ListenPortFlag,
utils.MaxPeersFlag, utils.MaxPeersFlag,
utils.MaxPendingPeersFlag, utils.MaxPendingPeersFlag,

View file

@ -365,6 +365,11 @@ var (
Usage: "Comma separated enode URLs for P2P discovery bootstrap", Usage: "Comma separated enode URLs for P2P discovery bootstrap",
Value: "", Value: "",
} }
BootnodesV5Flag = cli.StringFlag{
Name: "v5bootnodes",
Usage: "Comma separated enode URLs for experimental RLPx V5 (Topic Discovery) bootstrap",
Value: "",
}
NodeKeyFileFlag = cli.StringFlag{ NodeKeyFileFlag = cli.StringFlag{
Name: "nodekey", Name: "nodekey",
Usage: "P2P node key file", Usage: "P2P node key file",
@ -561,8 +566,8 @@ func MakeBootstrapNodes(ctx *cli.Context) []*discover.Node {
// flags, reverting to pre-configured ones if none have been specified. // flags, reverting to pre-configured ones if none have been specified.
func MakeBootstrapNodesV5(ctx *cli.Context) []*discv5.Node { func MakeBootstrapNodesV5(ctx *cli.Context) []*discv5.Node {
urls := params.DiscoveryV5Bootnodes urls := params.DiscoveryV5Bootnodes
if ctx.GlobalIsSet(BootnodesFlag.Name) { if ctx.GlobalIsSet(BootnodesV5Flag.Name) {
urls = strings.Split(ctx.GlobalString(BootnodesFlag.Name), ",") urls = strings.Split(ctx.GlobalString(BootnodesV5Flag.Name), ",")
} }
bootnodes := make([]*discv5.Node, 0, len(urls)) bootnodes := make([]*discv5.Node, 0, len(urls))