0

How to reliably find the validator address of a block? Relay API has gaps wherein some blocks are missing.

Is there any other reliable way to get the validator address?

1 Answer 1

0

You can see the address to which the rewards for the offered block have been sent

const { Web3 } = require('web3').   // "web3": "^4.2.1"
const { isAddress } = require('web3-validator')
const web3 = new Web3("https://virginia.rpc.blxrbdn.com")

async function GetLastNBlocks(n) {
    latestBlock = await web3.eth.getBlockNumber() - BigInt(1)
    web3.eth.getBlock(latestBlock).then((data, err) => {
        // console.log(latestBlock, "data:", data)
        console.log(data.miner, isAddress(data.miner)) // data.miner
    })
}
GetLastBlocks()

You can see the block validator in the browser https://beaconcha.in/block/18475010 -> Proposer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.