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
418 changes: 418 additions & 0 deletions python/trustless-agent-example/README.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions python/trustless-agent-example/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
flask>=3.0.0
web3>=6.0.0
mcp>=1.0.0
pytest>=7.0.0
pytest-cov>=4.0.0
58 changes: 58 additions & 0 deletions python/trustless-agent-example/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

# EIP-8004 Trustless Agents - Run Script
# This script sets up the virtual environment and runs the trustless agents server

set -e

echo "🚀 Setting up EIP-8004 Trustless Agents Server"
echo "================================================"

# Check if Python 3 is available
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is required but not installed."
exit 1
fi

# Create virtual environment if it doesn't exist
if [ ! -d "venv" ]; then
echo "📦 Creating virtual environment..."
python3 -m venv venv
fi

# Activate virtual environment
echo "🔧 Activating virtual environment..."
source venv/bin/activate

# Install dependencies
echo "📥 Installing dependencies..."
pip install --upgrade pip
pip install -r requirements.txt

# Check if .env file exists
if [ ! -f ".env" ]; then
echo "⚠️ .env file not found. Creating from .env.example..."
cp .env.example .env
echo "⚠️ Please edit .env file and add your PRIVATE_KEY before running!"
exit 1
fi

# Load environment variables
export $(cat .env | grep -v '^#' | xargs)

# Check if PRIVATE_KEY is set
if [ -z "$PRIVATE_KEY" ] || [ "$PRIVATE_KEY" == "0xYourPrivateKeyHere" ]; then
echo "❌ PRIVATE_KEY not set in .env file. Please configure it first."
exit 1
fi

# Run tests
echo "🧪 Running tests..."
python -m pytest test_trustless_agents.py -v

# Start the server
echo "✅ Starting trustless agents server..."
echo "🌐 Frontend will be available at http://localhost:5002"
echo "📊 MCP server is running..."
echo ""
python trustless_agents.py
Loading