orbitdb / field-manual

The Offical User's Guide to OrbitDB
207 stars 43 forks source link

Where does orbitdb data are Stored? #103

Open kottackalthulasi opened 4 years ago

kottackalthulasi commented 4 years ago

where does orbitdb data are stored? I lost all data while copied the same project folder to another location.

My code is given below:

const ipfsOptions = {
            EXPERIMENTAL: {
              pubsub: true
            }
          }

          // Create IPFS instance
          const ipfs = new IPFSS(ipfsOptions)

          ipfs.on('error', (e) => console.error(e))
          ipfs.on('ready', async () => {
            const orbitdb = await OrbitDB.createInstance(ipfs)
            const db = await orbitdb.docs(account )
              console.log(db);
              await db.load();
              await db.put(results.data)
              var fulldata = db.get(' ');
              console.log(fulldata);

 })
aphelionz commented 4 years ago

You can pass a directory option to the OrbitDB.createInstance call like this:

const orbitdb = OrbitDB.createInstance(ipfs, { directory: 'path/to/data/' })
kottackalthulasi commented 4 years ago

I tried it.. But actually no use... no data are getting stored in that folder.

RichardLitt commented 4 years ago

@aphelionz where is it stored if you don't add the directory option?

vasa-develop commented 4 years ago

I think in the ./orbitdb dir