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