Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ethclient: added BlockNumber #15907

Closed
wants to merge 1 commit into from
Closed

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