Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
fix(warp): use process.cwd when setting warp cache locations
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed May 29, 2024
1 parent af8717a commit 2c75d98
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/middleware/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
import { arweave } from './arweave';
import { SqliteContractCache } from 'warp-contracts-sqlite';
import { LmdbCache } from 'warp-contracts-lmdb';
import path from 'path';

LoggerFactory.INST.logLevel(
(process.env.WARP_LOG_LEVEL as LogLevel) ?? 'fatal',
Expand All @@ -44,7 +45,7 @@ export const warp = WarpFactory.forMainnet(
new SqliteContractCache(
{
...defaultCacheOptions,
dbLocation: `./cache/warp/sqlite/state`,
dbLocation: path.join(process.cwd(), `/cache/warp/sqlite/state`),
},
{
maxEntriesPerContract: 100_000,
Expand All @@ -55,14 +56,17 @@ export const warp = WarpFactory.forMainnet(
(contractTxId: string) =>
new LmdbCache({
...defaultCacheOptions,
dbLocation: `./cache/warp/lmdb/kv/${contractTxId}`,
dbLocation: path.join(
process.cwd(),
`/cache/warp/lmdb/kv/${contractTxId}`,
),
}),
)
.useContractCache(
new SqliteContractCache(
{
...defaultCacheOptions,
dbLocation: `./cache/warp/sqlite/contracts`,
dbLocation: path.join(process.cwd(), `/cache/warp/sqlite/contracts`),
},
{
maxEntriesPerContract: 10,
Expand All @@ -71,7 +75,7 @@ export const warp = WarpFactory.forMainnet(
new LmdbCache(
{
...defaultCacheOptions,
dbLocation: `./cache/warp/lmdb/source`,
dbLocation: path.join(process.cwd(), `/cache/warp/lmdb/source`),
},
{
maxEntriesPerContract: 10,
Expand Down

0 comments on commit 2c75d98

Please sign in to comment.