Metadata-Version: 2.4
Name: langchain-rustchain
Version: 0.1.0
Summary: LangChain tools for the RustChain Proof-of-Antiquity blockchain
Project-URL: Homepage, https://github.com/Scottcjn/RustChain
Project-URL: Bounty Program, https://github.com/Scottcjn/rustchain-bounties
License-Expression: MIT
Keywords: agent,blockchain,bounty,langchain,rtc,rustchain
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: langchain-core>=0.3.0
Requires-Dist: langgraph>=0.2.0
Requires-Dist: pydantic>=2.0
Requires-Dist: requests>=2.28
Description-Content-Type: text/markdown

# langchain-rustchain

LangChain tools for the [RustChain](https://rustchain.org) Proof-of-Antiquity blockchain.

RustChain rewards vintage hardware with RTC tokens. This package gives LangChain agents
the ability to query the network, find bounties, and earn autonomously.

## Installation

```bash
pip install langchain-rustchain
```

## Quick Start

```python
from langchain_rustchain import (
    RustChainBalanceTool,
    RustChainBountyTool,
    RustChainHealthTool,
    RustChainEpochTool,
)

# Check network health
health = RustChainHealthTool()
print(health.invoke({}))
# {"version": "2.2.1-rip200", "uptime_s": 240983, "ok": true, ...}

# Search open bounties
bounties = RustChainBountyTool()
print(bounties.invoke({"limit": 5}))
# [{"number": 3074, "title": "LangChain integration", "reward": "25 RTC", ...}]

# Check wallet balance
balance = RustChainBalanceTool()
print(balance.invoke({"wallet_id": "dual-g4-125"}))

# Get current epoch
epoch = RustChainEpochTool()
print(epoch.invoke({}))
```

## Create a Full Agent

```python
from langchain_openai import ChatOpenAI
from langchain_rustchain import create_rustchain_agent

llm = ChatOpenAI(model="gpt-4o-mini")
agent = create_rustchain_agent(llm)

result = agent.invoke({
    "input": "Find me the top 3 open bounties on RustChain"
})
print(result["output"])
```

## Available Tools

| Tool | Description |
|------|-------------|
| `rustchain_health` | Check RustChain node health status (version, uptime, db status) |
| `rustchain_balance` | Query RTC token balance for any wallet |
| `rustchain_bounties` | Search open bounties on GitHub with RTC rewards |
| `rustchain_epoch` | Get current epoch info (number, miners, reward pot) |

## License

MIT

---

Built for the [RustChain Bounty Program](https://github.com/Scottcjn/rustchain-bounties)
