Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**foc-devnet** is a Rust CLI tool for managing local Filecoin networks with FOC (Filecoin Onchain Contracts) support for warm storage services. It orchestrates Docker containers running Lotus nodes, miners, databases, and deploys smart contracts using Foundry (Forge/Cast).

**Key Technologies**: Rust, Docker, Filecoin Lotus, FEVM (Filecoin EVM), Foundry, YugabyteDB, Solidity
**Key Technologies**: Rust, Docker, Filecoin Lotus, FEVM (Filecoin EVM), Foundry, PostgreSQL, ScyllaDB, Solidity

## Architecture Patterns

Expand Down Expand Up @@ -36,7 +36,7 @@ Steps execute in this strict order (see `src/commands/start/mod.rs`):
2. **Lotus** - Start Filecoin daemon with FEVM enabled
3. **Lotus-Miner** - Start first-generation block producer
4. **FOC Deploy** - Deploy MockUSDFC token and FOC warm storage contracts
5. **Yugabyte** - Start database for Curio
5. **Databases** - Start Postgres + Scylla for Curio
6. **Curio** - Start second-generation miner (commented out, WIP)

**Critical**: Each step depends on previous steps being healthy. DO NOT reorder.
Expand All @@ -47,7 +47,7 @@ Steps execute in this strict order (see `src/commands/start/mod.rs`):
foc-lotus # Lotus daemon (ports 1234 API, 1235 P2P)
foc-lotus-miner # First-gen miner (port 2345)
foc-builder # Foundry tools (--network host)
foc-yugabyte # Database for Curio (port 5433)
postgres / scylla # Databases for Curio (stock images, dynamic ports)
foc-curio # Second-gen miner (WIP)
```

Expand All @@ -71,7 +71,6 @@ All persistent data lives under `~/.foc-devnet/` (see `src/paths.rs`):
│ ├── genesis/ # Genesis block config
│ ├── genesis-sectors/ # Pre-sealed sectors
│ ├── lotus-keys/ # BLS signing keys
│ ├── yugabyte-data/ # Database data
│ └── foc-contract-addresses.json # Deployed contract addresses
├── logs/ # Container logs
├── repos/
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/ci_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ jobs:
echo "docker-hash=$DOCKER_HASH" >> $GITHUB_OUTPUT
echo "DOCKER_HASH: $DOCKER_HASH"

# CACHE-DOCKER: Try to restore pre-built Docker images (foc-lotus, foc-lotus-miner, foc-builder, foc-curio, foc-yugabyte)
# These images contain YugabyteDB and all build dependencies
# CACHE-DOCKER: Try to restore pre-built Docker images (foc-lotus, foc-lotus-miner, foc-builder, foc-curio)
- name: "CACHE_RESTORE: {C-docker-images-cache}"
id: cache-docker-images
uses: actions/cache/restore@v4
Expand All @@ -168,15 +167,14 @@ jobs:
rm -rf ~/.docker-images-cache
df -h

# If Docker images are cached, skip building them AND skip downloading YugabyteDB
# (YugabyteDB is already baked into the foc-yugabyte Docker image)
# If Docker images are cached, skip building them
- name: "EXEC: {Initialize with cached Docker}, DEP: {C-docker-images-cache}"
if: steps.cache-docker-images.outputs.cache-hit == 'true'
run: |
./foc-devnet clean --all
./foc-devnet init --no-docker-build ${{ inputs.init_flags }}

# If Docker images are not cached, do full init (downloads YugabyteDB and builds all images)
# If Docker images are not cached, do full init (builds all images)
- name: "EXEC: {Initialize without cache}, independent"
if: steps.cache-docker-images.outputs.cache-hit != 'true'
run: |
Expand All @@ -193,7 +191,6 @@ jobs:
docker save foc-lotus-miner -o ~/.docker-images-cache/foc-lotus-miner.tar
docker save foc-builder -o ~/.docker-images-cache/foc-builder.tar
docker save foc-curio -o ~/.docker-images-cache/foc-curio.tar
docker save foc-yugabyte -o ~/.docker-images-cache/foc-yugabyte.tar
echo "Docker images saved to cache"
ls -lath ~/.docker-images-cache/
df -h
Expand Down Expand Up @@ -403,7 +400,7 @@ jobs:
echo "Warning: could not resolve numeric job ID (GITHUB_JOB=$GITHUB_JOB)"
fi

# Setup scenario test prerequisites (Foundry, Python 3.11 via pyenv, cqlsh)
# Setup scenario test prerequisites (Foundry; CQL queries use the Scylla container's bundled cqlsh)
- name: "EXEC: {Setup scenario prerequisites}, independent"
if: steps.start_cluster.outcome == 'success'
run: ./scripts/setup-scenarios-prerequisites.sh
Expand Down
Loading
Loading