New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rip-db-js

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rip-db-js

RipDB is a dead simple, snappy, decentralized JSON store perfect for fast moving web3 builders. It comes with a javascript client that feels like using localstorage, but has decentralization and encryption baked in.

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-60%
Maintainers
1
Weekly downloads
 
Created
Source

RipDB (Redis + IPfs = RIP)

RipDB is a dead simple, snappy, decentralized JSON store perfect for fast moving web3 builders. It comes with a javascript client that feels like using localstorage, but has decentralization and encryption baked in.

img

Demo

https://zdenham.github.io/redis-ipfs/

Motivation

The SQL database is a powerful tool unrivaled for storing and querying relational data.

BUT, I believe most Dapps can live without a traditional SQL database in favor of something more light weight and decentralized.

Here are some problems with setting up a db for your dapp

  1. There are already many great services which index blockchain data (why reinvent the wheel?)
  2. DBs are expensive to host
  3. Migrations are often a pain
  4. They tend to be centralized / treasure trove for attackers
  5. They usually don't give users provenance over their data
  6. Encryption / key management is a pain

If a traditional db seems overkill for your use case, RIP might be for you. It gives you the speed of in memory cache (redis) but the decentralization of a global netowrk (Filecoin + IPFS), with some ther goodies like encryption.

Example use case

In my own project (https://juicelabs.io), I needed some sort of store for a list of allowlist addresses (to calculate merkle proofs). Database seemed like a lot. I wanted something closer to an in memory store like Redis, but I wanted better redundancy / cold storage, and thus the idea for RIP came to be.

Usage from browser js client

// Setting up client
import { RipClient } from './RipClient'
const ripServerUrl = '';

const rip = new RipClient({ ripServerUrl });

...

const myJson = { hello: 'RIP world' };
await rip.set('myJsonKey', myJson, { encrypt: false });

...

const { data } = await rip.get('myJsonKey');

...

// reclaims memory, but preserves data on IPFS
await rip.purge('myJsonKey');


☠️ simple or what?

Running your own RipDb Instance

You will need to set up a redis instance first.

The fastest way to do this on your local is via homebrew.

> brew install redis
> brew services start redis

Under your environment variables you will need to set IPFS

TODO

  • Expose RIP client and Rip server as node_modules
  • Implement other Redis operations e.g. scan on the front end client
  • Maybe, build key -> data models in typescript, get graphql style automatic runtime validation during set based on the typescript models COOL: https://github.com/gcanti/io-ts
  • Get fancier with user owned access control features

FAQs

Package last updated on 26 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc