ReadError: Database is not open
ateeqrehmani opened this issue · comments
I am currently using the following package versions:
"ipfs": "^0.54.5"
"orbit-db": "^0.26.0"
I have two questions.
- During the initialization of my database, I follow these steps:
`const ipfsOptions = { repo: './ipfs', pubsub: true };
const ipfs = await IPFS.create(ipfsOptions);
const identityOptions = { id: process.env.DB_NAME };
const identity = await Identities.createIdentity(identityOptions);
const orbitdb = await OrbitDB.createInstance(ipfs, { identity: identity });
const optionsToWrite = {
create: true,
overwrite: false,
localOnly: false,
type: 'docstore',
accessController: {
write: [orbitdb.identity.id],
},
};
const db = await orbitdb.docs(process.env.ORBITDB, optionsToWrite);
`
To save data using the put method, I use the following code:
await this.db.load(); const hash = await this.db.put({ _id: poolIdentity.toLowerCase(), values }, { pin: true }); await this.db.close(); return hash;
Everything works fine for 2 to 3 days. However, when the data grows, the database gets corrupted and starts throwing the error "ReadError: Database is not open" While retrieval works ok.
- All the data is currently stored locally in the ipfs and orbitdb folders. I would like to make this data publicly accessible, similar to the following examples:
https://ipfs.io/ipfs/QmUtrVBEFCG5K8MWxkEq81H2SDTLwetRxjggCKMS9zivfK/
https://ipfs.io/ipfs/QmUsoSkGzUQnCgzfjL549KKf29m5EMYky3Y6gQp5HptLTG/
This should be fixed in 1.0.0. Note the new package name.
If the issue persists, feel free to re-open the issue.