Track 6 · dApps & frontend · lesson 7
Leaving the browser
15 min
You have written and tested real contracts for two whole tracks without installing anything. That was deliberate. Now, once, you step onto your own machine — and almost nothing you know changes.
This lesson exists because the usual Web3 course structure loses people right here. Forty lessons of frictionless browser work, then "install this, configure that, get an API key, fund a wallet" — and a good fraction never come back.
So we are going to do the install carefully, map every new tool onto something you already understand, and change nothing about how you think. The only genuinely new thing is that the code now lives in files on your computer.
Everything you know, relocated
| In the Forge | On your machine | Same idea |
|---|---|---|
| The Run button | forge test | compile, deploy, run tests |
| The in-browser chain | anvil | a local EVM with funded accounts |
| The hidden tests | .t.sol test files | assertions against your contract |
| Deploy + call | a deploy script | the same transactions, from a terminal |
| viem in the tests | viem or cast | the same library, same functions |
Nothing in the left column disappears. It just moves into a project folder and gets a command instead of a button.
The one install
The tool is Foundry — the standard Solidity toolchain. One command installs it on macOS and Linux:
curl -L https://foundry.up.sh | bash
foundryup
On Windows, use WSL and run the same commands inside it. Then verify:
forge --version
If that prints a version, you are done. That is the whole setup, and the rest of this track builds on it.
Predict
`forge test` fails with 'command not found'. What is almost certainly wrong?
Why bother leaving at all
The browser Forge is perfect for learning and useless for shipping. To deploy to a real network, run against forked mainnet state, integrate a frontend, or collaborate in git, the code has to live in files. Foundry is how the professional world does all of that.
The next lessons take the exact piggy bank you already wrote and run its tests locally — same contract, same results, new location.
Check
`forge test` maps onto which part of your Forge experience?
Worth remembering
- Leaving the browser changes where code lives, not how you think about it.
- forge test = the Run button; anvil = the in-browser chain; .t.sol files = the hidden tests.
- Foundry installs in one command (WSL on Windows); `forge --version` confirms it.
- A 'command not found' is an environment problem, never a bug in your contract.
- You leave the browser to deploy, fork mainnet, integrate a frontend, and use git.