ipfs-shipyard / js-did-ipid

The IPID DID method implementation in JavaScript
MIT License
21 stars 9 forks source link

Compatibility with ipfs-http-client #37

Closed kuhlmannmarkus closed 1 year ago

kuhlmannmarkus commented 3 years ago

Im trying to use did-ipid with an instance of ipfs-http-client, but get the following error:

Uncaught (in promise) HTTPError: file argument 'key' is required

My code looks like this (similar to the example on the README.md):

const ipid = await createIpid(ipfs);
const didDocument = await ipid.create(pem, (document) => {
    const publicKey = document.addPublicKey({
        type: 'RsaVerificationKey2018',
        publicKeyHex: '02b97c30de767f084ce3080168ee293053ba33b235d7116a3263d29f1450936b71',
    });

    const authentication = document.addAuthentication(publicKey.id);

    const service = document.addService({
        id: 'hub',
        type: 'HubService',
        serviceEndpoint: 'https://hub.example.com/',
    });
});

Everything works as expected, when I hand over an instance of ipfs-core. The error only appears when attempting the exact same thing with an instance of ipfs-http-client. POST requests are allowed on my node and CORS is also not the problem. This might also be an issue with ipfs-http-client though. Maybe someone here could give me some directions.

ipfs-core@0.8.0 ipfs-http-client@50.1.2 did-ipid@0.4.1 go-ipfs v0.8.0

Thanks in advance!