js-ipfs

ipfs.add is not working for ipfs client v44.3.0 how can I resolve this?

久未见 提交于 2020-07-09 12:06:41
问题 This is my code in App.js, and its always returning an "Unhandeled Rejection Type error saying that ipfs.add(...). then is not a function. import React, { Component } from 'react'; import './App.css'; var ipfsAPI = require('ipfs-http-client') var ipfs = ipfsAPI({host: 'localhost', port: '5001', protocol:'http'}) class App extends Component { saveTestBlobOnIpfs = (blob) => { return new Promise(function(resolve, reject) { const descBuffer = Buffer.from(blob, 'utf-8'); ipfs.add(descBuffer).then(