You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 30, 2023. It is now read-only.
*[Creating Custom Data Stores](#creating-custom-data-stores)
42
43
-[Contributing](#contributing)
43
44
-[License](#license)
@@ -58,17 +59,22 @@ Base class for [orbit-db](https://github.com/orbitdb/orbit-db) data stores. You
58
59
the following properties are optional:
59
60
60
61
-`maxHistory` (Integer): The number of entries to load (Default: `-1`).
62
+
-`syncLocal` (Boolean): Load local database before performing any append operations. (Default: `false`).
63
+
-`fetchEntryTimeout` (Integer): The number in `ms` specifying a timeout when fetching entries from IPFS. (Default: `null`).
61
64
-`referenceCount` (Integer): The number of previous ipfs-log entries a new entry should reference (Default: `64`).
62
65
-`replicationConcurrency` (Integer): The number of concurrent replication processes (Default: `128`).
63
66
-`accessController` (Object): An instance of AccessController with the following [interface](https://github.com/orbitdb/orbit-db-access-controllers/blob/master/src/access-controller-interface.js). See [orbit-db-access-controllers](https://github.com/orbitdb/orbit-db-access-controllers) for more information on how to create custom access controllers. By default only the owner will have write access.
67
+
-`sortFn` (Function): A function used to sort ipfs-log entries (Default: `undefined`).
64
68
-`onClose` (Function): A function to be called with a string of the OrbitDB address of the database that is closing.
69
+
-`onDrop` (Function): A function to be called with the orbit-db-store instance when the database is being removed.
70
+
-`onLoad` (Function): A function to be called with the orbit-db-store instance when the database is being loaded.
65
71
66
72
### Public methods
67
73
68
-
#### load([amount])
74
+
#### load([amount], [opts])
69
75
> Load the database using locally persisted state.
70
76
71
-
Returns a **Promise** that resolves once complete. Provide an `amount` argument to specify how many entries to load.
77
+
Returns a **Promise** that resolves once complete. Provide an optional `amount` argument to specify how many entries to load. By default the `maxHistory` option is used. Provide an optional `options` object with a `fetchEntryTimeout` property to be used when loading entries from IPFS.
72
78
73
79
#### loadMoreFrom(amount, entries)
74
80
> TODO
@@ -78,6 +84,10 @@ Returns a **Promise** that resolves once complete. Provide an `amount` argument
Each store has an `identity` property containing the public key used with this store to sign and access entries. This `publicKey` property of `identity` is the peer/node/user key.
Returns a **Promise** that resolves to the IPFS Multihash of the added entry. Takes`data` as a parameter which can be of any type.
246
+
Returns a **Promise** that resolves to the IPFS Multihash of the added entry. Takes`data` as a parameter which can be of any type. Provide an optional `options` arguement, which is an object with the following properties:
247
+
248
+
-`onProgressCallback` (Function): To be called once the data is appended.
249
+
-`pin` (Boolean): To specify whether or not to pin the entry inIPFS. (Default:`false`).
0 commit comments