From 61940b2275a8f3c77d906947b2d1126bb6c3b21d Mon Sep 17 00:00:00 2001 From: zelig Date: Sun, 14 Dec 2014 19:55:52 +0000 Subject: [PATCH] adapt cmd/cli to new backend - new flag nat for nat support UPNP|PMP - new flag pmp for PMP gateway IP - add NatType to utils/cmd to get p2p.NAT from nat type string - obsolete usepnp flag - get rid of IsUpToDate and sleep in miner start - ethereum constructor takes nat type, port, maxpeer - add pubkey arg to client identity --- cmd/ethereum/flags.go | 5 +++++ cmd/utils/cmd.go | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/cmd/ethereum/flags.go b/cmd/ethereum/flags.go index 0bea737949..e709ecf50a 100644 --- a/cmd/ethereum/flags.go +++ b/cmd/ethereum/flags.go @@ -85,8 +85,13 @@ func Init() { flag.StringVar(&KeyRing, "keyring", "", "identifier for keyring to use") flag.StringVar(&KeyStore, "keystore", "db", "system to store keyrings: db|file (db)") flag.StringVar(&OutboundPort, "port", "30303", "listening port") +<<<<<<< HEAD flag.StringVar(&NatType, "nat", "", "nat support (UPNP|PMP)") flag.StringVar(&PMPGateway, "gateway", "", "PMP gateway IP") +======= + flag.StringVar(&NatType, "nat", "", "NAT support (UPNP|PMP) (none)") + flag.StringVar(&PMPGateway, "pmp", "", "Gateway IP for PMP") +>>>>>>> adapt cmd/cli to new backend flag.IntVar(&MaxPeer, "maxpeer", 10, "maximum desired peers") flag.IntVar(&RpcPort, "rpcport", 8080, "port to start json-rpc server on") flag.BoolVar(&StartRpc, "rpc", false, "start rpc server") diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index 24d5970bd6..867ef5e374 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -154,13 +154,22 @@ func NatType(natType string, gateway string) (nat p2p.NAT) { nat = p2p.UPNP() case "PMP": ip := net.ParseIP(gateway) +<<<<<<< HEAD if ip != nil { clilogger.Fatalf("bad PMP gateway '%s'", gateway) +======= + if ip == nil { + clilogger.Fatalln("cannot resolve PMP gateway IP %s", gateway) +>>>>>>> adapt cmd/cli to new backend } nat = p2p.PMP(ip) case "": default: +<<<<<<< HEAD clilogger.Fatalf("unrecognised NAT type '%s'", natType) +======= + clilogger.Fatalln("unrecognised NAT type %s", natType) +>>>>>>> adapt cmd/cli to new backend } return }