my-homelab-configs/labs/blockchain/README.md

53 lines
1.0 KiB
Markdown

# Blockchain Contract Lab
This is the local smart contract workspace for the homelab. It uses Foundry
because it is fast, test-oriented, and works well with a local Anvil devnet.
Never put real private keys, seed phrases, or funded wallet data in this repo.
## Layout
```text
labs/blockchain/
foundry.toml
src/
test/
script/
```
## Test
```bash
./jeannie blockchain-test
```
The wrapper uses a local `forge` binary when available, otherwise it runs the
Foundry Docker image with this directory mounted.
## Deploy To The Local Devnet
Start the local devnet:
```bash
./jeannie blockchain-devnet up
```
Deploy using one of Anvil's generated dev private keys:
```bash
cd labs/blockchain
PRIVATE_KEY=0x... forge script script/DeployCounter.s.sol \
--rpc-url http://127.0.0.1:8545 \
--broadcast
```
Use only Anvil dev keys. Do not paste a real wallet key into a shell.
## Security Exercises
The intentionally vulnerable examples live in `SECURITY_LAB.md`. Start with:
```bash
./jeannie blockchain-test test/security/Reentrancy.t.sol -vv
```