remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/apps/remix-ide/ci/publishIpfs

19 lines
685 B

#!/usr/bin/env node
const ipfsClient = require('ipfs-http-client')
console.log('current folder', process.cwd())
const folder = process.cwd() + '/temp_publish_docker';
(async () => {
const host = 'ipfs.komputing.org' // ethdev berlin ipfs node
const ipfs = ipfsClient({ host, port: 443, protocol: 'https' })
try {
let result = await ipfs.addFromFs(folder, { recursive: true, pin: false })
const remoteFolder = result[result.length - 1]
console.log('ipfs://' + remoteFolder.hash)
console.log('https://ipfsgw.komputing.org/ipfs/' + remoteFolder.hash)
console.log('https://gateway.ipfs.io/ipfs/' + remoteFolder.hash)
} catch (e) {
console.log(e)
}
})()