Skip to content

This repository contains code to replicate an issue with OrbitDB.

Notifications You must be signed in to change notification settings

chrispanag/orbit-db-pubsub-issue-replication

Repository files navigation

Pubsub Issue Replication

This repository contains code to replicate the following issue with OrbitDB. Whenever more than 6 orbitdb databases are created/opened, the number of pubsub topics open are less than the number of databases. The bug found has been encountered when using either go-ipfs v0.9.1 or v0.11.0. (it has not been tested with earlier versions or v0.10.0)

How to run

Prerequisites

This code expects a running go-ipfs v0.11.0 daemon with the pubsub experiment enabled on localhost:5001.

You can start it using the following command:

ipfs daemon --enable-pubsub-experiment

Commands

Install dependencies with yarn (you could also use npm)

  • To run the orbitdb test, run the following command: node test-orbitdb-pubsub.js
  • To run the ipfs-http-client pubsub test, run the following command: node test-pubsub-only.js
  • To try to subscribe to pubsub topics through the CLI, run the following command: ./test-pubsub-only.sh

What this code does

test-pubsub-only.js

This code creates a number of pubsub topics based on the value of the NUMBER_OF_TOPICS constant. Then, it proceeds to compare the number of topics opened to the number of pubsub topics the IPFS node is actually subscribed to.

test-orbitdb-pubsub.js

This code creates a number of OrbitDB databases based on the value of the NUMBER_OF_DATABASES constant. Then, it proceeds to compare the number of databases open to the number of pubsub topics the IPFS node is subscribed to.

./test-pubsub-only.sh

This shell script subscribes to 10 pubsub topics and prints them on the console. It is used as a reference.

About

This repository contains code to replicate an issue with OrbitDB.

Resources

Stars

Watchers

Forks