问题描述
我已经使用
安装了 pinata SDKnpm install --save @pinata/sdk
我正在使用 pinata 实现将文件添加到 IPFS 的代码
const pinataSDK= require('@pinata/sdk');
const pinata = pinataSDK('812f8a2d416d9be9afea','668516ac85834685ed785bcaec839f5ad1aeca099788cd8aa814ccdbad77d1bb');
console.log("entered");
pinata.testAuthentication().then((result) => {
//handle successful authentication here
console.log(result);
}).catch((err) => {
//handle error here
console.log(err);
});
const fs = require('fs');
const readableStreamForFile = fs.createReadStream('./naruto6.jpeg');
const options = {
pinataMetadata: {
name: MyCustomName,keyvalues: {
customKey: 'customValue',customKey2: 'customValue2'
}
},pinataOptions: {
cidVersion: 0
}
};
pinata.pinFiletoIPFS(readableStreamForFile,options).then((result) => {
//handle results here
console.log(result);
}).catch((err) => {
//handle error here
console.log(err);
});
我遇到了以下错误。
https://requirejs.org/docs/errors.html#notloaded
https://requirejs.org/docs/errors.html#mismatch
我已经安装了 require.js 节点模块。我无法正确理解错误。我是 js 的新手。请帮帮我。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)