Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this was basically copied directly from the ipfs documentation
- const validCID = 'QmQ2r6iMNpky5f1m4cnm3Yqw8VSvjuKpTcK1X7dBR1LkJF' // await loadIpfsHashFromGithub();
- const stream = ipfs.getReadableStream(validCID)
- pull(
- stream,
- pull.collect((err, files) => {
- if (err) {
- throw err
- }
- files.forEach((file) => {
- ipfs.addPullStream({ path: file.path.toString, content: file.content});
- console.log('Serving: ', file.path.toString())
- })
- })
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement