377 Commits

Author SHA1 Message Date
Hayden Young
222c7234fe refactor: Rename manifest store. 2023-06-22 01:10:12 +01:00
Hayden Young
a525d91e8f docs: Expose access controllers/identity providers/dbs directly. Remove get* functions for AC/IP/DB loaders. 2023-06-21 21:19:35 +01:00
Hayden Young
4c3a338205 refactor: Standardize module loader functions. Do not expose module lists. 2023-06-18 03:05:07 +01:00
Hayden Young
8b93553d0e refactor: Move database type management to db module. 2023-06-18 02:43:03 +01:00
Hayden Young
6def69f345
Identity issue (#82)
* docs: Correctly print out db query results.

* test: Remove concurrent.

* test: Remove unimplemented and 3rd party AC tests.

* test: Remove unimplemented and 3rd party identity tests.

* docs: Move jsdoc config to conf directory.

* Point package.json main at index.js to access all exported functions.

* test: Identities storage pointing at wrong location.

* refactor: Identities is configurable when creating an OrbitDB instance.
2023-06-13 23:55:25 +08:00
Hayden Young
7975ac42b9 Merge branch 'main' into HEAD 2023-06-07 22:48:55 +01:00
Hayden Young
b9e573dc6d
feat: Expose identity provider managers. (#75)
* feat: Expose identity provider managers.

* refactor: Remove unnecessary provider tools.

* refactor: Match AC management to other management mechanisms (e.g. Identity Providers).
2023-06-02 02:53:40 +08:00
Zoltan Erdos
297293874b fix: fileName casing issue 2023-05-27 09:17:23 +01:00
Hayden Young
794136c762
refactor: Functionize identity provider. (#74)
* refactor: Functionize identity provider.

* docs: Building a custom identity provider.

* refactor: Functionize clock.
2023-05-25 00:48:01 +08:00
Hayden Young
60fbe47ee3
Jsdocs (#73)
* fix: Load correct main.

* docs: Enable markdown.

* docs: Add jsdoc blocks.

* docs: Separate orbitdb into module and namespace.

* docs: Database module and namespace.

* docs: Default values for storage.

* docs: Match param naming across modules.

* docs: Use @link where possible.

* docs: Use @example for code.

* docs: KeyStore module and namespace documentation.

* docs: API for Access controller management.

* docs: Document Database events.

* docs: Formatting.

* docs: Notes on Custom AC and including a canAppend function.

* docs: Standardize primitive data types.

* docs: Proposed submodule structure.

* docs: Composed storage. How to create custom storage.

* docs: annotations for all storage modules.

* docs: Documents.

* docs: KeyValueIndexed.

* docs: Provide example for specifying storage for keyvalue.

* docs: KeyValue.

* docs: Remove const documentation where not required.

* docs: KeyStore static functions.

* docs: Identities.

* docs: Identity.

* refactor: Remove unused param.

* docs: Address.

* docs: Address.

* docs: Manifest.

* docs: IPFSAccessController.

* docs: OrbitDBAccessController.

* docs: Utils.

* test: check for correct message.
2023-05-18 03:34:44 +08:00
Hayden Young
5ab0bcdbf5
Docs (#66)
* docs: Access controllers.

* test: Re-open an existing db using its address.

* docs: Simple db interaction.

* docs: Basic Identities.

* docs: Storage.

* docs: Implementing a custom database.

* docs: Example OrbitDB AC.

* docs: Use identity id when customizing access.

* docs: canAppend.

* docs: Graphically describe log joining.

* docs: Update db types.

* docs: Sync-ing.

* docs: Reverse flow arrows.

* docs: Logical clock.

* docs: DB address and manifest.

* docs: Move ops description to db.

* docs: CRDT.

* docs: Peer discovery, connecting ipfs nodes, orbitdb replication.

* docs: Change file name case to match other documentation solutions (e.g. IPFS/libp2p).

* docs: Links to CRDT papers.

* docs: A getting started to get up and running quickly.

* docs: Move replication to own readme.

* docs: Links to various js-libp2p connection config.

* docs: Examples for connecting two node servers.

* docs: Server to browser connection.

* docs: Replication how-to.

* docs: Remove SYNC.

* docs: Simplify oplog discussion.

* docs: Connecting to IPFS in the browser.

* docs: Topics moved to separate docs.
2023-05-05 00:33:36 +08:00
haad
b1d16fc7b4 Cleanups 2023-04-13 08:26:41 +03:00
haad
fca6439399 Add "bail" option to mocha config 2023-04-13 08:25:52 +03:00
haad
0bef6f65a6 Remove obsolete code 2023-04-13 08:25:37 +03:00
haad
f331b1b458 Refactor Manifest 2023-04-13 07:59:30 +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
Hayden Young
dadf4c34e7
refactor: Adhere to case naming convention for OrbitDB module. (#67) 2023-04-06 22:39:05 +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
7a9e002ead Remove and replace p-map-series with Promise.all. 2023-04-04 14:11:57 +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
9c1af3deb8 Fix test descriptions. 2023-03-29 11:15:44 +13:00
saul
ce5e177813 Skip path join tests in environments where it is undefined. 2023-03-29 11:10:09 +13:00
saul
3335c8b698 Cleanup path join tests. 2023-03-29 10:47:38 +13:00
saul
ed28fb4136 Expand test with harder tests. 2023-03-29 10:37:10 +13:00
saul
d3162d898f Add path join tests. 2023-03-29 09:57:48 +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
Haad
893e34451d
Merge pull request #53 from saul-jb/feat/buffer-refactor
feat: remove dependence on buffer/safe-buffer
2023-03-27 07:05:42 +03:00
saul
1c16a7155c Replace ipfs package with ipfs-core. 2023-03-27 12:59:51 +13:00
saul
2845c138c5 Remove buffer usage from tests. 2023-03-27 11:48:30 +13:00
saul
b0483a1b60 Fix public key test. 2023-03-27 11:24:21 +13: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
8e7dade867
Merge pull request #37 from orbitdb/test/address
Add a test for OrbitDBAddress
2023-03-09 12:04:35 +02:00
haad
503f3aba6f Add a test for OrbitDBAddress 2023-03-09 12:03:05 +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