Created a very simple Meteor app to display the current block number using ethereum:block.

Problem: Even though the current block number is displayed when the page loads, it does not update both on the page and when running EthBlocks.latest.number

The valaue of EthBlock.latest.number updates only when the page is refreshed.

Shouldnt the variable EthBlocks.latest.number updates whenever geth detects a new block?



  {{> currentBlock}}

<template name="currentBlock">
  <h1>Current Block</h1>
  <p> {{ currentBlock }} </p>


    import { Template } from 'meteor/templating';
    import { ReactiveVar } from 'meteor/reactive-var';

    import './currentBlock.html';

    Template.currentBlock.onCreated(function helloOnCreated() {

      currentBlock() {
        return EthBlocks.latest.number;


if (typeof web3 == 'undefined')
    web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));

Geth is started using

geth --rpc --rpccorsdomain "http://localhost:3000"
  • does it work if you refresh your browser?
    – thefett
    Oct 14 '17 at 18:18
  • @thefett Yes it does update when I refresh the browser.
    – Nyxynyx
    Oct 14 '17 at 18:31

I think this answers your question: Automatically update account balance with web3.js without polling

To summarize, unfortunately an intuitive system that just has things update isn't quite there yet, but you can use filters to listen for a new block

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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