58 lines
1.5 KiB
Markdown
58 lines
1.5 KiB
Markdown
# Foundry Container Wrappers
|
|
|
|
All Foundry tools MUST run through Podman containers, not bare processes.
|
|
|
|
## Usage
|
|
|
|
From the `/docker/mev-beta` directory:
|
|
|
|
```bash
|
|
# Cast (RPC calls)
|
|
./bin/cast block-number --rpc-url http://localhost:8545
|
|
./bin/cast balance 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --rpc-url http://localhost:8545
|
|
|
|
# Forge (build, test, deploy)
|
|
./bin/forge build
|
|
./bin/forge test
|
|
./bin/forge script <script>
|
|
|
|
# Anvil (runs as persistent container)
|
|
# DO NOT run ./bin/anvil directly!
|
|
# Anvil runs as: mev-bot-anvil container
|
|
podman logs mev-bot-anvil # View logs
|
|
podman restart mev-bot-anvil # Restart
|
|
podman stop mev-bot-anvil # Stop
|
|
```
|
|
|
|
## Why Container-Only?
|
|
|
|
**Problems with bare processes:**
|
|
- No process isolation
|
|
- No automatic restart on failure
|
|
- No resource limits
|
|
- Manual cleanup required
|
|
- Inconsistent with infrastructure
|
|
|
|
**Container benefits:**
|
|
- Automatic restart policies
|
|
- Resource limits and quotas
|
|
- Clean shutdown and cleanup
|
|
- Integrated with container stack
|
|
- Version management through image tags
|
|
|
|
## Implementation
|
|
|
|
- `cast`: Runs ephemeral container for each command
|
|
- `forge`: Runs ephemeral container with workspace volume mount
|
|
- `anvil`: Runs as persistent container (mev-bot-anvil)
|
|
|
|
## Do NOT Use
|
|
|
|
❌ `/home/administrator/.foundry/bin/anvil`
|
|
❌ `/home/administrator/.foundry/bin/cast`
|
|
❌ `/home/administrator/.foundry/bin/forge`
|
|
|
|
✅ `/docker/mev-beta/bin/cast` (Podman wrapper)
|
|
✅ `/docker/mev-beta/bin/forge` (Podman wrapper)
|
|
✅ `podman logs mev-bot-anvil` (Container management)
|