Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create cljs wrapper for OrbitDB #20

Open
madvas opened this issue May 5, 2020 · 0 comments
Open

Create cljs wrapper for OrbitDB #20

madvas opened this issue May 5, 2020 · 0 comments
Assignees

Comments

@madvas
Copy link
Contributor

madvas commented May 5, 2020

Create CLJS wrapper (cljs-orbit-db) for https://github.com/orbitdb/orbit-db
API is here https://github.com/orbitdb/orbit-db/blob/master/API.md
Probably you'll need to create cljsjs of the library first.
Primarily we wanna use https://github.com/orbitdb/orbit-db-eventstore but looks like all db types are included in the main library, so we can make API for all, at least it'll allow us to try different approaches quickly.
We wanna be able to pass and retrieve cljs data structures without having to do clj->js js->clj, including data from callbacks, when using this library. It's possible that there will be some problems with this, depending how it stores js objects in ipfs files, you'll see. Orbitdb uses primarily promises, the wrapper don't need to change that, since we can use https://clojurescript.org/guides/promise-interop#using-promises-with-core-async.

Also we'll need to use https://github.com/orbitdb/orbit-db-access-controllers, which exists as a separate library, but maybe we can include it in our wrapper if it's possible. Just the tricky part there is that it uses javascript class extending, which seems to be bit tricky to do in cljs (https://stackoverflow.com/questions/61040644/clojurscript-extend-a-javascript-class). Maybe there's some other way, I just searched briefly. Ideally we wanna give it clojure idiomatic API, just a function call(s).

Library can have similar structure as our web3 lib. No macros, unless necessary. Also include simple tests in the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants