.PHONY: proto run clean setup venv test

# Generate Python code from proto files
proto:
	python -m grpc_tools.protoc \
		-I./proto \
		--python_out=. \
		--grpc_python_out=. \
		proto/remote_sc.proto

# Create virtual environment and install dependencies
setup: venv
	. venv/bin/activate && pip install -r requirements.txt

# Create virtual environment
venv:
	python3 -m venv venv

# Run the smart contract
run:
	python main.py --config config.yaml

# Clean generated files
clean:
	rm -f *_pb2.py *_pb2_grpc.py
	rm -rf __pycache__
	rm -rf venv

# Run tests
test:
	python -m pytest tests/ -v

# Install dependencies (without venv)
deps:
	pip install -r requirements.txt

# Format code
format:
	black .
	isort .
