Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_rustchain-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_rustchain-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

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

Hashes for langchain_rustchain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 16dcb478c0f590a05464fc79a82f0cd1fd711e1cdd682265d9b93e81d1bb1c38
MD5 7638075506392d677e698a4f10e115cf
BLAKE2b-256 dfe66d917fabf59387e5f176a8f016c74cfa532a820dd59cc229fd0d6277f247

See more details on using hashes here.

File details

Details for the file langchain_rustchain-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_rustchain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 074df07ad57fbc9c93b2221945eeb87117d480a6813857e0bbfb28006e617d7c
MD5 aed3423b5cc5e6c258315a7583e44d6b
BLAKE2b-256 d4673624c658fd322b5db7c6afeaa012446a7d5bc7a5e463b55dec0cf48c3792

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page