Data: 

Information

This is a simple demonstration of how to connect to an Ethereum smart contract using plain vanilla JavaScript with the web3.js library and no other dependencies or server side code.

To interact with it you will need the MetaMask crypto wallet browser extension installed.

There are just two functions:

  1. Read the value of some stored data
  2. Update the value of that stored data

Reading data from the blockchain is free but updating it requires computation and that incurs a gas fee.

The contract is on the Ethereum Rinkeby test network so you will need some Ether there to cover the gas fee if you want to run the update function.

Ether on the test network can be obtained free of charge from various faucets, for example Chainlink.

Information about the contract used in this demonstration can be viewed on Etherscan at its address: