The bCheck() method runs a balance check on the merchant's address 10-second intervals:
- We start by setting the web3 object, which we'll use to interact with the Ethereum blockchain as shown here. Since we do not have access to MetaMask's injected web3 in this scenario, we would need to configure our web3 provider to a local or third-party Ethereum node. I have a Ganache blockchain running at localhost on the 8545 port, which is why my provider is set to http://localhost:8545. You should update the provider to any node you have access to:
bCheck(){let app = this; let amount = this.state.amount;let intervalHandle = this.intervalHandle;let intervalBalance = this.intervalBalance; this.web3 = new ...