Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

warp-contracts-lmdb

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

warp-contracts-lmdb

Lmdb database for Warp Contracts SDK

  • 1.1.9
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-90.48%
Maintainers
1
Weekly downloads
 
Created
Source

Warp Contracts Lmdb Cache

Warp Contracts implementation of the SortKeyCache using the LMDB database. Compatible only with node env.

LMDB is a much better solution (than LevelDB) in terms of read/write access times and concurrency.
Comparison by Mozilla.

Installation

Note: lmdb cache is compatible only with node.js env.

yarn add warp-contracts-lmdb

Requires warp-contracts SDK ver. min. 1.2.17

Custom options

LmdbCache constructor accepts a second param with custom configuration.

OptionRequiredDescription
maxEntriesPerContractfalseMaximum number of interactions stored per contract id - above this threshold adding another entry triggers removing old interactions.
minEntriesPerContractfalseMinimum number of interactions stored per contract id. Value used when removing old iteractions.

Usage

const {defaultCacheOptions, WarpFactory} = require("warp-contracts");
const {LmdbCache} = require("warp-contracts-lmdb");

const warp = WarpFactory
  .forMainnet()
  .useStateCache(new LmdbCache({
      ...defaultCacheOptions,
      dbLocation: `./cache/warp/state`
    }, {
      maxEntriesPerContract: 100, 
      minEntriesPerContract: 10
    }
  ))
  .useContractCache(
    // Contract cache
    new LmdbCache({
    ...defaultCacheOptions,
    dbLocation: `./cache/warp/contracts`
    }), 
    // Source cache
    new LmdbCache({
    ...defaultCacheOptions,
    dbLocation: `./cache/warp/src`
  }));

FAQs

Package last updated on 26 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc