Read-only LangChain tools for RustChain — let any agent query the hardware-attested agent economy.
Project description
langchain-rustchain
Read-only LangChain tools for RustChain — the DePIN blockchain where mining rewards go to verified physical hardware (Proof-of-Antiquity). Drop these tools into any LangChain agent so it can answer questions about the RustChain agent economy from live, self-verifying public data.
Part of the RustChain agent stack. Already have CrewAI, Agno, AutoGen, and smolagents tools — this fills the LangChain gap.
Why
RustChain's thesis is agents need crypto, and crypto needs agents. For an agent to reason about the network — how much RTC has been paid, who's mining, is the node up — it needs tools, not a docs page. These read-only tools give it exactly that. No keys, no writes, no wallet operations — same public surfaces you can open in a browser.
Install
pip install langchain-rustchain-tools # + langchain-core for the tools
Use
from rustchain_langchain import get_rustchain_tools
tools = get_rustchain_tools() # list[BaseTool]
# bind to any LangChain chat model / agent:
# llm.bind_tools(tools) | AgentExecutor(...tools=tools) | langgraph create_react_agent(llm, tools)
Each tool returns a compact, agent-friendly summary (agents reason better on a 3-line summary than a 5 KB JSON blob):
| Tool | Answers |
|---|---|
rustchain_network_stats |
on-chain activity: transfers, RTC moved, distinct wallets |
rustchain_payouts |
total RTC paid + distinct recipients (chain-computed) |
rustchain_miners |
who's attesting, broken down by hardware architecture |
rustchain_node_health |
is the node up (ok / db_rw / version / backup age) |
rustchain_epoch |
current epoch: number, slot, enrolled miners, reward pot, supply |
rustchain_balance |
RTC balance for a wallet/miner (arg: miner_id) |
rustchain_bounties |
open RustChain bounties with RTC rewards (arg: limit) |
The framework-free RustChainClient and summarize_* helpers are also exported,
so you can use the data without LangChain.
Point it at your own node
get_rustchain_tools(base_url="https://50.28.86.131", verify=False) # self-signed dev node
Develop / test
pip install -e ".[test]"
pytest -q # no network — HTTP is mocked
Credits
The balance / bounties / epoch tools were contributed by @hektorhq
(SiliconBountyHunter) for bounty #3074
and merged here (with the balance endpoint corrected to /wallet/balance). Thank you! 🦞
License
MIT © Elyan Labs. Built for the RustChain ecosystem.
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_tools-0.2.0.tar.gz.
File metadata
- Download URL: langchain_rustchain_tools-0.2.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d529e0ef6f15a364bda899aef8898f7fb9c33d5283d6ac0d7f4be7c4632879f6
|
|
| MD5 |
186cd3a5245142b99f3fbb3a2db28baf
|
|
| BLAKE2b-256 |
e3f22336d758f7f4643b7179f00bf9781a92cf9d16c3a0ab8f25239539c82df8
|
File details
Details for the file langchain_rustchain_tools-0.2.0-py3-none-any.whl.
File metadata
- Download URL: langchain_rustchain_tools-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69d3111c4b70dfff39f7102159becd7f8057c546a0591cb30f3da92b1761f124
|
|
| MD5 |
21814997b6f5d6c5fb8f8c77edacbef2
|
|
| BLAKE2b-256 |
f71aef605659d56edcb23e52fc459cde659a02faf31af96f7d365827ee5eb5c8
|