ethstorage/es-node

Should support `--p2p.disable`

Closed this issue · 0 comments

Rationale

Why should this feature exist?

  1. We have flag --p2p.disable documented.
  2. Too much log when peer not exist

INFO [12-27|15:55:15.911] Close connection as AddPeer fail peer=16Uiu2HAm4n64b2uQnYYD2wrFkQQVi1f1fpNozpP2Aqqws6MQhYG6
INFO [12-27|15:55:15.914] Connected to peer peer=16Uiu2HAm4n64b2uQnYYD2wrFkQQVi1f1fpNozpP2Aqqws6MQhYG6 addr=/ip4/62.72.46.81/tcp/9222
INFO [12-27|15:55:15.914] Cannot remove peer from sync duties, peer was not registered peer=16Uiu2HAm4n64b2uQnYYD2wrFkQQVi1f1fpNozpP2Aqqws6MQhYG6
INFO [12-27|15:55:15.914] Disconnected from peer peer=16Uiu2HAm4n64b2uQnYYD2wrFkQQVi1f1fpNozpP2Aqqws6MQhYG6 addr=/ip4/62.72.46.81/tcp/9222
INFO [12-27|15:55:16.174] No need this peer, the connection would be closed later peer=16Uiu2HAkym6S9pc26eLeoKkao1z4EAoKXY8ysV7n9Am4kXoWAjse shards=map[0xb4B46bdAA835F8E4b4d8e208B6559cD267851051:[0]]

What are the use-cases?

Test mining, etc.

Implementation

Do you have ideas regarding the implementation of this feature?

Use flag --p2p.disable in run.sh

Are you willing to implement this feature?

We have the flag in doc, but use it causes panic:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x100ee812f]

goroutine 1 [running]:
github.com/ethstorage/go-ethstorage/ethstorage/p2p.(*NodeP2P).Start(...)
        /Users/dl/code/es-node/ethstorage/p2p/node.go:241
github.com/ethstorage/go-ethstorage/ethstorage/node.(*EsNode).Start(0xc0008e6480, {0x1014b4f2b?, 0x1?}, 0xc000302900?)
        /Users/dl/code/es-node/ethstorage/node/node.go:255 +0x10f
main.EsNodeMain(0xc0005d14a0?)
        /Users/dl/code/es-node/cmd/es-node/main.go:128 +0x4e8
github.com/urfave/cli.HandleAction({0x1010c75c0?, 0x101be8920?}, 0xc0005d3dc0?)
        /Users/dl/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:524 +0x50
github.com/urfave/cli.(*App).Run(0xc0005d3dc0, {0xc000002300, 0x17, 0x18})
        /Users/dl/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:286 +0x7bb
main.main()
        /Users/dl/code/es-node/cmd/es-node/main.go:101 +0x599