orbit-db-types icon indicating copy to clipboard operation
orbit-db-types copied to clipboard

not compatible with ipfs-http-client

Open onichandame opened this issue 3 years ago • 2 comments

Problem

The ipfs-http-client package is now shipped with types, and those types seem to conflict with the IPFS type we are using in this package.

Steps to Reproduce

import createIpfs from 'ipfs-http-client'
import OrbitDb from 'orbit-db'

type IPFS = ReturnType<typeof createIpfs>

// This line does not pass ts check
const createOrbitDbInstance = (ipfs:IPFS) => OrbitDb.createInstance(ipfs)

Possible Solutions

Since orbit db is able to consume an ipfs-http-client instance, this problem should be considered as a bug. Possible solutions are:

  1. change the IPFS type to the minimum so that it does not cover anything non-compatible with the official IPFS types

Any more thoughts?

onichandame avatar Jan 29 '21 10:01 onichandame

@onichandame and @lmarianski . I have added a PR with a potential fix for this issue. Please let me know whether this looks okay to you and how to proceed from here.

mboogerd avatar May 22 '21 09:05 mboogerd

Great work! But I am not using OrbitDB anymore so probably a maintainer could better help you.

onichandame avatar May 22 '21 15:05 onichandame