ipfs-shipyard / ipfs-shipyard/tevere

Persist data across page reloads / multiple browsers

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
58
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Hello Pedro, thanks again for building this. I was wondering if it's possible to use this as an actual database to persist data across sessions. I might be confused about the inner workings of this or I am mistaking it for something different entirely. Currently I'm using Memdown as the log storage and levelup to access the leveldown API like this:

const Tevere = require('tevere');
const Memdown = require('memdown');
const levelup = require('levelup');

const db = Tevere('coolpartition', {
  log: Memdown('coolpartition'),
});

const tevere = levelup(db);

tevere.put('boo', 'foo', (err) => {
  console.log(err);
});

// This is being done after a page reload
tevere.get('boo', (err, val) => {
  console.log(err);
  console.log(val);
});

but I'm getting a Not Found error when getting the key after a page refresh.

Is it possible to persist the data across sessions and browsers? How's the log db actually used?

Furthermore I'm getting this error when running the above script:

Uncaught Error: no protocol with name: p2p-webrtc-star

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Tevere initialization using the log option and the levelup get/put example, then trace how Memdown behaves after a page reload and how p2p-webrtc-star is registered. Done should establish whether cross-session and cross-browser persistence is supported, document the required storage and protocol setup, and account for the reported Not Found and protocol errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.