SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async function main() {
  2.   const lastBlock = await web3.eth.getBlockNumber()
  3.   result = []
  4.  
  5.   for (let i = lastBlock; i >= lastBlock - 10; i--) {
  6.     let block = await web3.eth.getBlock(i)
  7.     let blockRes = {}
  8.     blockRes.number = i
  9.     blockRes.miner = {}
  10.     blockRes.miner.address = block.miner
  11.     blockRes.miner.balance = await web3.eth.getBalance(block.miner)
  12.     result.push(blockRes)
  13.   }
  14.   console.log(result);
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top