eth_blockNumber
Returns the number of the most recent block on the blockchain.
Parameters
NoneReturns
result (string)Request
{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}curl https://rpc.dysnomia.icu -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' package main
import (
"context"
"fmt"
"github.com/ethereum/go-ethereum/ethclient"
)
func main() {
ctx := context.Background()
client, _ := ethclient.Dial("https://rpc.dysnomia.icu")
blockNumber, _ := client.BlockNumber(ctx)
fmt.Println(blockNumber)
}Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x16b398e"
}Last updated