From 52323b86cf18853a666921d089e9466fc7b285d7 Mon Sep 17 00:00:00 2001 From: Chris Guimaraes Date: Fri, 22 Sep 2023 14:46:43 +0100 Subject: [PATCH] docs: update --- README.md | 20 ++++++++++++++++--- .../parquet-based/replay-controller.ts | 8 +++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 767edec8e5..511d436f9d 100644 --- a/README.md +++ b/README.md @@ -111,9 +111,23 @@ The feature can be used via program args. For example, if there are breaking cha SQL schema, like adding a new column that requires events to be re-played, the following steps could be run: -### Event Replay Instructions +### Event Replay V2 -#### V1 BNS Data +This version of the replay process relies on parquet files processing instead of TSV files. + +There are some improvements on the replay process and this version is is, around, 10x times faster than the previous (V1) one. + +__Note: the previous event-replay version is still available and can be used as well, for the same purpose.__ + +#### Instructions + +To run the new event-replay, please follow the instructions at [stacks-event-replay](https://github.com/hirosystems/stacks-event-replay#installation) repository. + +### Event Replay V1 + +#### Instructions + +##### V1 BNS Data **Optional but recommended** - If you want the V1 BNS data, there are going to be a few extra steps: @@ -139,7 +153,7 @@ could be run: ``` 1. Set the data's location as the value of `BNS_IMPORT_DIR` in your `.env` file. -#### Export and Import +##### Export and Import 1. Ensure the API process is not running. When stopping the API, let the process exit gracefully so that any in-progress SQL writes can finish. diff --git a/src/event-replay/parquet-based/replay-controller.ts b/src/event-replay/parquet-based/replay-controller.ts index ccff91fbf9..323f8b7260 100644 --- a/src/event-replay/parquet-based/replay-controller.ts +++ b/src/event-replay/parquet-based/replay-controller.ts @@ -18,6 +18,12 @@ const cluster = (_cluster as unknown) as _cluster.Cluster; // typings fix import { FILE_PATH as raw_worker_path } from './workers/raw-worker'; import { FILE_PATH as new_block_worker_path } from './workers/new-block-worker'; +/** + * This class is an entry point for the event-replay based on parquet files, + * being responsible to start the replay process (check "do" method). + * + * It also has functions to prepare and finalize the database for an event-replay. + */ export class ReplayController { private readonly db; private readonly dataset; @@ -265,7 +271,7 @@ export class ReplayController { }; /** - * + * This funtion is responsible to initialize the event-replay process. */ do = async () => { // NEW_BLOCK events