This directory contains examples demonstrating how to interact with a running FOC DevNet instance using the exported devnet-info.json file.
- read-devnet-info.js - JavaScript example showing how to read and use the DevNet info
- check-balances.js - JavaScript example demonstrating how to check user balances
- devnet-schema.js - Zod schema for validating DevNet info exports
- validate-schema.js - CLI tool for validating devnet-info.json against the schema
- Node.js 20+ installed
- A running FOC DevNet instance (
foc-devnet start) - npm packages:
viem,zod
-
Start the DevNet:
foc-devnet start
-
Find the devnet-info.json file:
# The file is located in the run directory cat ~/.foc-devnet/state/latest/devnet-info.json
-
Install dependencies and run examples:
cd examples npm install # Validate the schema npm run validate-schema ~/.foc-devnet/state/latest/devnet-info.json # Read DevNet info npm run read-info ~/.foc-devnet/state/latest/devnet-info.json # Check balances npm run check-balances ~/.foc-devnet/state/latest/devnet-info.json