This commit is contained in:
Administrator
2025-11-17 20:45:05 +01:00
parent c80fff061c
commit 7694811784
45 changed files with 917233 additions and 0 deletions

57
bin/README.md Normal file
View File

@@ -0,0 +1,57 @@
# 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)

10
bin/anvil Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Anvil should ONLY run via the mev-bot-anvil container
echo "ERROR: Do not run anvil directly!"
echo "Anvil runs as a persistent container: mev-bot-anvil"
echo ""
echo "Manage with:"
echo " podman logs mev-bot-anvil # View logs"
echo " podman restart mev-bot-anvil # Restart"
echo " podman stop mev-bot-anvil # Stop"
exit 1

3
bin/cast Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
# Wrapper to run cast via Podman exec on mev-bot-anvil container
podman exec mev-bot-anvil cast "$@" 2>&1 | grep -v "nightly build"

3
bin/forge Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
# Wrapper to run forge via Podman (with workspace volume)
podman run --rm --network host -v "$(pwd):/workspace" -w /workspace ghcr.io/foundry-rs/foundry:latest forge "$@" 2>&1 | grep -v "nightly build"

BIN
bin/mev-bot-v2 Executable file

Binary file not shown.