πUnderstanding the EVM provider/signer concepts
In this section you'll learn what a provider and a signer are and how to use them.
The provider
The different types of providers available in ethers:
Declare a provider using ethers:
const { ethers } = require('ethers');
// Replace the moonbeam RPC by your desired RPC provider
const provider = new ethers.providers.JsonRpcProvider(`https://moonbeam.unitedbloc.com`);
// Now you can use the provider to interact with the EVM blockchains
provider.getBlockNumber().then((blockNumber) => {
console.log('Current Block Number:', blockNumber);
});The signer
Use a signer using ethers and send a transaction:
Last updated