mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-10 14:26:26 +00:00
Remove temp debugging code; Quit if you fail to connect to the network
This commit is contained in:
parent
31baa77742
commit
69f3095fac
@ -196,14 +196,20 @@ else:
|
||||
|
||||
proc connectToNetwork*(node: Eth2Node, bootstrapNodes: seq[PeerInfo]) {.async.} =
|
||||
# TODO: perhaps we should do these in parallel
|
||||
var connected = false
|
||||
for bootstrapNode in bootstrapNodes:
|
||||
try:
|
||||
await node.daemon.connect(bootstrapNode.peer, bootstrapNode.addresses)
|
||||
let peer = node.getPeer(bootstrapNode.peer)
|
||||
await initializeConnection(peer)
|
||||
connected = true
|
||||
except PeerDisconnected:
|
||||
error "Failed to connect to bootstrap node", node = bootstrapNode
|
||||
|
||||
if connected == false:
|
||||
fatal "Failed to connect to any bootstrap node. Quitting."
|
||||
quit 1
|
||||
|
||||
proc saveConnectionAddressFile*(node: Eth2Node, filename: string) =
|
||||
let id = waitFor node.daemon.identity()
|
||||
Json.saveFile(filename, id, pretty = false)
|
||||
|
@ -504,9 +504,7 @@ proc p2pProtocolBackendImpl*(p: P2PProtocol): Backend =
|
||||
`streamVar`: `P2PStream`) {.async, gcsafe.} =
|
||||
let `peerVar` = peerFromStream(`daemonVar`, `streamVar`)
|
||||
try:
|
||||
debug "INCOMING CONNECTION", `peerVar`
|
||||
`await` `handshakeProcName`(`peerVar`, `streamVar`)
|
||||
debug "HANDSHAKE COMPLETED", `peerVar`
|
||||
except SerializationError as err:
|
||||
debug "Failed to decode message",
|
||||
err = err.formatMsg("<msg>"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user