1/5
## Working with Anvil After installing Anvil, we can run it from the terminal. ```bash anvil --version ``` We will get an output similar to this: ``` anvil 0.2.0 (31c2400 2024-11-14T00:20:56.057504000Z) ``` Next, we can run the following command: ```bash anvil ``` And we will see the output of a running fake Ethereum blockchain node. We can leave the Anvil instance running in the terminal. Let�s create a new terminal and work inside of it instead of the first one. We will copy the link that Anvil gives us and replace our Tenderly endpoint. We will change this: ```python w3 = Web3(Web3.HTTPProvider('https://virtual.sepolia.rpc.tenderly.co/055b353c-fac-4506-8a8e-6496278f0c86')) ``` To this: ```python w3 = Web3(Web3.HTTPProvider('http://127.0.0.1:8545')) ``` Next, we will run the following command: ```bash python deploy_favorites.py ``` And we will see the output. To turn off the Anvil instance we can use **Control + C** to kill the terminal. We can also kill the terminal by closing the window.
A practical guide to using Anvil for testing your smart contracts - The lesson demonstrates how to run an Anvil instance for testing a Vyper smart contract. It covers the basics of interacting with the Anvil node, including connecting to it from your VS code and understanding its output.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Python basics
Introduction to Web3.py
Introduction to Titanoboa
Introduction to Moccasin
How to create an ERC-20
How to test Python code and Vyper smart contract
How to deploy Vyper smart contracts on ZKsync using Moccasin
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on April 21, 2025
Duration: 2h 20min
Duration: 1h 51min
Duration: 58min
Duration: 2h 23min
Duration: 53min
Duration: 2h 24min
Duration: 28min
Duration: 1h 54min
Duration: 11min
Course Overview
About the course
Python basics
Introduction to Web3.py
Introduction to Titanoboa
Introduction to Moccasin
How to create an ERC-20
How to test Python code and Vyper smart contract
How to deploy Vyper smart contracts on ZKsync using Moccasin
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on April 21, 2025
Testimonials
Read what our students have to say about this course.
Chainlink
Chainlink
Gustavo Gonzalez
Solutions Engineer at OpenZeppelin
Francesco Andreoli
Lead Devrel at Metamask
Albert Hu
DeForm Founding Engineer
Radek
Senior Developer Advocate at Ceramic
Boidushya
WalletConnect
Idris
Developer Relations Engineer at Axelar