Running the Web3 dApp
Now, we have come to the last step in the exercise of our goal to launch a dApp and create a Web3 application, end to end. Let us jump right into it:
- Open your VS Code editor and locate the
index.js
file. Within this file, you’ll need to update thecontractAddress
variable to reflect the contract that we deployed in the previous section. Figure 8.12 provides an example.
Figure 8.12 – Changing the contract address in the dApp
This will ensure that the dApp will use the correct contract to call and return the expected values from the contract and complete our exercises.
- Next, let us start our dApp from the command line:
npm run dev
This command will deploy and run a dApp (web app) and the URL will be published as shown in Figure 8.13:
Figure 8.13 – Starting the dApp from the command line
Note the published URL, which is http://localhost:3000
. Open this URL in a...