Learn about Ethers.js v6 w/ example scripts.
- Javascript (Writing scripts)
- Node.js
- Ethers.js (Blockchain Interaction)
- Alchemy (Node provider)
- Tenderly (Virtual testnet)
- Install NodeJS. We recommend using the latest LTS (Long-Term-Support) version, and preferably installing NodeJS via NVM.
Note for Windows Users: We highly recommend installing and using WSL Ubuntu for building projects.
-
Create an Alchemy account, you'll need to create an app for the Ethereum chain, on the mainnet network
-
Create a Tenderly account, you'll need to create a project and a virtual testnet with the parent chain as Ethereum mainnet.
npm install
Before running any scripts, you'll want to create a .env file with the following values (see .env.example):
- ALCHEMY_API_KEY=""
- TENDERLY_RPC_URL=""
node examples/1_accounts.js
node examples/2_send_signed_transactions.js
node examples/3_read_smart_contracts.js
node examples/4_write_smart_contracts.js
node examples/5_contract_events.js