Caching Options
Optional caching with LMDB or Redis.
import {defaultCacheOptions, WarpFactory} from 'warp-contracts';
import {LmdbCache} from 'warp-contracts-lmdb';
warp = WarpFactory
.forMainnet()
.useStateCache(
new LmdbCache(
{
...defaultCacheOptions,
dbLocation: './cache/warp/state',
}
)
)
.useContractCache(
new LmdbCache({
...defaultCacheOptions,
dbLocation: './cache/warp/contract',
}),
new LmdbCache({
...defaultCacheOptions,
dbLocation: './cache/warp/src',
})
)
.useKVStorageFactory(
(contractTxId: string) =>
new LmdbCache({
...defaultCacheOptions,
dbLocation: `./cache/warp/kv/lmdb_2/${contractTxId}`,
})
);
Last updated