mirror of https://github.com/status-im/op-geth.git
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
This commit is contained in:
parent
e77b720ead
commit
61940b2275
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue