Module: Storage

Storage backends for OrbitDB.

Source:

Namespaces

Storage-Composed
Storage-IPFS
Storage-LRU
Storage-Level
Storage-Memory

Methods

(async) ComposedStorage(storage1, storage2) → {module:Storage.Storage-Composed}

Creates an instance of ComposedStorage.

Parameters:
Name Type Description
storage1 module:Storage

A storage instance.

storage2 module:Storage

A storage instance.

Source:
Returns:

An instance of ComposedStorage.

Type
module:Storage.Storage-Composed

(async) IPFSBlockStorage(params) → {module:Storage.Storage-IPFS}

Creates an instance of IPFSBlockStorage.

Parameters:
Name Type Description
params Object

One or more parameters for configuring IPFSBlockStorage.

Properties
Name Type Attributes Default Description
ipfs IPFS

An IPFS instance.

pin boolean <optional>
false

True, if the block should be pinned, false otherwise.

timeout number <optional>
defaultTimeout

A timeout in ms.

Source:
Returns:

An instance of IPFSBlockStorage.

Type
module:Storage.Storage-IPFS

(async) LRUStorage(paramsopt) → {module:Storage.Storage-LRU}

Creates an instance of LRUStorage.

Parameters:
Name Type Attributes Default Description
params Object <optional>
{}

One or more parameters for configuring LRUStorage.

Properties
Name Type Attributes Default Description
size string <optional>
defaultSize

The number of elements to store.

Source:
Returns:

An instance of LRUStorage.

Type
module:Storage.Storage-LRU

(async) LevelStorage(paramsopt) → {module:Storage.Storage-Level}

Creates an instance of LevelStorage.

Parameters:
Name Type Attributes Default Description
params Object <optional>
{}

One or more parameters for configuring LevelStorage.

Properties
Name Type Attributes Default Description
path string <optional>
defaultPath

The Level path.

valueEncoding string <optional>
defaultValueEncoding

Value encoding.

Source:
Returns:

An instance of LevelStorage.

Type
module:Storage.Storage-Level

(async) MemoryStorage() → {module:Storage.Storage-Memory}

Creates an instance of MemoryStorage.

Source:
Returns:

An instance of MemoryStorage.

Type
module:Storage.Storage-Memory