译文/Translated:
随着区块链与每种认证交易的共同成长,查询、阅读历史和状态数据显然成为了难度不断攀升的挑战。为了克服这一挑战,我们正不断推出一系列历史工具,专门用以提高EOSIO获取数据的能力。您可以在GitHub的历史工具库中找到相关技术详情和文档。可以在这里查阅历史工具文档。
我们此前发布了用以提高区块链数据可获取性的状态历史插件(State History Plugin)。该插件将区块链状态数据保存至新的平面文件格式,并公开了websocket界面,用以阅读区块/状态数据。随着历史工具方案的内测版发布,我们更进一步引入数据库填充程序,用以读取状态数据并填充专用客户端和服务器WASM可以查询的PostgreSQL和LMDB数据库。
丰富的用户体验以及在EOSIO上建立的可靠应用要求工具能够让应用程序高效访问并查阅区块链和智能合约的数据。本质上讲,区块链系统以顺序方式存储数据,这种方式不易用于可扩展的随机访问查询和检索系统。
由于此版本为测试版,我们希望能在整个开发过程中迭代更替。我们希望在工具的推广过程中,社区成员的反馈能为我们提供额外的指导。
WASM-Query 语言
WASM-Query 语言(WASM-QL)实现了客户端 – 服务器架构,用于在WASM中设计和执行查询。此实施模式允许合约作者使用创建合同相同的工具来设计和编码查询,并使用客户端 – 服务器查询结构。一旦启用,该系统将可以检查任何给定区块高度的历史状态。此外,由于此系统中的复制从nodeos降级为低内存密集型查询过程,因此对扩展性更有利。
这为通用查询引擎提供了更加精简的方法,使应用程序能够从EOSIO智能合约中收集数据。此外,合约及应用作者能使用相同的工具集设计自身的查询,创造出更大的总体协同效果。
wasm-al-pg支持的两种查询类型:
- 二进制查询最为灵活。客户端WASM将查询打包成二进制格式,在WASM-QL中运行的服务器端WASM执行查询,然后以二进制格式生成结果。此后,客户端WASM将二进制转换为JSON。该工具集可帮助作者创建两个WASM。
- 模拟/ v1 / RPC API
最后,我们可以选择删除客户端WASM并将第一类查询的格式切换为JSON RPC,Graph QL或其他格式。我们非常感谢在做决定时社区所给予的反馈,因此请在您的支持建议中对库进行评论。
Fill-pg
Fill-pg旨在为应用程序提供轻量级解决方案,以收集通常从监控主链获得的所有相关数据。收集的信息包括:
- 每个区块的头信息
- 交易和操作跟踪,包括内联操作和延迟交易
- 区块水平的合约表历史
- 跟踪链状态历史的表包括:
- 账户,包括许可证和linkauths
- 账户资源限制和用途
- 合约代码
- 合约ABI
- 共识参数
- 激活的共识升级
Fill-pg通过从等式中排除区块来减少自重,因为它们不包括应用程序需要的内联操作和延迟交易数据。它支持完整和部分历史记录,因此用户可以决定是否要查询整个链或一个分区。
Fill-lmdb、wasm-ql-lmdb
这对与fill-pg和wasm-pg的操作相同,但是使用lmdb而不是postgresql存储数据;作为嵌入式数据库,lmdb可能具有管理优势。
让区块链数据可获取
为了提供更复杂应用的顺畅用户体验(这些应用维持了区块链数据的完整性),开发人员需要可以像查询对应的非区块链库那样稳定地访问确定性数据库。区块链节点具有较窄的查询选项范围,当复杂的应用程序尝试存储和检索索引数据时会出现问题。通常,这使开发人员有两种选择,处理应用程序内的数据或将分类数据存储至区块链本身,这种方法低效且昂贵。
通过减少应用程序数据库和EOSIO区块链之间的来回,我们将继续提供卓越的数据访问扩展性工具,这一点在EOSIO战略愿景中有所概述。随着我们不断收到反馈,我们将继续优化可以减少资源负载的方法,并帮助开发人员创建更高效的应用程序架构。
保持连接
我们感谢帮助测试并为这些工具不断努力的人们,正是他们的添砖加瓦,我们才能为EOSIO社区提供最好的服务。如果您想要提供反馈并与我们的团队更密切地合作,共同为开发人员优化EOSIO,您可以向我们的开发者关系团队发送邮件:developers@block.one
请记住,您可以在EOSIO网站订阅我们的邮件列表,随时关注更新信息。我们很高兴能够定期为EOSIO开发人员优化软件的使用型,我们将持续为区块链技术的大规模应用打下坚实的基础。
. . .
重要通知:所有提供的材料都受此重要通知的约束,您必须自行熟悉此间条款。该通知包含与我们软件、出版物、商标、第三方资源以及前瞻性声明相关的信息、限制和约束内容。通过访问我们的材料,您接收并同意此通知的条款。
原文/Original:
As blockchains grow with each authenticated transaction, querying and reading history and state data proves to be a growing challenge. In order to tackle this challenge, we have been working on a series of History Tools designed to make data more accessible for EOSIO based blockchains. You can find more technical details and documentation in the History Tools repository on GitHub. Documentation for History Tools can be found here.
We have previously released the State History Plugin that makes accessing blockchain data easier. The state history plugin saves blockchain state data to a new flat-file format and exposes a websocket interface to read the block/state data. With the alpha release of the History-Tools solution, we take this one step further and introduce database fillers to read the state data and populate PostgreSQL and LMDB databases that can be queried with the specialized client and server WASMs.
Rich user experiences and reliable applications built on EOSIO require tools that allow applications to efficiently access and query data from the blockchain and smart contracts. By nature, blockchain systems store data in a sequential manner that doesn’t easily lend itself to scalable random access query and retrieval systems.
As this is an alpha release, we expect to iterate changes throughout the development process. It is our hope that feedback from members of the community will help to provide us additional guidance as we roll out these tools.
WASM-Query Language
WASM-Query Language (WASM-QL) implements a client-server architecture to design and execute queries in WASM. This implementation pattern allows contract authors to design and code queries using the same tooling used to create contracts and leverage the client-server query architecture. It also minimizes the back-and-forth communication required between client and server optimizing speed and efficiency. Once enabled, this system would make it possible to inspect historical states at any given block height. In addition, since replication in this system is relegated away from nodeos towards low memory-intensive query processes, it is more conducive to scalability.
This offers a more streamlined approach for the general-purpose query engines that enable applications to gather data from the EOSIO smart contracts. In addition, authors of contracts and applications can design their own queries with the same toolset that contracts are designed with, providing overall greater synergy.
There are two types of queries that wasm-ql-pg supports:
- Binary queries are the most flexible. A client-side WASM packs the query into a binary format, a server-side WASM running in WASM-QL executes the query then produces a result in binary format, then the client-side WASM converts the binary to JSON. The toolset helps authors create both WASMs.
- An emulation of the /v1/ RPC API.
In time, we may choose to drop the client-side WASMs and switch the format of the first type of query to JSON RPC, Graph QL, or another format. We appreciate community feedback as we make these decisions, so please comment in the repository with the recommendation you support.
Fill-pg
Fill-pg is designed to offer applications a lightweight solution to gather all pertinent data they would normally receive from monitoring the main chain. The information gathered includes:
- Header information from each block
- Transaction and action traces, including inline actions and deferred transactions
- Contract table history, at the block level
- Tables which track the history of chain state, including
- Accounts, including permissions and linkauths
- Account resource limits and usage
- Contract code
- Contract ABIs
- Consensus parameters
- Activated consensus upgrades
Fill-pg cuts dead weight by excluding blocks from the equation since they don’t include the inline actions and deferred transaction data that applications need. It supports both full and partial history so users can decide if they want to query the entire chain or a subsection.
Fill-lmdb, wasm-ql-lmdb
This pair operates identically to fill-pg and wasm-pg, however, data is stored using lmdb as opposed to postgresql; as an embedded database lmdb might provide administration advantages.
Making Blockchain Data Accessible
In order to deliver seamless user experiences for more complex applications that maintain the integrity of blockchain data, developers need robust access to deterministic databases that can be queried like their non-blockchain counterparts. Blockchain nodes have a narrow scope of query options which causes problems to arise when complex applications try to store and retrieve indexed data. Traditionally, this left developers with two options; either processing the data within the application or storing sorted data on the blockchain itself which can be inefficient and expensive.
By reducing the back-and-forth between application databases and the EOSIO blockchain we’re following through on providing superior tools for Data Access Scalability, outlined in the EOSIO Strategic Vision. As we continue to receive feedback, we’ll continue to optimize methods that can reduce resource loads and help developers create more efficient application architectures.
Stay Connected
We appreciate the efforts of those who continue to help test and provide input on these tools as they evolve to best serve the EOSIO community. If you would like to offer feedback and work more closely with our team to improve EOSIO for developers, you can send our developer relations team an email at developers@block.one.
Remember, you can also keep up-to-date with future announcements by subscribing to our mailing list on the new EOSIO website. We are excited to be regularly improving the usability of the software for EOSIO developers as we continue to lay a foundation for the mass adoption of blockchain technology.
. . .
Important: All material is provided subject to this important notice and you must familiarize yourself with its terms. The notice contains important information, limitations, and restrictions relating to our software, publications, trademarks, third-party resources, and forward-looking statements. By accessing any of our material, you accept and agree to the terms of the notice.
原文链接/Original URL: