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

level db files created, but gun using ./data.json as well #50

Open
southbite opened this issue May 10, 2018 · 1 comment
Open

level db files created, but gun using ./data.json as well #50

southbite opened this issue May 10, 2018 · 1 comment

Comments

@southbite
Copy link

southbite commented May 10, 2018

I am doing what was specified in readme, snippet:

 const levelDB = levelup(
      encode(
        leveldown(this.opts.file),
        { valueEncoding: 'json' }
      )
    );

    this.db = new Gun({level: levelDB, web: this.httpServer});

The leveldb folder is created and the data is in there but I still get the warning:
"WARNING! This file.js module for gun is intended for local development testing only!"

And the data is also in a data.json that gets put in my module root. This may be a gun issue or some configuration I am missing?

Sorry in advance if I am missing anything basic here.

@southbite
Copy link
Author

southbite commented May 10, 2018

duh, went back to the docs, to prevent gun from persisting to a json file when you already have level-up persistence, do this:

const levelDB = levelup(
      encode(
        leveldown(this.opts.file),
        { valueEncoding: 'json' }
      )
    );
    //both radisk and localStorage must be set to false
    this.db = new Gun({level: levelDB, radisk:false, localStorage:false, web: this.httpServer});

oddly both radisk and localStorage must be false, otherwise I get other errors like:
BUG WARNING: Radix Storage Engine (RSE) has a known rare edge case, if data gets split between file chunks, a GET may only return the first chunk!!!

You guys are welcome to close this, but I suggest we update the README with an explanation so others wont be persisting data to level and the standard json file at the same time.

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

1 participant