IPFS Plugin
See original GitHub issueHeya! Awesome library! Transloadit hits again 😃 I’m long user and supporter of node-formidable
which was created by @felixge, stating it was created for Transloadit. And it’s pretty awesome, still, after so many years. Strongly believe that it should be rewritten, but anyway.
I’m playing with the API and looks great and easy. I’m thinking to try to create IPFS plugin, but documenting it here for reminder and if anyone else want it.
const upload = (buff, opts) => {
const options = Object.assign({
permanent: false,
protocol: 'https',
host: 'ipfs.infura.io',
port: 5001
}, opts)
const ipfs = IpfsApi(options)
ipfs.files.add(buff).then((result) => {
const hash = result[0].hash
const url = `https://ipfs.io/ipfs/${hash}`
console.log('step 1', url)
// behind option called `permanent: true`?
if (options.permanent === true) {
ipfs.pin.add(hash).then((res) => {
console.log('step 2', res[0].hash)
})
}
})
}
Also would be great to support upload from url which in turn is pretty easy with ipfs.util.addFromUrl
const ipfs = IpfsApi({
protocol: 'https',
host: 'ipfs.infura.io',
port: 5001
})
ipfs.util.addFromURL('https://avatars3.githubusercontent.com/u/5038030')
.then(console.log)
related is https://github.com/ipfs/js-ipfs-api/issues/674 - for adding support for pin
option to addFromURL utility
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:15
Top Results From Across the Web
IPFS Companion
ABOUT IPFS Companion harnesses the power of your locally running IPFS node (either through the IPFS Desktop app or the command-line daemon) ...
Read more >IPFS Companion - GitHub
Browser extension that simplifies access to IPFS resources on the web - GitHub - ipfs/ipfs-companion: Browser extension that simplifies access to IPFS ......
Read more >IPFS Companion
The IPFS Companion browser extension allows you to interact with your IPFS node and the extended IPFS network through your browser. Learn how...
Read more >IPFS Companion – Get this Extension for Firefox (en-US)
IPFS Companion harnesses the power of your locally running IPFS node (either through the IPFS Desktop app or the command-line daemon) directly inside...
Read more >IPFS in Code Plugins - UE Marketplace - Unreal Engine
IPFS is a decentralized storage protocol, that allows you to upload, ... Important note: from December 2022 IPFS plugin will be provided for ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @tunnckoCore ,
I did some experimenting with it - and what works really well is just using the
XHRUpload
plugin for that:This uploads to IPFS - and you get all the features of the
XHRUpload
plugin like progress monitoring etc.Kudos for the super nice uppy project !
Ookey, but one more thing. How can we direct all to the XHRUpload so that all files from all the sources will be uploaded to the IPFS?Sweeeeeet! 🎉 Passing the Infura to
serverUrl
works. Just thought it won’t that’s why i commented.