Skip to content

Commit

Permalink
feat(l1-data): enable local chunk caching PE-2476
Browse files Browse the repository at this point in the history
Enables filesystem based chunk data caching. Metadata caching is not yet
enabled, but will be soon.
  • Loading branch information
djwhitt committed Oct 26, 2022
1 parent 6fca196 commit 53ded5e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ import YAML from 'yaml';

import { ArweaveCompositeClient } from './arweave/composite-client.js';
import { TxChunksDataSource } from './arweave/tx-chunks-data-source.js';
import { ReadThroughChunkDataCache } from './cache/read-through-chunk-data-cache.js';
import { StandaloneSqliteDatabase } from './database/standalone-sqlite.js';
import { UniformFailureSimulator } from './lib/chaos.js';
import log from './log.js';
import { apolloServer } from './routes/graphql/index.js';
import { FsBlockStore } from './store/fs-block-store.js';
import { FsChunkDataStore } from './store/fs-chunk-data-store.js';
import { FsTransactionStore } from './store/fs-transaction-store.js';
import { BlockImporter } from './workers/block-importer.js';
import { TransactionFetcher } from './workers/transaction-fetcher.js';
Expand Down Expand Up @@ -126,10 +128,16 @@ const txRepairWorker = new TransactionRepairWorker({
});

// Configure transaction data source
const txChunkDataSource = new ReadThroughChunkDataCache({
log,
chunkSource: arweaveClient,
chunkDataStore: new FsChunkDataStore({ log, baseDir: 'data/chunks' }),
});

const txDataSource = new TxChunksDataSource({
log,
chainSource: arweaveClient,
chunkSource: arweaveClient,
chunkSource: txChunkDataSource,
});

arweaveClient.refreshPeers();
Expand Down

0 comments on commit 53ded5e

Please sign in to comment.