concept Dapp development in category blockchain

appears as: Dapp development, Dapp development
Blockchain in Action

This is an excerpt from Manning's book Blockchain in Action.

  • Configure the web server and develop glue code connecting the UI to the smart contract layer (section 4.4).
  • App = {
      url: 'http://127.0.0.1:7545',                    #1
      
      init: function() {                               #2
        return App.initWeb3();
      },
     
      initWeb3: function() {                           #3
                                                       #3
          App.web3Provider = web3.currentProvider;     #3
       
        return App.initContract();
      },
     
      initContract: function() {                       #4
     
        
        App.contracts.vote.setProvider(App.web3Provider);
        getJSON('Ballot.json', function(data) {
       
        return App.bindEvents();
      
      },
     
      bindEvents: function() {                         #5
        $(document).on('click', '.btn-vote', App.handleVote);
        $(document).on('click', '#win-count', App.handleWinner);
        $(document).on('click', '#register', ...  App.handleRegister(ad);
        ...
      },
     
      
      populateAddress : function(){ },                 #6
                                                       #6
      getChairperson : function(){ },                  #6
     
      handleRegister: function(addr){ },               #7
                                                       #7
      handleVote: function(event){ },                  #7
                                                       #7
      handleWinner : function(){ };                    #7