|
@@ -7,17 +7,32 @@ import (
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
var onePeerCommand = cli.Command{
|
|
var onePeerCommand = cli.Command{
|
|
|
- Name: "one",
|
|
|
|
|
- Usage: "only one peer test.",
|
|
|
|
|
- Action: one,
|
|
|
|
|
- ArgsUsage: "<node>",
|
|
|
|
|
|
|
+ Name: "one",
|
|
|
|
|
+ Usage: "only one peer test.",
|
|
|
|
|
+ Action: one,
|
|
|
|
|
+ Flags: []cli.Flag {
|
|
|
|
|
+ bootnodesFlag,
|
|
|
|
|
+ },
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func one(ctx *cli.Context) {
|
|
func one(ctx *cli.Context) {
|
|
|
- node := getNodeArg(ctx)
|
|
|
|
|
|
|
+ //node := getNodeArg(ctx)
|
|
|
|
|
|
|
|
- fmt.Fprintf(os.Stdout, "Hello one peer kit, node is %v.\n", node.String())
|
|
|
|
|
|
|
+ //if err := ctx.Set("bootnodes", node.String()); err != nil {
|
|
|
|
|
+ // fmt.Fprintf(os.Stderr, err.Error())
|
|
|
|
|
+ // os.Exit(1)
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
+ fmt.Fprintf(os.Stdout, "Hello one peer kit, node is %v.\n", ctx.String(bootnodesFlag.Name))
|
|
|
|
|
|
|
|
disc := startV4(ctx)
|
|
disc := startV4(ctx)
|
|
|
defer disc.Close()
|
|
defer disc.Close()
|
|
|
|
|
+
|
|
|
|
|
+ //for {
|
|
|
|
|
+ // fmt.Println(nodes.Node().String())
|
|
|
|
|
+ //
|
|
|
|
|
+ // if !nodes.Next() {
|
|
|
|
|
+ // nodes.Close()
|
|
|
|
|
+ // }
|
|
|
|
|
+ //}
|
|
|
}
|
|
}
|