tendermint/p2p
Anton Kaliaev cd3a240c9f
return an error if we fail to parse external IP
```
I[06-08|11:51:57.234] Getting UPNP external address                module=p2p
I[06-08|11:51:58.867] Got UPNP external address                    module=p2p address=
```

Fixes #1717

```
I[06-08|11:51:56.952] Starting multiAppConn                        module=proxy impl=multiAppConn
I[06-08|11:51:56.952] Starting localClient                         module=abci-client connection=query impl=localClient
I[06-08|11:51:56.952] Starting localClient                         module=abci-client connection=mempool impl=localClient
I[06-08|11:51:56.952] Starting localClient                         module=abci-client connection=consensus impl=localClient
I[06-08|11:51:56.952] ABCI Handshake                               module=consensus appHeight=0 appHash=
I[06-08|11:51:56.952] ABCI Replay Blocks                           module=consensus appHeight=0 storeHeight=0 stateHeight=0
I[06-08|11:51:57.053] Completed ABCI Handshake - Tendermint and App are synced module=consensus appHeight=0 appHash=
I[06-08|11:51:57.053] This node is a validator                     module=consensus addr=6816B5D9BAC32A3CDF07884D9D3D2650694C371D pubKey=PubKeyEd25519{27A40CD032DD2467342D0CF27C5EC92052D966FEC714B6CF2F3BF3146AFD0D51}
I[06-08|11:51:57.234] Starting Node                                module=main impl=Node
I[06-08|11:51:57.234] Starting EventBus                            module=events impl=EventBus
I[06-08|11:51:57.234] Local listener                               module=p2p ip=:: port=46656
I[06-08|11:51:57.234] Getting UPNP external address                module=p2p
I[06-08|11:51:58.867] Got UPNP external address                    module=p2p address=
I[06-08|11:51:58.867] Starting DefaultListener                     module=p2p impl=Listener(@<nil>:46656)
I[06-08|11:51:58.867] P2P Node ID                                  module=main ID=3629b516392e494ae717ac4c6a1ea7eb0fe421c3 file=/home/tpb/.tendermint/config/node_key.json
I[06-08|11:51:58.868] Add our address to book                      module=p2p book=/home/tpb/.tendermint/config/addrbook.json addr=null
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x89fb86]

goroutine 1 [running]:
github.com/tendermint/tendermint/p2p.(*NetAddress).String(0x0, 0xc96e24, 0x17)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/p2p/netaddress.go:171 +0x26
github.com/tendermint/tendermint/p2p/pex.(*addrBook).AddOurAddress(0xc420190620, 0x0)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/p2p/pex/addrbook.go:160 +0x116
github.com/tendermint/tendermint/node.(*Node).OnStart(0xc420286d00, 0xc4201b8010, 0xd)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/node/node.go:402 +0x547
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common.(*BaseService).Start(0xc420286d00, 0xe51c40, 0xc42000bd40)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/common/service.go:130 +0x3bd
github.com/tendermint/tendermint/cmd/tendermint/commands.NewRunNodeCmd.func1(0xc42022e000, 0xc4200acdc0, 0x0, 0x1, 0x0, 0x0)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/cmd/tendermint/commands/run_node.go:58 +0xfe
github.com/tendermint/tendermint/vendor/github.com/spf13/cobra.(*Command).execute(0xc42022e000, 0xc4200acda0, 0x1, 0x1, 0xc42022e000, 0xc4200acda0)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/spf13/cobra/command.go:762 +0x468
github.com/tendermint/tendermint/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x1289280, 0xbbdda0, 0xc420015e01, 0xc4201bc640)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/spf13/cobra/command.go:852 +0x30a
github.com/tendermint/tendermint/vendor/github.com/spf13/cobra.(*Command).Execute(0x1289280, 0xc4201bc640, 0xc420015e98)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/cli.Executor.Execute(0x1289280, 0xde5798, 0x2, 0xc4200332c0)
	/home/tpb/code/go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/tmlibs/cli/setup.go:89 +0x4e
main.main()
	/home/tpb/code/go/src/github.com/tendermint/tendermint/cmd/tendermint/main.go:45 +0x24d
```
2018-06-09 15:03:38 +04:00
..
conn do not drain the channel because there is no channel, duh 2018-06-05 14:57:20 +04:00
dummy Move to ne.IP 2018-05-16 19:21:12 +02:00
pex fixes from review 2018-06-06 20:45:20 -07:00
trust fixes from Jae's review 2018-02-12 14:32:09 +04:00
upnp return an error if we fail to parse external IP 2018-06-09 15:03:38 +04:00
README.md docs: use absolute links (#1617) 2018-05-23 10:01:32 -04:00
base_reactor.go Fix lint errors (#1390) 2018-04-02 10:21:17 +02:00
errors.go Move to ne.IP 2018-05-16 19:21:12 +02:00
fuzz.go Collapse PeerConfig into P2PConfig 2018-06-05 02:07:56 +02:00
key.go improve `show_node_id` (#1433) 2018-04-10 16:03:51 +02:00
key_test.go p2p: tmconn->conn and types->p2p 2018-01-21 00:34:41 -05:00
listener.go require addresses to have an ID by default 2018-04-05 11:55:29 +02:00
listener_test.go linting errors: tackle p2p package 2017-11-27 22:39:11 +00:00
netaddress.go some comments 2018-04-28 15:19:33 -04:00
netaddress_test.go require addresses to have an ID by default 2018-04-05 11:55:29 +02:00
node_info.go Expose peer stats for dump_consensus_state 2018-05-10 22:43:21 -07:00
peer.go Fix race when mutating MConnConfig 2018-06-07 01:09:13 +02:00
peer_set.go Introduce option to skip duplicate ip check 2018-05-30 10:40:22 +02:00
peer_set_test.go Introduce option to skip duplicate ip check 2018-05-30 10:40:22 +02:00
peer_test.go Fix race when mutating MConnConfig 2018-06-07 01:09:13 +02:00
switch.go Fix race when mutating MConnConfig 2018-06-07 01:09:13 +02:00
switch_test.go Collapse PeerConfig into P2PConfig 2018-06-05 02:07:56 +02:00
test_util.go Collapse PeerConfig into P2PConfig 2018-06-05 02:07:56 +02:00
types.go p2p: tmconn->conn and types->p2p 2018-01-21 00:34:41 -05:00
version.go move into p2p package 2017-04-21 18:07:52 -04:00
wire.go P2P now works with Amino 2018-03-26 06:40:02 +02:00

README.md

p2p

The p2p package provides an abstraction around peer-to-peer communication.

Docs:

  • Connection for details on how connections and multiplexing work
  • Peer for details on peer ID, handshakes, and peer exchange
  • Node for details about different types of nodes and how they should work
  • Pex for details on peer discovery and exchange
  • Config for details on some config option