History Tools Starter Kit
Source
The History Tools Starter Kit is a robust package that implements the components of History Tools with dependencies such as MongoDB and eosjs. This inclusive package contains file dependencies for each process, namely: bootstrap, reader, filter, and processor.
Additionally, it encompasses data layer implementations for common components such as Abis, BlockRangeScanner, BlockState, Ship etc., which are integral to the mentioned above processes. The History Tools package contains the logic and domain layer implementation, while this Starter Kit presents the data layer implementation.
Essentially, the History Tools Starter Kit equips you with a ready-to-use framework for leveraging the power of History Tools. While History Tools can be employed with other dependencies, this Starter Kit offers a seamless experience for those seeking to utilize MongoDB and eosjs. Therefore, if your project necessitates these dependencies, this Starter Kit is your ideal starting point.
Dependencies
This package is dependent on the following packages:
Table of Contents
Installation
To add History Tools to your project, use the following command with your favorite package manager:
yarn add @alien-worlds/history-tools-starter-kit
Common Components
In the Common folder you will find all data layer implementations related to MongoDB collections or eosjs tools. This includes mappers for transforming documents to entities and vice versa, service implementations, and various types. These resources are conveniently available for direct use when creating the components for your project.
To further enhance ease-of-use, this package provides creators that take the heavy lifting out of creating an instance of each component. The creators automate the construction process, resulting in an efficient and streamlined development experience. The specific list of available creators :
AbisCreatorBlockRangeScannerBlockReaderCreatorBlockStateCreatorBlockchainServiceCreatorFeaturedContractsCreatorProcessortaskQueueCreatorShipAbisCreatorUnprocessedBlockQueueCreator
The use of these creators is very simple, just call the static create method and provide the expected arguments
// An example of creating an instance of the UnprocessedBlockQueue using a dedicated creator
const unprocessedBlockQueue = await UnprocessedBlockQueueCreator.create(
mongoSource,
{ ...config }
);
More information about individual components can be found in this repository @alien-worlds/aw-history.
Processes
The remaining folders name correspond to the history tools processes and contain the necessary dependencies files. These files contain Dependencies classes that are initialized within the process or worker loader of the process.
-
Bootstrap: Requires
DefaultBootstrapDependenciespassed to the bootstrap command. Dependencies:BroadcastClientAbisBlockRangeScannerFeaturedContractsBlockStateBlockchainService
-
Reader: Requires
DefaultReaderDependenciespassed to the reader command. Dependencies:BroadcastClientBlockRangeScanner
The second file is
ReaderWorkerLoaderDependencieswhich is instantiated in the worker loader and the path to this file is given inDefaultReaderDependencies. Dependencies:BlockRangeScannerBlockReaderBlockStateUnprocessedBlockQueue
-
Filter: Requires
DefaultFilterDependenciespassed to the filter command. Dependencies:BroadcastClientUnprocessedBlockQueue
The second file is
FilterWorkerLoaderDependencieswhich is instantiated in the worker loader and the path to this file is given inDefaultFilterDependencies. Dependencies:ProcessorTaskQueueAbisShipAbisFeaturedContractsAntelopeSerializer
-
Processor: Requires
DefaultProcessorDependenciespassed to the processor command. Dependencies:BroadcastClientProcessorTaskQueueFeatured<ContractTraceMatchCriteria>Featured<ContractDeltaMatchCriteria>
The second file is
ProcessorWorkerLoaderDependencieswhich is instantiated in the worker loader and the path to this file is given inDefaultProcessorDependencies. Dependencies:MongoSourceAntelopeSerializer
Tutorials
Contributing
We welcome contributions from the community. Before contributing, please read through the existing issues on this repository to prevent duplicate submissions. New feature requests and bug reports can be submitted as an issue. If you would like to contribute code, please open a pull request.