Commit Graph

419 Commits

Author SHA1 Message Date
haad
f331b1b458 Refactor Manifest 2023-04-13 07:59:30 +03:00
haad
d979b98562 Add cache to IPFS AC storage 2023-04-13 07:59:19 +03:00
haad
0fed060711 Remove commented code 2023-04-12 09:34:43 +03:00
Haad
9fd01ff530 Merge pull request #64 from saul-jb/refactor/packages
refactor: Remove unused packages.
2023-04-07 07:38:28 +03:00
saul
99e1bd3f5f Remove redundant Promise.resolve. 2023-04-07 08:44:06 +12:00
Hayden Young
dadf4c34e7 refactor: Adhere to case naming convention for OrbitDB module. (#67) 2023-04-06 22:39:05 +08:00
Hayden Young
58518203c3 Merge pull request #69 from orbitdb/refactor/dbs
Refactor Databases
2023-04-06 22:32:26 +08:00
Hayden Young
0deaaf5541 Merge pull request #68 from orbitdb/refactor/naming
Renaming pass
2023-04-06 22:32:12 +08:00
haad
3030336db9 More refactoring 2023-04-06 15:25:42 +03:00
haad
eddf5b853b Refactor Database interface for configuration, add onUpdate callback 2023-04-06 10:00:52 +03:00
haad
d681bb720a Remove Log and Database dependency injection 2023-04-06 10:00:09 +03:00
haad
a94d2a7918 Renaming pass 2023-04-06 08:32:31 +03:00
saul
78432f2166 Fix wrong path join method being used. 2023-04-04 15:03:17 +12:00
saul
23aee1d1ec Remove p-map package and replace with Promise.all. 2023-04-04 14:05:25 +12:00
Hayden Young
428ce83878 Refactor/ac (#61)
* refactor: Move Manifest to own module.

* refactor: Modularize orbitdb access controller.

* chore: Check for correct access controller path and modify if necessary.

* fix: Linting.

* refactor: AC interface no longer needed.

* refactor: Move IPFS-specific AC list back into IPFS AC.

* refactor: Explicitly name access controller param.

* refactor: Pass in manifest settings as object.

* refactor: Config access controllers.

* refactor: ACs should expose specific params before being called with generic params.

* feat: Pass write access to root IPFS AC.

* refactor: AC should handle type prefix.

* test: Test for type.

* refactor: Pass generic access to Database (and inheriting dbs).

* refactor: Use AccessControllers module to manage custom ACs.

* chore: Remove excess console logging.

* test: Fix ipfs module import.
2023-04-03 19:56:47 +08:00
Haad
a027525e5c Merge pull request #57 from saul-jb/feat/path-refactor
feat: Remove dependence on path.
2023-03-29 18:20:11 +03:00
Haad
a5c14d5377 Fix log fetching parallelism (#60)
* Fix log traverse parallelism

* Rename pointerCount to referencesCount
2023-03-29 21:10:24 +08:00
saul
9ca2408453 Change default join to posix. 2023-03-29 10:39:54 +13:00
saul
194ecafb0a Fix issue using posix paths with win32 join. 2023-03-29 10:13:19 +13:00
haad
52fc82a859 Fix joinEntry traversing by checking refs both ways 2023-03-28 11:29:25 +03:00
Haad
bb99931440 Merge pull request #52 from saul-jb/fix/top-async
fix: Move top-level await to method.
2023-03-28 10:47:18 +03:00
saul
35a6bf121c Remove is-defined util. 2023-03-28 15:01:21 +13:00
saul
3c79588778 Fix process undefined error in browsers. 2023-03-28 13:04:08 +13:00
saul
06a68bbe1c Replace usages of path with path join util. 2023-03-28 12:55:15 +13:00
saul
7ce1257cf9 Add posix and win32 variations to path join. 2023-03-28 12:55:11 +13:00
saul
cf421ee669 Add path joining utility. 2023-03-28 12:16:42 +13:00
saul
f064deafb1 Move the cache back outside the verify message method. 2023-03-28 08:55:45 +13:00
Haad
fddcd0d775 Fix tests (#51)
* Fix error event test in Sync tests

* Fix race condition

* Debug timeouts

* More tests fixing

* Try running local webrtc-star-signalling server for tests

* Fix sync tests

* Skip Log references tests in the browser tests
2023-03-27 20:09:26 +08:00
Haad
4fe1b0c1a1 Add Entry index to Log (#48)
* Turn off IPFS console.log output for tests

* Fix replication and sync tests

* Close keystore after tests in IPFSAccessController tests

* Fix error event test in Sync tests

* Fix race condition

* Add entry index to Log

* Clean up storage files

* Fix tests

* Fix linter
2023-03-27 18:09:44 +08:00
saul
82fcc830ec Replace usage of Buffer with Uint8Array. 2023-03-27 11:23:36 +13:00
saul
29ba745e4a Move top-level await to method. 2023-03-27 09:16:47 +13:00
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