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)
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
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
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.
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.
This shell script subscribes to 10 pubsub topics and prints them on the console. It is used as a reference.