Open maxkerp opened 6 years ago
Okay long story short, I think since orbit-db-cli
is only used with node
and not in the browser datastore-fs
should be used here instead of datastore-level
:
I modified my fork to do this and it works just as expected with js-ipfs
. go-ipfs
still complains about the Datastore.Spec
missing in the config
of the ipfs repo
, but this is probably an issue for ipfs/js-ipfs-repo
.
Is there a specific reason why datastore-level
is used @haadcode ?
I base my assumptions on https://github.com/ipfs/js-ipfs-repo/blob/master/README.md#background
Deleting lines 5-11 and omitting the config object when calling new IPFSRepo
causes ipfs-repo
to use datastore-fs
by default and makes it possible to jsipfs object get <manifest hash>
.
What I'm trying to accomplish:
I want to examine single
ipfs objects
created byorbit-db-cli
withgo-ipfs
orjs-ipfs
. Given a<hash>
from adding to afeed
-store withorbitdb add <address> 'Hello World!'
, then I want toipfs object get <hash>
orjsipfs object get <hash>
respectively.This didn't work at all in the last couple of days, but now I'm at the point that I can make sense of the error messages.
What I think is wrong
The way
orbit-db-cli
sets up theipfs repo
is somewhat off, especially the/blocks
subdirectory .Take a look at my global
~/.ipfs
repo created bygo-ipfs init
Now take a look at the
ipfs repo
created byorbit-cb-cli
:And the following was created by a
node script
using theorbit-db
module.How I came to that conclusion
Examining the
orbit-db-cli
ipfs repo
yields following results:and
The
js-ipfs
implementation tells me, that there need to be the sharded directories and files under the/blocks
directory, which is not the case when usingorbit-db-cli
. If I use anode script
to create anorbitdb
database it creates theipfs repo
correctly with the sharded directories under./<ipfs repo>/blocks
and examining theipfs objects
works perfectly fine withjsipfs object get <hash>
.Notes
It seems that the
go-ipfs
implementation:/keystore
instead of/keys
under./<ipfs repo>
. (Has nothing to do with this issue, but maybe that'll be important latter? :sweat_smile: )Whatever module creates the
ipfs repo
fororbit-db-cli
it does not create it how it is expected.If you use the tool ldb and look at the
/blocks
directory oforbit-db-cli
ipfs repo
you will find keys inleveldb
what the/blocks
directory should have looked like.Solution
So far I don't know what really causes this and how to fix it, but I might be able to find the cause of the problem on Saturday. I hope this helps anyone playing around with
orbitdb
. A workaround is to usenode scripts
to createorbitdb
s and usejs-ipfs
to examine theipfs objects
.