R
rantree-hive/hafsql-hive
Claude Code skill for HafSQL — query patterns, virtual-op routing, vote-value formula, and Hive API pitfalls…
★ 1·更新 2026-11-19
在 GitHub 查看 ↗直链 · 无中转页
装完之后怎么算装好了
- 装完该看到什么 — 命令正常结束时退出码为 0,终端里没有 "command not found" 或 "permission denied"。
- 一行自检 — 按该仓库 README 里给出的最小用法跑一次;能按 README 的描述输出就是通了。
- 答不出来怎么办 — 这个项目没有写排错说明,去仓库的 Issues 搜 install。
安装命令取自该仓库;以上判据只描述可观察到的结果,不替代项目自己的文档。
- ★ 数取值
- 1 ★ · rantree-hive/hafsql-hive · 取自 GitHub 搜索 API · (2026-11-19 20:00:48 核对)
- 来源明细
- 从该仓库的 GitHub 页面直接读取 · 条目类型:开源项目
- 收录与活跃
- 收录于 2026-11-20 · 最近见到 2026-11-20 · 共见到 1 次 · 被 1 个来源列出
- 评分构成
- 综合分 103 · 1 ★ · 1 个来源 · repo
- 安装
- 安装命令见上方「安装与配置」。
常见问题(答案都来自我们的记录)
它适合谁 / 用来做什么?
我们把它归在这些标签下: 开源项目。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
仓库
rantree-hive/hafsql-hive;我们收录于 2026-11-20;最近见到 2026-11-20。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。README 原文(英文,未翻译) · 在 GitHub 读完整 README →
# hafsql-hive
以下摘录自该仓库的 README(片段)
A Claude Code skill for building correct, performant queries against HafSQL — the PostgreSQL layer over HAF-indexed Hive blockchain data.
## Install
bash
npx skills add rantree-hive/hafsql-hive
## What it covers
Which HafSQL table to use for each operation type — including the virtual-op trap (haf_operations silently returns 0 rows for reward ops)
HafSQL utility functions: id_from_timestamp, get_timestamp, to_json
Multi-window aggregation with id_from_timestamp (30d / 7d / all-time in one query)
operation_comment_reward_table timing trap (fires at payout, not post creation — use 30d window)
VESTS → HP conversion via hafsql.dynamic_global_properties.vests_per_hive
Vote value / rshares formula — the correct 1_000_000 / 25 scaling factor (empirically verified 2026-11); common wrong factors and their symptoms
RC% calculation with mana regeneration forward-projection (raw current_mana is stale)
rc_api.find_rc_accounts correct params form: plain object, not array-wrapped
HAFAH broken fields: reputation: 0, comment_count: 0 from condenser_api.get_accounts — correct sources
hive_accounts_info_view.post_count includes comments — use hafsql.comments WHERE parent_author='' for root-only count
Profile metadata from hivemind_app.hive_accounts_info_view.posting_json_metadata
Precision-aware parseAmt for both old string and new asset-object API formats
Schema layers: hafd layer-0 raw tables, generic views, dedicated op tables, and the op_type name format
Per-voter parallel scan for vote queries over many accounts (avoids slow bitmap scans on voter = ANY(...))
Vote value from actual rshares via hivemind_app.hive_votes_view
milli-VESTS scaling in hafsql.balances.vests and hafsql.accounts.incoming_vests / outgoing_vests
Operation timeline with haf_account_operations cursor pagination, plus reading custom_json via the hafd account-operation index
haf_operations.body wrapping on HAFAH nodes (body?.value)
hafsql.comments payout columns: SPLIT_PART string format, tags JSONB filter, active vs. paid-out detection, sub-account LIKE pattern
Production pool setup with circuit breaker, retry, and statement_timeout
Correct custom_json column (json text → hafsql.to_json(json)) and op-type registry names
Comment edits are separate ops: DISTINCT ON dedup in operation_comment_view, stale hafsql.comments.body, bounding comment scans by created
DHF / proposal payouts via operation_proposal_pay_table (a virtual op, not a transfer)
Post community/category resolution through hivemind joins, plus snap/microblog community IDs
## Install
bash
npx skills add rantree-hive/hafsql-hive
## What it covers
Which HafSQL table to use for each operation type — including the virtual-op trap (haf_operations silently returns 0 rows for reward ops)
HafSQL utility functions: id_from_timestamp, get_timestamp, to_json
Multi-window aggregation with id_from_timestamp (30d / 7d / all-time in one query)
operation_comment_reward_table timing trap (fires at payout, not post creation — use 30d window)
VESTS → HP conversion via hafsql.dynamic_global_properties.vests_per_hive
Vote value / rshares formula — the correct 1_000_000 / 25 scaling factor (empirically verified 2026-11); common wrong factors and their symptoms
RC% calculation with mana regeneration forward-projection (raw current_mana is stale)
rc_api.find_rc_accounts correct params form: plain object, not array-wrapped
HAFAH broken fields: reputation: 0, comment_count: 0 from condenser_api.get_accounts — correct sources
hive_accounts_info_view.post_count includes comments — use hafsql.comments WHERE parent_author='' for root-only count
Profile metadata from hivemind_app.hive_accounts_info_view.posting_json_metadata
Precision-aware parseAmt for both old string and new asset-object API formats
Schema layers: hafd layer-0 raw tables, generic views, dedicated op tables, and the op_type name format
Per-voter parallel scan for vote queries over many accounts (avoids slow bitmap scans on voter = ANY(...))
Vote value from actual rshares via hivemind_app.hive_votes_view
milli-VESTS scaling in hafsql.balances.vests and hafsql.accounts.incoming_vests / outgoing_vests
Operation timeline with haf_account_operations cursor pagination, plus reading custom_json via the hafd account-operation index
haf_operations.body wrapping on HAFAH nodes (body?.value)
hafsql.comments payout columns: SPLIT_PART string format, tags JSONB filter, active vs. paid-out detection, sub-account LIKE pattern
Production pool setup with circuit breaker, retry, and statement_timeout
Correct custom_json column (json text → hafsql.to_json(json)) and op-type registry names
Comment edits are separate ops: DISTINCT ON dedup in operation_comment_view, stale hafsql.comments.body, bounding comment scans by created
DHF / proposal payouts via operation_proposal_pay_table (a virtual op, not a transfer)
Post community/category resolution through hivemind joins, plus snap/microblog community IDs
收录徽章(可选)
想把收录标记放进 README 就复制这行,可选,不影响收录。
[](https://anclum.com/zh/s/rantree-hive-hafsql-hive/)
- 来源
- github · https://github.com/rantree-hive/hafsql-hive
- 按领域浏览
- 开源项目
- Traction
- 1 ★
- 收录于
- 今天
更多条目
所属领域与标签
每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。