thor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Thor Skill

Thor Skill

CRITICAL RULES

核心规则

  1. Read reference files FIRST. When the user's request involves any topic in the reference table below, read those files before doing anything else. Briefly mention which files you are reading so the user can confirm the skill is active.
  2. Information priority: (a) Reference files in this skill — always the primary source. (b) The thor repo source code at
    github.com/vechain/thor/v2
    for implementation details. (c) Web search — only as a last resort for topics NOT covered in references.
  3. Prefer working directly in the main conversation. Plan mode and subagents do not inherit skill context and may produce stale answers.
  4. After compaction or context loss, re-read this SKILL.md to restore awareness of the reference table.
  1. 优先阅读参考文件。当用户的请求涉及下表中的任何主题时,请先阅读对应文件再进行其他操作。简要说明你正在阅读哪些文件,以便用户确认该Skill已激活。
  2. 信息优先级:(a) 本Skill中的参考文件——始终作为首要来源。(b)
    github.com/vechain/thor/v2
    的thor代码库——用于获取实现细节。(c) 网络搜索——仅作为最后手段,用于参考文件未覆盖的主题。
  3. 优先在主对话中直接处理。计划模式和子Agent不会继承Skill上下文,可能会产生过时的答案。
  4. 在上下文压缩或丢失后,重新阅读本SKILL.md以恢复对参考表的认知。

Scope

适用范围

Use this Skill for anything related to the VeChainThor node (thor):
  • Architecture and package structure of the Go codebase
  • Consensus: PoA v1/v2, PoS (Galactica), BFT finality
  • Built-in contracts: Authority, Energy, Staker, Params, Prototype, Executor, Extension
  • REST API endpoints and WebSocket subscriptions
  • Storage: LevelDB, SQLite logdb, trie, pruning, node types
  • P2P networking: discovery, block/tx propagation
  • Cross-cutting flows: block production, transaction lifecycle, reward distribution, staking/delegation, chain sync
  • Solo mode for local development
  • Contributing to the thor codebase: build, test, add endpoints, fork config
For application-level VeChain development, see the companion skills:
  • vechain-core — SDK usage, fee delegation, multi-clause transactions, dual-token model
  • vechain-kit — VeChain Kit hooks, components, wallet connection, social login
  • smart-contract-development — Solidity, Hardhat, testing, security
  • stargate — NFT staking, validator delegation, VTHO rewards
本Skill适用于所有与VeChainThor节点(thor)相关的问题:
  • Go代码库的架构和包结构
  • 共识机制:PoA v1/v2、PoS(Galactica)、BFT最终性
  • 内置合约:Authority、Energy、Staker、Params、Prototype、Executor、Extension
  • REST API端点和WebSocket订阅
  • 存储:LevelDB、SQLite logdb、默克尔树(trie)、修剪、节点类型
  • P2P网络:节点发现、区块/交易传播
  • 跨领域流程:区块生成、交易生命周期、奖励分配、质押/委托、链同步
  • 用于本地开发的单机模式(Solo mode)
  • 为thor代码库做贡献:构建、测试、添加端点、分叉配置
对于应用层VeChain开发,请参考配套Skill:
  • vechain-core — SDK使用、费用委托、多子句交易、双代币模型
  • vechain-kit — VeChain Kit钩子、组件、钱包连接、社交登录
  • smart-contract-development — Solidity、Hardhat、测试、安全
  • stargate — NFT质押、验证节点委托、VTHO奖励

Operating procedure

操作流程

1. Identify the question type

1. 识别问题类型

  • PM/architecture question → read
    architecture.md
    + relevant flow files
  • Contributor question → read
    contributing.md
    + relevant package reference
  • "How does X work?" → read the matching flow file(s)
  • API question → read
    api.md
  • Node operations → read
    architecture.md
    (node types, flags, ports)
  • 产品经理/架构类问题 → 阅读
    architecture.md
    + 相关流程文件
  • 贡献者类问题 → 阅读
    contributing.md
    + 相关包参考文件
  • “X是如何工作的?”类问题 → 阅读对应的流程文件
  • API类问题 → 阅读
    api.md
  • 节点操作类问题 → 阅读
    architecture.md
    (节点类型、参数、端口)

2. Read before answering

2. 先阅读再回答

Load the matching reference files from the table below. Cross-cutting questions may need multiple files.
从下表中加载匹配的参考文件。跨领域问题可能需要多个文件。

3. Answer with context

3. 结合上下文回答

  • Reference specific packages, types, and files from the thor codebase
  • For flows, trace through the packages step-by-step
  • For PM audiences, lead with the high-level summary before diving into implementation
  • For contributors, include package paths and key type names
  • 引用thor代码库中的具体包、类型和文件
  • 对于流程类问题,逐步追踪包的调用流程
  • 面向产品经理受众时,先给出高层总结再深入实现细节
  • 面向贡献者时,包含包路径和关键类型名称

Reference files

参考文件

Read the matching files BEFORE doing anything else. See Critical Rules above.
TopicFileRead when user mentions...
Architecturereferences/architecture.mdoverview, packages, node types, ports, flags, fork config, tech stack
Consensusreferences/consensus.mdPoA, PoS, BFT, finality, proposer, validator selection, VRF, Galactica
Built-in contractsreferences/built-in-contracts.mdAuthority, Energy, VTHO, Staker, Params, Prototype, Executor, native contracts
REST APIreferences/api.mdAPI, endpoints, routes, subscriptions, WebSocket, Swagger
Storagereferences/storage.mddatabase, LevelDB, SQLite, logdb, trie, pruning, archive, disk
P2P networkingreferences/p2p.mdpeers, discovery, discv5, propagation, sync protocol, bootstrap
Contributingreferences/contributing.mdbuild, Makefile, tests, lint, add endpoint, fork config, PR, Go conventions
Solo modereferences/solo.mdsolo, local dev, test chain, pre-funded accounts, auto-mine
Flow: block productionreferences/flow-block-production.mdblock packing, scheduler, proposer, how blocks are created
Flow: transaction lifecyclereferences/flow-transaction-lifecycle.mdtx flow, txpool, clause execution, receipts, tx validation
Flow: reward distributionreferences/flow-reward-distribution.mdrewards, VTHO generation, validator rewards, gas rewards, burning
Flow: staking & delegationreferences/flow-staking-delegation.mdstaking, delegation, unstaking, Staker contract, validator lifecycle
Flow: chain syncreferences/flow-sync.mdsync, catch-up, peer download, fork handling, reorg, propagation
请先阅读匹配的文件,再进行其他操作。参见上述核心规则。
主题文件当用户提及以下内容时阅读
架构references/architecture.md概述、包、节点类型、端口、参数、分叉配置、技术栈
共识机制references/consensus.mdPoA、PoS、BFT、最终性、提议节点、验证节点选择、VRF、Galactica
内置合约references/built-in-contracts.mdAuthority、Energy、VTHO、Staker、Params、Prototype、Executor、原生合约
REST APIreferences/api.mdAPI、端点、路由、订阅、WebSocket、Swagger
存储references/storage.md数据库、LevelDB、SQLite、logdb、默克尔树(trie)、修剪、归档、磁盘
P2P网络references/p2p.md节点发现、discv5、传播、同步协议、引导节点
贡献指南references/contributing.md构建、Makefile、测试、代码检查、添加端点、分叉配置、PR、Go编码规范
单机模式references/solo.md单机模式、本地开发、测试链、预充值账户、自动挖矿
流程:区块生成references/flow-block-production.md区块打包、调度器、提议节点、区块创建机制
流程:交易生命周期references/flow-transaction-lifecycle.md交易流程、交易池(txpool)、子句执行、收据、交易验证
流程:奖励分配references/flow-reward-distribution.md奖励、VTHO生成、验证节点奖励、Gas奖励、销毁
流程:质押与委托references/flow-staking-delegation.md质押、委托、解除质押、Staker合约、验证节点生命周期
流程:链同步references/flow-sync.md同步、追赶式同步、节点下载、分叉处理、重组、传播