From a6c356621b250faa19ffd848bd0e87910dc745e8 Mon Sep 17 00:00:00 2001 From: nigiri <168690269+0xnigir1@users.noreply.github.com> Date: Tue, 5 Nov 2024 11:02:12 -0300 Subject: [PATCH] refactor: rename package to processing --- apps/{processor => processing}/.env.example | 0 apps/{processor => processing}/README.md | 10 +++++----- apps/{processor => processing}/package.json | 0 apps/{processor => processing}/src/config/env.ts | 6 +++--- apps/{processor => processing}/src/config/index.ts | 0 apps/{processor => processing}/src/index.ts | 6 +++--- apps/{processor => processing}/src/services/index.ts | 2 +- .../src/services/processing.service.ts} | 2 +- .../src/services/sharedDependencies.service.ts | 0 apps/{processor => processing}/tsconfig.build.json | 0 apps/{processor => processing}/tsconfig.json | 0 apps/{processor => processing}/vitest.config.ts | 0 12 files changed, 13 insertions(+), 13 deletions(-) rename apps/{processor => processing}/.env.example (100%) rename apps/{processor => processing}/README.md (94%) rename apps/{processor => processing}/package.json (100%) rename apps/{processor => processing}/src/config/env.ts (89%) rename apps/{processor => processing}/src/config/index.ts (100%) rename apps/{processor => processing}/src/index.ts (83%) rename apps/{processor => processing}/src/services/index.ts (54%) rename apps/{processor/src/services/processor.service.ts => processing/src/services/processing.service.ts} (98%) rename apps/{processor => processing}/src/services/sharedDependencies.service.ts (100%) rename apps/{processor => processing}/tsconfig.build.json (100%) rename apps/{processor => processing}/tsconfig.json (100%) rename apps/{processor => processing}/vitest.config.ts (100%) diff --git a/apps/processor/.env.example b/apps/processing/.env.example similarity index 100% rename from apps/processor/.env.example rename to apps/processing/.env.example diff --git a/apps/processor/README.md b/apps/processing/README.md similarity index 94% rename from apps/processor/README.md rename to apps/processing/README.md index 39e164b..6460df1 100644 --- a/apps/processor/README.md +++ b/apps/processing/README.md @@ -17,7 +17,7 @@ This service is the main application that runs the core processing pipeline: ### ⚙️ Setting up env variables -- Create `.env` file and copy paste `.env.example` content in there. +- Create `.env` file and copy paste `.env.example` content in there or run the following command: ``` $ cp .env.example .env @@ -28,15 +28,15 @@ Available options: |-----------------------------|--------------------------------------------------------------------------------------------------------------------------------|-----------|----------------------------------|-----------------------------------------------------------------| | `RPC_URLS` | Array of RPC URLs | N/A | Yes | Multiple URLs for redundancy | | `CHAIN_ID` | Chain ID | N/A | Yes | At the moment only Optimism is supported (10) | -| `FETCH_LIMIT` | Maximum number of items to fetch in one batch | 500 | Yes | | -| `FETCH_DELAY_MS` | Delay between fetch operations in milliseconds | 3000 | Yes | | +| `FETCH_LIMIT` | Maximum number of items to fetch in one batch | 500 | No | | +| `FETCH_DELAY_MS` | Delay between fetch operations in milliseconds | 1000 | No | | | `DATABASE_URL` | PostgreSQL Data Layer database connection URL | N/A | Yes | | -| `DATABASE_SCHEMA` | PostgreSQL Data Layer database schema name | chainDataSchema | Yes | | +| `DATABASE_SCHEMA` | PostgreSQL Data Layer database schema name | public | Yes | | | `INDEXER_GRAPHQL_URL` | GraphQL endpoint for the indexer | N/A | Yes | | | `INDEXER_ADMIN_SECRET` | Admin secret for indexer authentication | N/A | Yes | | | `IPFS_GATEWAYS_URL` | Array of IPFS gateway URLs | N/A | Yes | Multiple gateways for redundancy | | `COINGECKO_API_KEY` | API key for CoinGecko service | N/A | Yes | | -| `COINGECKO_API_TYPE` | CoinGecko API tier (demo or pro) | N/A | Yes | | +| `COINGECKO_API_TYPE` | CoinGecko API tier (demo or pro) | pro | No | | ## Available Scripts diff --git a/apps/processor/package.json b/apps/processing/package.json similarity index 100% rename from apps/processor/package.json rename to apps/processing/package.json diff --git a/apps/processor/src/config/env.ts b/apps/processing/src/config/env.ts similarity index 89% rename from apps/processor/src/config/env.ts rename to apps/processing/src/config/env.ts index a168336..de2e782 100644 --- a/apps/processor/src/config/env.ts +++ b/apps/processing/src/config/env.ts @@ -15,14 +15,14 @@ const stringToJSONSchema = z.string().transform((str, ctx): z.infer => { - processor = new ProcessorService(environment); + processor = new ProcessingService(environment); await processor.start(); }; diff --git a/apps/processor/src/services/index.ts b/apps/processing/src/services/index.ts similarity index 54% rename from apps/processor/src/services/index.ts rename to apps/processing/src/services/index.ts index 4164fad..337f798 100644 --- a/apps/processor/src/services/index.ts +++ b/apps/processing/src/services/index.ts @@ -1,2 +1,2 @@ export * from "./sharedDependencies.service.js"; -export * from "./processor.service.js"; +export * from "./processing.service.js"; diff --git a/apps/processor/src/services/processor.service.ts b/apps/processing/src/services/processing.service.ts similarity index 98% rename from apps/processor/src/services/processor.service.ts rename to apps/processing/src/services/processing.service.ts index fd3dd86..4f7ee02 100644 --- a/apps/processor/src/services/processor.service.ts +++ b/apps/processing/src/services/processing.service.ts @@ -19,7 +19,7 @@ import { SharedDependencies, SharedDependenciesService } from "./index.js"; * * TODO: support multichain */ -export class ProcessorService { +export class ProcessingService { private readonly logger = Logger.getInstance(); private readonly orchestrator: Orchestrator; private readonly kyselyDatabase: SharedDependencies["kyselyDatabase"]; diff --git a/apps/processor/src/services/sharedDependencies.service.ts b/apps/processing/src/services/sharedDependencies.service.ts similarity index 100% rename from apps/processor/src/services/sharedDependencies.service.ts rename to apps/processing/src/services/sharedDependencies.service.ts diff --git a/apps/processor/tsconfig.build.json b/apps/processing/tsconfig.build.json similarity index 100% rename from apps/processor/tsconfig.build.json rename to apps/processing/tsconfig.build.json diff --git a/apps/processor/tsconfig.json b/apps/processing/tsconfig.json similarity index 100% rename from apps/processor/tsconfig.json rename to apps/processing/tsconfig.json diff --git a/apps/processor/vitest.config.ts b/apps/processing/vitest.config.ts similarity index 100% rename from apps/processor/vitest.config.ts rename to apps/processing/vitest.config.ts