livepeer/go-livepeer

Check if ETH node is synced on startup

开放

#1,564 创建于 2020年7月8日

 (0 条评论) (0 个反应) (0 位负责人)Go (223 个派生)auto 404
area: blockchaingood first issuehelp wanted

仓库指标

星标
 (583 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

A user may try connecting the livepeer node to an Ethereum node that is not fully synced - this can cause issues such as the code for the livepeer contracts not existing.

Describe the solution you'd like A clear and concise description of what you want to happen.

The livepeer node can use the eth_syncing RPC call on startup to check if the Ethereum node it is connected to is fully synced. If the Ethereum node is not fully synced, there are a few options:

  • Wait for the Ethereum node to be fully synced
  • Exit early and tell the user that the Ethereum node is not fully synced and to try running livepeer again when the Ethereum node is fully synced

I think something along the lines of the latter is probably better since in the former the Ethereum node could take awhile to sync.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

A user in Discord tried connecting to an Ethereum node that was not fully synced and encountered:

E0709 06:18:18.756417    3944 client.go:222] Error getting LivepeerToken address: no contract code at given address
E0709 06:18:18.758606    3944 livepeer.go:378] Failed to setup client: no contract code at given address
I0709 06:18:18.761430    3944 db.go:381] Closing DB

贡献者指南