orbitdb-archive / orbit-db-pubsub

Message propagation module for orbit-db
MIT License
19 stars 14 forks source link

TypeError: this._ipfs._libp2pNode.dialProtocol is not a function #10

Closed aphelionz closed 6 years ago

aphelionz commented 6 years ago
/home/ubuntu/persistent-peers/base-peer/node_modules/orbit-db-pubsub/node_modules/ipfs-pubsub-room/src/connection.js:50
      this._ipfs._libp2pNode.dialProtocol(peerAddresses[0], PROTOCOL, (err, conn) => {
                             ^

TypeError: this._ipfs._libp2pNode.dialProtocol is not a function

My code in its entirety is below

class PersistentPeer {
  constructor(ipfsPath) {
    var ipfsConfig = {
      config: {
        "Addresses": {
          "Swarm": [
            '/dns4/redacted.com/tcp/9091/wss/p2p-websocket-star'
          ]
        }
      },
      EXPERIMENTAL: {
        pubsub: true
      }
    };

    if(ipfsPath) {
      ipfsConfig.repo = ipfsPath + "/_ipfs";
    }

    this.ipfs = new IPFS(ipfsConfig);
    this.ipfs.on('error', (e) => console.error(e));
    this.ipfs.once('ready', () => this._setupOrbitDB.apply(this));
  }

  async _setupOrbitDB() {
    this.orbitdb = new OrbitDB(this.ipfs);
    this.postDBCreation();
  }

  async postDBCreation() {

  }
}
aphelionz commented 6 years ago

Upgraded ipfs to 0.28.x and fixed it.