Commit Graph

388 Commits

Author SHA1 Message Date
haad
2308f01a99 Fix Sync state 2023-03-26 08:35:06 +03:00
haad
2501f8c9de Add LRUStorage to identities 2023-03-25 14:30:48 +02:00
haad
39f5face5a Add optional flag to disable automatic sync per database 2023-03-25 12:34:02 +02:00
Hayden Young
b9422463d0 chore: Check required params. (#46)
* chore: Check required params.

* fix: Linting.

* feat: Specify a list of peers with write access.

* test: Identify OrbitDB tests.

* test: IPFS access controller.

* test: Omit "OrbitDB" from test labels.

* test: Correctly set write options.

* fix: Linting.
2023-03-25 06:00:08 +08:00
Hayden Young
3ff24c298f test: Connecting to multiple orbitdb instances and multiple databases… (#45)
* test: Connecting to multiple orbitdb instances and multiple databases. Replicating data across multiple dbs.

* test: Higher level orditdb test. Name is accordingly.

* test: Test multiple db stores.

* test: Delete test dirs.

* feat: buffer all records from iterator.

* fix: Linting.

* test: Re-enable all tests.

* test: Wait for replication to complete on all dbs.

* test: Rename storage test file.

* test: Remove unnecessary tests.

* test: Close dbs.

* test: Count all the connecting peers.
2023-03-25 02:35:19 +08:00
Hayden Young
2a563bac79 refactor: Return hash. (#44) 2023-03-18 02:53:52 +08:00
Hayden Young
1990cb9b87 Test/sync (#43)
* test: Re-enable skipped tests.

* test: Re-enable all tests.

* test: Wait for final entry when evaluating onSynced.

* test: Check if latest append is head to determine if sync has completed.

* test: Do not rely on order of sync-ed entries.

* docs: Sync-ing notes.

* docs: Simplify dial and pubsub explanation. Formatting.

* refactor: Check for required params.

* docs: Explain initial sync and pubsub updates.

* test: Save updated heads during sync.

* test: Remove extraneous expected entries.

* test: For eventual consistency.

* chore: Remove console.logs. Log errors using error event.

* chore: Remove extraneous asyncs.
2023-03-17 04:33:39 +08:00
Hayden Young
aabfd4e2bc feat: Configurable heads and entry storage. (#42)
* feat: Configurable heads and entry storage.

* fix: Linting.

* test: Re-enable all tests.

* test: Custom entry storage.

* test: Check for heads paths.

* fix: Check for path using fs.
2023-03-14 05:42:05 +08:00
Hayden Young
a40bc8bdcf Test/database (#38)
* test: Database.

* test: Remove caching test. Caching is superseded by the various storage options.

* test: db2 replicates data in existing db1.

* test: Move event tests to generic database tests.

* test: Single instance cleanup.

* fix: Linting.

* Fix Sync race condition (#39)

* test: Fix key path import.

---------

Co-authored-by: Haad <haadcode@users.noreply.github.com>
2023-03-11 21:01:05 +08:00
Haad
bc816c7e2e Browser tests (#41)
* Get browsers tests running

* Clean up replication test

* Setup fixtures for browser tests

* Fix import paths for webpack

* Fix webpack

* Add mocha-headless-chrome to run browser tests

* Add webrtc swarm endpoints for browser test IPFS node configs

* Remove adding pubkey to storage in KeyStore

* Runs browser tests in CI

* Fix import paths again

* Fix failing browser tests

* Fixes
2023-03-11 18:56:23 +08:00
haad
d1e59a95b7 Make it possible to add custom database types 2023-03-10 11:32:07 +02:00
haad
57de45bac6 Add tests for the Sync protocol 2023-03-09 11:55:20 +02:00
Haad
61276008ea Merge pull request #35 from orbitdb/fix/manifest-meta-data
Fix passing in database manifest meta data
2023-03-09 10:15:10 +02:00
haad
6140c0dc07 Fix passing in database manifest meta data 2023-03-09 10:13:39 +02:00
haad
611fb35330 Fix tests for deleting a key-value pair 2023-03-09 09:57:32 +02:00
haad
3008529511 Fix linter 2023-03-09 09:12:14 +02:00
haad
bb6fa4ca1a Add 'amount' parameter to keyvalue iterator 2023-03-09 09:10:25 +02:00
haad
e951d2265d Add 'amount' parameter to documents iterator 2023-03-09 08:52:35 +02:00
haad
ec3f5cbfa0 Fix database address usage 2023-03-09 08:38:47 +02:00
haad
0bc17bd9f5 Cached default storage for Database 2023-03-09 08:37:53 +02:00
haad
27b4885d8e Manifest storage 2023-03-09 08:37:29 +02:00
haad
946aefd4f6 Fix ComposedStorage 2023-03-09 08:35:57 +02:00
haad
bf1165fd08 Don't double save IPFS access controller, clean up 2023-03-09 08:33:25 +02:00
Hayden Young
4a5c59449b fix: Check for new heads. 2023-03-07 20:35:46 +00:00
Hayden Young
113d954b42 refactor: Load LRU first. 2023-03-07 11:38:34 +00:00
Hayden Young
885fc5f02c test: Load keys into storage and retrieve from keystore. 2023-03-06 22:21:17 +00:00
Hayden Young
1fb02ea4cb refactor: Throw any storage errors when adding a key. 2023-03-06 17:56:38 +00:00
Hayden Young
7396a4ac64 fix: Linting. 2023-03-06 16:36:25 +00:00
Hayden Young
53369de51c test: default and custom options. 2023-03-06 16:34:51 +00:00
haad
4c31514a1b Refactor names and functions in Sync 2023-03-03 09:05:10 +02:00
haad
ebdafaa248 Improve sync protocol event handling 2023-03-03 07:38:25 +02:00
haad
eacada3ab2 Don't use secp256k1.publicKeyConvert function 2023-03-02 10:08:07 +02:00
haad
9f50fb5e53 Use js-ipfs only in tests 2023-03-02 09:08:17 +02:00
haad
739ddc9ded Disable Ethereum and DID identity providers for now 2023-03-02 08:32:28 +02:00
haad
2c6e40c0f1 Fix identity storage path and clean up tests 2023-03-02 07:24:21 +02:00
haad
26752f2cfb Delete fs-shim 2023-03-02 07:11:31 +02:00
haad
fbc76b4b31 Clean up oplog tests 2023-03-02 07:08:05 +02:00
haad
de15c6250b Expose storage modules from OrbitDB index 2023-03-02 05:50:40 +02:00
haad
4a7d3f0720 Move files, clean up 2023-03-01 18:16:06 +02:00
haad
a063b3fb4a Refactor OrbitDB
Fix sync
Fix linter
Fix tests
Clean up
Set default references count to 0
Fix sync
Use address instead of databaseId
Sync protocol
Keep references to open databases in OrbitDB
Fix append benchmark
Initial version of heads exchange
Remove Feed
Fix KeyValuePersisted iterator
Refactor OrbitDBAddress a bit more
Add rest of the database types
Refactor OrbitDB addresses
Initial version for the full circle
Initial structure and tests for new OrbitDB
Make sure KeyStore is open when a Database is created
Re-organize OrbitDB
Use new databases and Log
More clean up
Add 'drop' event to Database
Clean up OrbitDB
Remove id from OrbitDB
Use new KeyStore and Identities
Remove storage from OrbitDB
Remove migrations from OrbitDB
Remove caches from OrbitDB
Remove pubsub from OrbitDB
2023-03-01 16:21:07 +02:00
haad
1575f00912 Add new test keys fixtures database 2023-03-01 14:49:00 +02:00
Hayden Young
f6368c2645 feat: Implement new keystore across tests. 2023-03-01 10:01:17 +00:00
Hayden Young
ba71a7985e feat: Use composite storage for key store. 2023-02-28 16:30:36 +00:00
Hayden Young
0c5c44e429 refactor: Generate keys using crypto. 2023-02-28 03:34:55 +00:00
Hayden Young
8b16332bd6 feat: Default cache size. 2023-02-27 16:12:08 +00:00
Hayden Young
45770b05ac feat: Default keystore location. 2023-02-27 16:10:50 +00:00
Hayden Young
bf86156f9f refactor: Use KeyStore as function. Export signMessage and verifyMessage to avoid clashes with similarly named functions. 2023-02-27 02:42:18 +00:00
Hayden Young
7cd2831a82 fix: Missing KeyValue verify. 2023-02-26 23:25:43 +00:00
Hayden Young
2e8530e7b1 test: Persisted keyvalue with KeyStore. 2023-02-26 23:23:27 +00:00
Hayden Young
13f02ba580 refactor: Defaults. 2023-02-26 18:16:06 +00:00