Skip to content

feat: add langchain-rustchain — LangChain tools for RustChain API (answers #3074) [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] - #8199

Open
waterWang wants to merge 1 commit into
Scottcjn:mainfrom
waterWang:feat/langchain-rustchain-tool
Open

feat: add langchain-rustchain — LangChain tools for RustChain API (answers #3074) [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT]#8199
waterWang wants to merge 1 commit into
Scottcjn:mainfrom
waterWang:feat/langchain-rustchain-tool

Conversation

@waterWang

Copy link
Copy Markdown
Contributor

Summary

Adds a standalone langchain-rustchain Python package under integrations/langchain-rustchain/ that exposes RustChain read-only API endpoints as LangChain BaseTool subclasses.

Wallet: fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT

Tools

Tool Endpoint Description
rustchain_check_balance GET /wallet/balance?miner_id=... Check RTC balance of any wallet
rustchain_list_bounties GitHub Issues API List open ecosystem bounties (labelled "bounty")
rustchain_get_node_health GET /health Node health: DB, tip age, uptime, version
rustchain_get_current_epoch GET /epoch Current epoch, slot, enrolled miners, emission

Structure

integrations/langchain-rustchain/
├── pyproject.toml          # pip-installable package (langchain-rustchain)
├── README.md               # Quick start + docs
├── example.py              # Direct demo script (no LLM needed)
└── langchain_rustchain/
    ├── __init__.py          # Public API exports
    └── tools.py             # 4 BaseTool subclasses + get_tools() factory

Verification

All 4 tools tested against the live public node (https://rustchain.org):

  • rustchain_check_balance("test_wallet"){"balance_rtc": 0.0}
  • rustchain_list_bounties(limit=3) → 3 open bounties returned
  • rustchain_get_node_health(){"version": "2.2.1-rip200", "uptime_s": 174000+}
  • rustchain_get_current_epoch(){"epoch": 249, "slot": 35909, "enrolled_miners": 17}

Acceptance Checklist

  • pip install . works (pyproject.toml)
  • All 4 tools call live endpoints
  • No auth required for RustChain node endpoints
  • GitHub API uses optional GH_TOKEN/GITHUB_TOKEN env var (higher rate limit, no token = unauthenticated fallback)
  • example.py runs without an LLM (direct tool calls)
  • MIT licensed

Closes rustchain-bounties#3074

…eck_balance, list_bounties, node_health, current_epoch) [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT]
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Welcome to RustChain! Thanks for your first pull request.

Before we review, please make sure:

  • Non-doc PRs have a BCOS-L1 or BCOS-L2 label
  • Doc-only PRs are exempt from BCOS tier labels when they only touch docs/**, *.md, or common image/PDF files
  • New code files include an SPDX license header
  • You've tested your changes against the live node

Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150)

A maintainer will review your PR soon. Thanks for contributing!

@github-actions github-actions Bot added documentation Improvements or additions to documentation BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) labels Aug 9, 2026
@github-actions github-actions Bot added the size/L PR: 201-500 lines label Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) documentation Improvements or additions to documentation size/L PR: 201-500 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant