@_koi/kohaku 中文文档教程

发布于 3年前 浏览 33 更新于 3年前

kohaku

SmartWeave 增量缓存包装器

在 npm 上查看:https:

//www.npmjs.com/package/@_koi/kohaku Kohaku 充当 SmartWeave 的包装器,但添加了 4 条规则以使跨合约读取成为非递归的。

  1. Reads can only happen at the current height or greater
  2. Transactions are only processed for a contract after it is registered in Kohaku's cache
  3. Contracts are registered the first time they are read by Kohaku, whether internally or externally
  4. Contracts that don't contain "readContractState" within its source are read from block 0 to global cache height

未能围绕这些规则进行设计将导致不确定或不正确的合约状态。

Installation

  • npm: npm i @_koi/kohaku
  • yarn: yarn add @_koi/kohaku

kohaku

SmartWeave Incremental Cache Wrapper

Check it out on npm here: https://www.npmjs.com/package/@_koi/kohaku

Kohaku acts as a wrapper over SmartWeave but adds 4 rules to make cross-contract reading non-recursive.

  1. Reads can only happen at the current height or greater
  2. Transactions are only processed for a contract after it is registered in Kohaku's cache
  3. Contracts are registered the first time they are read by Kohaku, whether internally or externally
  4. Contracts that don't contain "readContractState" within its source are read from block 0 to global cache height

Failure to design around these rules will result in non-deterministic or incorrect contract states.

Installation

  • npm: npm i @_koi/kohaku
  • yarn: yarn add @_koi/kohaku
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文