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
47 changes: 47 additions & 0 deletions pyproject-crewai.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "rustchain-crewai"
version = "0.1.0"
description = "Native RustChain tools for CrewAI agents - check balances, list bounties, query node state, and interact with BoTTube and Beacon."
readme = "README.md"
license = "MIT"
requires-python = ">=3.10"
authors = [
{ name = "Gautam Kumar", email = "gautamkumarofficial@users.noreply.github.com" },
]
keywords = ["crewai", "rustchain", "bottube", "beacon", "blockchain", "ai-agents", "rtc", "agent-tools"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries",
]
dependencies = [
"crewai>=0.28",
"requests>=2.28",
"pydantic>=1.10",
]

[project.optional-dependencies]
dev = [
"pytest>=7.0",
"pytest-cov>=4.0",
]

[project.urls]
Homepage = "https://rustchain.org"
Repository = "https://github.com/Scottcjn/rustchain-mcp"
Documentation = "https://rustchain.org/docs"
"Bug Tracker" = "https://github.com/Scottcjn/rustchain-mcp/issues"

[tool.hatch.build.targets.wheel]
packages = ["rustchain_crewai"]

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
115 changes: 115 additions & 0 deletions rustchain_crewai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# RustChain CrewAI Tools

Native RustChain tools for [CrewAI](https://github.com/crewAIInc/crewAI) agents.

## Installation

```bash
pip install crewai requests
```

## Available Tools

| Tool | Description |
|------|-------------|
| `RustChainCheckBalance` | Check RTC token balance for a wallet |
| `RustChainListBounties` | List available bounties for earning RTC |
| `RustChainGetNodeHealth` | Check RustChain node health status |
| `RustChainGetCurrentEpoch` | Get current epoch information |
| `RustChainGetMiners` | List active miners with hardware types |
| `RustChainBoTTubeSearch` | Search BoTTube AI video platform |
| `RustChainBoTTubeStats` | Get BoTTube platform statistics |
| `RustChainBeaconDiscover` | Discover AI agents on Beacon network |
| `RustChainBeaconNetworkStats` | Get Beacon network statistics |
| `RustChainBeaconChat` | Chat with native Beacon agents |

## Usage

```python
from crewai import Agent, Task, Crew
from rustchain_crewai import (
RustChainCheckBalance,
RustChainListBounties,
RustChainGetNodeHealth,
RustChainGetCurrentEpoch,
)

# Create an agent with RustChain tools
analyst = Agent(
role="Blockchain Analyst",
goal="Analyze RustChain blockchain data and provide insights",
tools=[
RustChainCheckBalance(),
RustChainListBounties(),
RustChainGetNodeHealth(),
RustChainGetCurrentEpoch(),
],
verbose=True,
)

# Create a task
task = Task(
description="Check the current RustChain node health and epoch information",
agent=analyst,
)

# Run the crew
crew = Crew(agents=[analyst], tasks=[task])
result = crew.kickoff()
print(result)
```

## Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `RUSTCHAIN_NODE` | `https://50.28.86.131` | RustChain node URL |
| `BOTTUBE_URL` | `https://bottube.ai` | BoTTube platform URL |
| `BEACON_URL` | `https://rustchain.org/beacon` | Beacon network URL |
| `TLS_VERIFY` | `0` | Set to `1` to verify TLS certificates |

## API Reference

### RustChainCheckBalance

Check RTC token balance for a RustChain wallet.

```python
tool = RustChainCheckBalance()
result = tool._run(wallet_id="dual-g4-125")
# Output: "Wallet dual-g4-125: 100.5 RTC ($10.05 USD reference)"
```

### RustChainListBounties

List available RustChain bounties for earning RTC tokens.

```python
tool = RustChainListBounties()
result = tool._run()
# Output: Bounty program information
```

### RustChainGetNodeHealth

Check RustChain node health status.

```python
tool = RustChainGetNodeHealth()
result = tool._run()
# Output: "RustChain Node: Healthy\nVersion: 1.0.0\n..."
```

### RustChainGetCurrentEpoch

Get current RustChain epoch information.

```python
tool = RustChainGetCurrentEpoch()
result = tool._run()
# Output: "Epoch: 42\nSlot: 1234\n..."
```

## License

MIT License - see [LICENSE](../LICENSE) for details.
Loading