Ethereum Scripts Curriculum
A collection of scripts, using EthersJS, to help you learn the foundations of Ethereum.
Run the scripts in order and check the code and all the in-code comments.
Requires NodeJS > 14.
How to use
- Clone the repo
git clone https://github.com/carletex/ethereum-scripts-curriculum.git
- Install dependencies
cd ethereum-scripts-curriculum
yarn install
# You can also use npm install
- Run cli UI (which will show the scripts sorted)
node index.js
You can also run the scripts independently with node src/scriptName.js
.
Script list
-
getProvider.js: Connects to a provider and shows the latest mined Mainnet block.
-
createWallet.js: Creates a mnemonic file.
-
loadWallet.js: Derives the wallet addresses using the mnemonic file.
-
ensLookup.js: Get the address for a given ENS (Ethereum Name Service) and vice versa.
-
getBalance.js: Get the ETH Balance for an address.
-
getSigner.js: Get a signer and connect it to a provider.
-
sendEth.js: Send ETH between accounts on the Rinkeby Testnet.
-
readContract.js: Call a read-only function of a contract.
-
readContractEvents.js: Read the latest events from a contract.
-
signAndVerify.js: Sign a message and verify its authenticity.
-
encryptAndDecrypt.js: Encrypt a message with someones public key, and decrypt it using their private key.