my-homelab-configs/labs/blockchain
juvdiaz c4865f17c7 Add blockchain security playground 2026-06-29 19:19:57 -06:00
..
script Add blockchain smart contract lab 2026-06-29 19:15:09 -06:00
src Add blockchain security playground 2026-06-29 19:19:57 -06:00
test Add blockchain security playground 2026-06-29 19:19:57 -06:00
README.md Add blockchain security playground 2026-06-29 19:19:57 -06:00
SECURITY_LAB.md Add blockchain security playground 2026-06-29 19:19:57 -06:00
WALLET_LAB.md Add blockchain wallet signing lab 2026-06-29 19:18:45 -06:00
foundry.toml Add blockchain smart contract lab 2026-06-29 19:15:09 -06:00

README.md

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

labs/blockchain/
  foundry.toml
  src/
  test/
  script/

Test

./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:

./jeannie blockchain-devnet up

Deploy using one of Anvil's generated dev private keys:

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:

./jeannie blockchain-test test/security/Reentrancy.t.sol -vv