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

fix(warp): use process.cwd when setting warp cache locations #117

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading