Skip to content

Conversation

@m1ome
Copy link

@m1ome m1ome commented Jan 17, 2018

Implementing: eth_blockNumber

Returns the number of most recent block.

JSONRPC documentation link.

@m1ome m1ome changed the title Added BlockNumber to ethclient ethclient: added BlockNumber Jan 17, 2018
@karalabe
Copy link
Member

You can retrieve the latest header with ethclient.HeaderByNumber(nil, nil), from which you can just pull the block number. The ethclient API is not meant to be a Go counterpart of the RPC spec (which is quite badly designed), rather an intuitive was to interface Ethereum from Go.

@fjl
Copy link
Contributor

fjl commented Sep 10, 2020

We just added BlockNumber in #21500. It's nice to have a way to get the latest number quickly without fetching the entire header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants