src/blockchain/watcher.js
/**
     * Start watching (polling) the blockchain for new transactions
     * This runs interval that checks every x miliseconds (as set in config) for new block and if there are new events processes them
     */
Start watching (polling) the blockchain for new transactions
This runs interval that checks every x miliseconds (as set in config) for new block and if there are new events processes them
Start watching ( polling ) the blockchain for new transactions This runs interval that checks every x miliseconds ( as set in config ) for new block and if there are new events processes them
async start() {
      setLastForeignBlock(await getLastBlock(app));
      setLastHomeBlock(await getLastBlock(app, true));
      const kernelAddress = await liquidPledging.kernel();
      kernel = new Kernel(web3, kernelAddress);
      await checkDonations();
      if (subscriptions.length) this.close();
      subscribeBlockHeaders();
      subscribeLP();
      subscribeApps();
      subscribeCappedMilestones();
      subscribeVault();
      initNewEventQueue(app);
      initEventHandlerQueue(app);
      retrieveAndProcessPastEvents();
      const { pollingInterval = 5000 } = app.get('blockchain');
      setInterval(retrieveAndProcessPastEvents, pollingInterval);
    }
async start ( ) { setLastForeignBlock ( await getLastBlock ( app ) ) ; setLastHomeBlock ( await getLastBlock ( app , true ) ) ; const kernelAddress = await liquidPledging . kernel ( ) ; kernel = new Kernel ( web3 , kernelAddress ) ; await checkDonations ( ) ; if ( subscriptions . length ) this . close ( ) ; subscribeBlockHeaders ( ) ; subscribeLP ( ) ; subscribeApps ( ) ; subscribeCappedMilestones ( ) ; subscribeVault ( ) ; initNewEventQueue ( app ) ; initEventHandlerQueue ( app ) ; retrieveAndProcessPastEvents ( ) ; const { pollingInterval = 5000 } = app . get ( 'blockchain' ) ; setInterval ( retrieveAndProcessPastEvents , pollingInterval ) ; }
Start watching (polling) the blockchain for new transactions
 This runs interval that checks every x miliseconds (as set in config) for new block and if there are new events processes them
Start watching ( polling ) the blockchain for new transactions This runs interval that checks every x miliseconds ( as set in config ) for new block and if there are new events processes them
// start subscriptions // ws subscription have proven to be unreliable with Geth. Sometimes // events are removed and never re-emitted even though the tx was included // after a re-org. Thus we have moved to polling as a more robust way to process // events. We keep the subscriptions b/c this enables us to show confirmation #'s // in the UI // Start polling