区块链查询服务

Hermes区块链预言机是一个MCP服务器插件,为Hermes Agent提供Solana区块链的实时数据查询功能,包括钱包信息、交易详情、NFT资产和网络状态等。

  • by gizdusum
  • Python
  • 本地部署
  • 6 星标
  • 更新于
在 GitHub 查看 gizdusum/hermes-blockchain-oracle

使用说明

    ╦ ╦╔═╗╦═╗╔╦╗╔═╗╔═╗
    ╠═╣║╣ ╠╦╝║║║║╣ ╚═╗
    ╩ ╩╚═╝╩╚═╩ ╩╚═╝╚═╝
    ╔╗ ╦  ╔═╗╔═╗╦╔═╔═╗╦ ╦╔═╗╦╔╗╔
    ╠╩╗║  ║ ║║  ╠╩╗║  ╠═╣╠═╣║║║║
    ╚═╝╩═╝╚═╝╚═╝╩ ╩╚═╝╩ ╩╩ ╩╩╝╚╝
    ╔═╗╦═╗╔═╗╔═╗╦  ╔═╗
    ║ ║╠╦╝╠═╣║  ║  ║╣
    ╚═╝╩╚═╩ ╩╚═╝╩═╝╚═╝

🔮 Hermes区块链Oracle

赋予Hermes Agent在Solana区块链上的超能力


连接的模型上下文协议(MCP)服务器 爱马仕代理商 Solana区块链——支持钱包、代币、NFT、交易、鲸鱼运动和网络健康的自然语言查询。


🌟 这是什么?

Hermes区块链Oracle 是MCP服务器插件 爱马仕代理商 通过 Nous研究它充当了对话式人工智能和Solana区块链之间的桥梁,让你用简单的英语提问,并获得丰富的实时链上数据。

不再将钱包地址复制粘贴到区块浏览器中。不再解码原始事务日志。就 问赫尔墨斯.

“SOL平衡是什么 7xKXtg...?" → 赫尔墨斯知道。

“现在有鲸鱼活动吗?” → 赫尔墨斯在看。

“给我看看这个钱包里的NFT。” → 赫尔墨斯送货上门。


⚡ 特性

工具 说明
🏦 solana_wallet_info 查询任何钱包的SOL余额、代币持有量和投资组合价值
🔍 solana_transaction 通过签名查找完整的交易详细信息——说明、费用、状态
🪙 solana_token_info 获取令牌元数据、总/循环供应量、小数和持有者计数
📜 solana_recent_activity 使用人类可读的摘要获取任何钱包的最近交易
🎨 solana_nft_portfolio 列出钱包中的所有NFT——集合、底价和元数据
🐋 whale_detector 实时检测Solana上的大额转账——可配置阈值
📊 solana_network_stats 获取当前Solana网络运行状况、TPS、插槽高度和纪元信息

🚀 快速开始

1.安装

pip install hermes-blockchain-oracle

或者从源代码安装:

git clone https://github.com/NousResearch/hermes-blockchain-oracle.git
cd hermes-blockchain-oracle
pip install -e .

2.配置(可选)

设置您首选的Solana RPC端点以获得最佳性能:

export SOLANA_RPC_URL="https://api.mainnet-beta.solana.com"

💡 提示: 对于生产使用,可以考虑使用专用的RPC提供程序,如 赫利乌斯, QuickNode,或 特里同 以获得更高的速率限制和可靠性。

3.与Hermes代理商合作发布

hermes-agent --mcp blockchain=hermes-blockchain-oracle

就是这样。Hermes Agent现在完全了解Solana区块链。 🧠⛓️


💬 用法示例

一旦神谕连接,只需自然地与赫尔墨斯交谈:

🏦 钱包查询

You: "Check the SOL balance of GsBd49...2kMp"
Hermes: That wallet holds 1,247.83 SOL (~$285,000 USD) along with 
        12 token holdings including 50,000 BONK and 2.4 JTO...

🔍 交易调查

You: "What happened in transaction 4sGjMW...x9Qv?"
Hermes: This transaction was a token swap on Jupiter Aggregator.
        2.5 SOL was swapped for 125,000 BONK. Fee: 0.000005 SOL.
        Status: Confirmed (finalized). Block: 248,391,042.

🐋 鲸鱼检测

You: "Are there any whale movements happening right now?"
Hermes: 🐋 Alert! Detected 3 large transfers in the last 10 minutes:
        • 50,000 SOL moved from Binance hot wallet → unknown wallet
        • 2.1M USDC transferred between two whale wallets
        • 180,000 JTO unstaked and moved to a fresh address

🎨 NFT投资组合

You: "Show me what NFTs are in wallet Fxn7...kL9m"
Hermes: That wallet contains 23 NFTs across 5 collections:
        • Mad Lads (3) — Floor: 85 SOL
        • Tensorians (7) — Floor: 12 SOL
        • Claynosaurz (2) — Floor: 28 SOL
        ...

📊 网络健康

You: "How's the Solana network doing right now?"
Hermes: Solana is operating normally.
        • TPS: 3,847 (avg last 5 min)
        • Current Slot: 248,392,105
        • Epoch: 578 (63% complete)
        • Active Validators: 1,847
        • Network Version: 1.17.28

🪙 代币研究

You: "Tell me about the JTO token"
Hermes: Jito (JTO)
        • Mint: jtojtomepa8beP8AuQc6eXt5FriJwfFMwQx2v2f9mCL
        • Supply: 1,000,000,000 (11.6% circulating)
        • Holders: 148,293
        • Decimals: 9
        • Description: Governance token for the Jito Network...

🏗️ 建筑

┌─────────────────────────────────────────────────────────┐
│                      USER                               │
│              "Check this wallet..."                     │
└──────────────────────┬──────────────────────────────────┘
                       │
                       ▼
┌─────────────────────────────────────────────────────────┐
│                  HERMES AGENT                           │
│           (Nous Research LLM Runtime)                   │
│                                                         │
│   ┌─────────────────────────────────────────────────┐   │
│   │         Model Context Protocol (MCP)            │   │
│   │     Tool Discovery · Schema Negotiation         │   │
│   │      Request Routing · Response Formatting      │   │
│   └──────────────────────┬──────────────────────────┘   │
└──────────────────────────┼──────────────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────┐
│            HERMES BLOCKCHAIN ORACLE                     │
│              (This MCP Server)                          │
│                                                         │
│   ┌───────────┐ ┌───────────┐ ┌───────────────────┐    │
│   │  Wallet   │ │   Token   │ │   Transaction     │    │
│   │  Tools    │ │   Tools   │ │   Tools           │    │
│   └─────┬─────┘ └─────┬─────┘ └────────┬──────────┘    │
│   ┌─────┴─────┐ ┌─────┴─────┐ ┌────────┴──────────┐    │
│   │   NFT     │ │   Whale   │ │   Network         │    │
│   │   Tools   │ │  Detector │ │   Stats           │    │
│   └─────┬─────┘ └─────┬─────┘ └────────┬──────────┘    │
│         └──────────────┼────────────────┘               │
└────────────────────────┼────────────────────────────────┘
                         │
                         ▼
┌─────────────────────────────────────────────────────────┐
│               SOLANA BLOCKCHAIN                         │
│     RPC Nodes · Mainnet-Beta · On-Chain Programs        │
└─────────────────────────────────────────────────────────┘

MCP集成如何工作

这个 模型上下文协议(MCP) 是一个标准化的接口,允许LLM代理发现和调用外部工具。流程如下:

  1. 注册 --当Hermes代理商开始 --mcp blockchain=hermes-blockchain-oracle,oracle向代理注册了7个工具,包括描述每个工具参数和返回类型的完整JSON模式。

  2. 发现 --Hermes Agent了解可用的工具及其功能。当用户提出与区块链相关的问题时,LLM会自主决定调用哪个工具。

  3. 调用 --代理构建结构化工具调用(例如。, solana_wallet_info(address="GsBd49..."))并通过MCP传输层将其发送到oracle服务器。

  4. 执行 --oracle查询Solana RPC,处理原始数据,并返回结构化响应。

  5. 合成 --Hermes Agent将链上数据整合到用户的自然语言响应中。

这种架构意味着oracle是 无状态, 可组合的,以及 可独立部署 --在不接触代理的情况下升级oracle,或者完全交换另一个区块链oracle。


🔧 配置

环境变量 默认值 描述
SOLANA_RPC_URL https://api.mainnet-beta.solana.com Solana RPC端点
ORACLE_PORT 8420 MCP服务器的端口
WHALE_THRESHOLD_SOL 1000 触发鲸鱼警报的最低SOL转移
WHALE_THRESHOLD_USD 100000 触发鲸鱼警报的最低美元价值
CACHE_TTL_SECONDS 30 重复查询的缓存持续时间
LOG_LEVEL INFO 记录冗长(DEBUG, INFO, WARN, ERROR)

🧪 发展

# Clone the repo
git clone https://github.com/NousResearch/hermes-blockchain-oracle.git
cd hermes-blockchain-oracle

# Create a virtual environment
python -m venv venv
source venv/bin/activate

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Run the server standalone (for debugging)
python -m hermes_blockchain_oracle --debug

# Lint & format
ruff check .
ruff format .

🤝 贡献

我们欢迎社区的贡献!以下是如何参与其中:

  1. 分叉 存储库
  2. 创建 特征分支(git checkout -b feat/amazing-new-tool)
  3. 写 测试您的更改
  4. 确保 所有测试均通过(pytest tests/ -v)
  5. 棉绒 你的代码(ruff check . && ruff format .)
  6. 承诺 信息清晰(git commit -m "feat: add defi protocol analytics tool")
  7. 推 你的分支机构和打开一个 拉取请求

贡献的想法

  • 🆕 新工具(DeFi协议统计、质押信息、程序分析)
  • 🌐 支持其他Solana程序(Marinade、Raydium、Orca等)
  • ⚡ 性能优化和缓存改进
  • 📖 文档和使用示例
  • 🧪 测试覆盖范围扩展
  • 🐛 Bug修复和错误处理改进

请阅读我们的 行为准则 在做出贡献之前。


📄 许可证

该项目根据 MIT许可证 --看看 许可证 文件以获取详细信息。

MIT License

Copyright (c) 2025 Nous Research

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

建于🧠 通过 Nous研究

赫尔墨斯看到了一切。上链和下链。

⭐ 标记此回购 如果你觉得它有用,它可以帮助我们了解社区想要什么!

报告Bug · 请求功能 · 加入Discord