Class: KeyValueStore

api. KeyValueStore

Abstract class for a Key-Value store. The Chain class uses this store to save sensitive information such as authenticated user's private keys, certificates, etc. The SDK provides a default implementation based on files. An alternative implementation can be specified using the "KEY_VALUE_STORE" environment variable pointing to a full path to the require() package for the module.

new KeyValueStore()

Methods


getValue(name)

Get the value associated with name.
Parameters:
Name Type Description
name string of the key
Returns:
Promise for the value corresponding to the key. If the value does not exist in the store, returns null without rejecting the promise

setValue(name, value)

Set the value associated with name.
Parameters:
Name Type Description
name string of the key to save
value string to save
Returns:
Promise for the 'value' object upon successful write operation
Type
Promise