LangChain tools for the RustChain Proof-of-Antiquity blockchain
Project description
langchain-rustchain
LangChain tools for the RustChain 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
pip install langchain-rustchain
Quick Start
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
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_rustchain-0.1.0.tar.gz.
File metadata
- Download URL: langchain_rustchain-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16dcb478c0f590a05464fc79a82f0cd1fd711e1cdd682265d9b93e81d1bb1c38
|
|
| MD5 |
7638075506392d677e698a4f10e115cf
|
|
| BLAKE2b-256 |
dfe66d917fabf59387e5f176a8f016c74cfa532a820dd59cc229fd0d6277f247
|
File details
Details for the file langchain_rustchain-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_rustchain-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
074df07ad57fbc9c93b2221945eeb87117d480a6813857e0bbfb28006e617d7c
|
|
| MD5 |
aed3423b5cc5e6c258315a7583e44d6b
|
|
| BLAKE2b-256 |
d4673624c658fd322b5db7c6afeaa012446a7d5bc7a5e463b55dec0cf48c3792
|