code: func setNodeKey(ctx *cli.Context, cfg *p2p.Config) {
  	var (
  		hex  = ctx.GlobalString(NodeKeyHexFlag.Name)
  		file = ctx.GlobalString(NodeKeyFileFlag.Name)
  		key  *ecdsa.PrivateKey
  		err  error
  	)
  	switch {
  	case file != "" && hex != "":
  		Fatalf("Options %q and %q are mutually exclusive", NodeKeyFileFlag.Name, NodeKeyHexFlag.Name)
  	case file != "":
  		if key, err = crypto.LoadECDSA(file); err != nil {
  			Fatalf("Option %q: %v", NodeKeyFileFlag.Name, err)
  		}
  		cfg.PrivateKey = key
  	case hex != "":
  		if key, err = crypto.HexToECDSA(hex); err != nil {
  			Fatalf("Option %q: %v", NodeKeyHexFlag.Name, err)
  		}
  		cfg.PrivateKey = key
  	}
  }
docs: // setNodeKey creates a node key from set command line flags, either loading it
  // from a file or as a specified hex value. If neither flags were provided, this
  // method returns nil and an emphemeral key is to be generated.