- Web3.js: A JavaScript library for interacting with the Ethereum blockchain.
- contract.methods.setMessage(message).send({ from: accounts[0] }): Calls the smart contract’s
setMessage
function and sends a transaction to the blockchain. - contract.methods.getMessage().call(): Calls the smart contract’s
getMessage
function to retrieve the stored message.
To interact with the Ethereum network, you need to connect MetaMask to your DApp.