Some checks failed
CI/CD Pipeline / Solidity Contracts (pull_request) Failing after 1m6s
CI/CD Pipeline / Security Scanning (pull_request) Successful in 12m42s
CI/CD Pipeline / Lint and Format (pull_request) Failing after 42s
CI/CD Pipeline / Terraform Validation (pull_request) Failing after 25s
CI/CD Pipeline / Kubernetes Validation (pull_request) Successful in 27s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (pull_request) Failing after 49s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (pull_request) Failing after 26s
Validation / validate-genesis (pull_request) Successful in 36s
Validation / validate-terraform (pull_request) Failing after 28s
Validation / validate-kubernetes (pull_request) Failing after 12s
Validation / validate-smart-contracts (pull_request) Failing after 13s
Validation / validate-security (pull_request) Failing after 1m39s
Validation / validate-documentation (pull_request) Failing after 18s
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import * as dotenv from 'dotenv';
|
|
import path from 'path';
|
|
import { existsSync } from 'fs';
|
|
import { HistoricalPricingBackfillService } from '../src/services/historical-pricing-backfill';
|
|
|
|
const rootEnvCandidates = [
|
|
path.resolve(__dirname, '../../../.env'),
|
|
path.resolve(__dirname, '../../../../.env'),
|
|
];
|
|
|
|
for (const candidate of rootEnvCandidates) {
|
|
if (existsSync(candidate)) {
|
|
dotenv.config({ path: candidate });
|
|
break;
|
|
}
|
|
}
|
|
|
|
dotenv.config();
|
|
|
|
function readInt(name: string, fallback: number): number {
|
|
const raw = String(process.env[name] || '').trim();
|
|
if (!raw) return fallback;
|
|
const parsed = Number(raw);
|
|
return Number.isFinite(parsed) ? parsed : fallback;
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
const chainId = readInt('BACKFILL_CHAIN_ID', 138);
|
|
const days = readInt('BACKFILL_DAYS', 30);
|
|
const chunkSize = readInt('BACKFILL_CHUNK_SIZE', 2500);
|
|
const poolLimit = readInt('BACKFILL_POOL_LIMIT', 500);
|
|
|
|
const service = new HistoricalPricingBackfillService();
|
|
const summary = await service.backfillChain({
|
|
chainId,
|
|
days,
|
|
chunkSize,
|
|
poolLimit,
|
|
});
|
|
|
|
// eslint-disable-next-line no-console
|
|
console.log(JSON.stringify(summary, null, 2));
|
|
}
|
|
|
|
main().catch((error) => {
|
|
// eslint-disable-next-line no-console
|
|
console.error(error);
|
|
process.exit(1);
|
|
});
|