An ILP store loader for key/value stores used by ILP components
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.circleci
src
test
.gitignore
README.md
example.js
package-lock.json
package.json
tsconfig.json
tslint.json
typedoc.js

README.md

ILP Store

An ILP store loader for key/value stores used by ILP components

NPM Package CircleCI Known Vulnerabilities

The script below will create an instance of an ILP store with no setup whatsoever. You can use this anywhere that you need a key value store for use by an ILP component.

IMPORTANT: The default store is an in-memory store that will lose all of its data when the process exits. For persistent storage consider one of the other ilp-store-* modules such as ilp-store-redis or ilp-store-simpledb.

Examples

Javascript:

const store = require('ilp-store')()
async function run () {
  await store.put('key', 'some value')
  const value = await store.get('key')
  process.exit(0)
}
run()

TypeScript:

import createStore from 'ilp-store'
const store = createStore()
async function run () {
  await store.put('key', 'some value')
  const value = await store.get('key')
  process.exit(0)
}
run()

If no parameters are provided it will attempt to find the config in environment variables. If these are not found it will load an in-memory store.

The Environment variables that can be set are:

  • ILP_STORE : The name/path of the store module
  • ILP_STORE_OPTIONS : The options passed to the constructor, serialized as a JSON object.

The options object passed are a subset of the configuration object used in ilp-connector.