mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 21:08:10 -05:00
Make a simple json-rpc call to ensure we are connected to a real ETH1 node (#6191)
* Make a simple json-rpc call to ensure we are connected to a real node * Merge refs/heads/master into check-connection
This commit is contained in:
@@ -338,6 +338,12 @@ func (s *Service) dialETH1Nodes() (*ethclient.Client, *gethRPC.Client, error) {
|
||||
return nil, nil, err
|
||||
}
|
||||
httpClient := ethclient.NewClient(httpRPCClient)
|
||||
|
||||
// Make a simple call to ensure we are actually connected to a working node.
|
||||
if _, err := httpClient.ChainID(s.ctx); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
return httpClient, httpRPCClient, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user