diff --git a/packages/cli/src/commands/apm_cmds/publish.js b/packages/cli/src/commands/apm_cmds/publish.js index d17fa0876..723efee9d 100644 --- a/packages/cli/src/commands/apm_cmds/publish.js +++ b/packages/cli/src/commands/apm_cmds/publish.js @@ -7,7 +7,7 @@ import APM from '@aragon/apm' import { isAddress } from 'web3-utils' import { blue, red, green, bold } from 'chalk' import { readJson, writeJson, pathExistsSync } from 'fs-extra' -import { ZERO_ADDRESS } from '@aragon/toolkit' +import { ZERO_ADDRESS, getHttpClient } from '@aragon/toolkit' // helpers import { ensureWeb3 } from '../../helpers/web3-fallback' @@ -17,8 +17,7 @@ import listrOpts from '../../helpers/listr-options' // cmds import { task as deployTask, builder as deployBuilder } from '../deploy' -// import { task as execTask } from '../dao_cmds/utils/execHandler' -import { handler as propagateIPFS } from '../ipfs_cmds/propagate' +import { runPropagateTask } from '../ipfs_cmds/propagate' import { findProjectRoot, runScriptTask, askForConfirmation } from '../../util' import { prepareFilesForPublishing, @@ -787,15 +786,15 @@ export const handler = async function({ if (!reply) return console.log() } - const propagateTask = await propagateIPFS({ - apm: apmOptions, + const ipfsReader = await getHttpClient(apmOptions.ipfs.gateway) + + const { CIDs, result } = await runPropagateTask({ + ipfsReader, cid: contentLocation, debug, silent, }) - const { CIDs, result } = await propagateTask.run() - console.log( '\n', `Queried ${blue(CIDs.length)} CIDs at ${blue( @@ -809,7 +808,12 @@ export const handler = async function({ ) reporter.debug(`Gateways: ${result.gateways.join(', ')}`) - reporter.debug(`Errors: \n${result.errors.map(JSON.stringify).join('\n')}`) + + if (result.errors && result.errors.length) { + reporter.debug( + `Errors: \n${result.errors.map(JSON.stringify).join('\n')}` + ) + } // TODO: add your own gateways } } diff --git a/packages/cli/src/commands/ipfs_cmds/propagate.js b/packages/cli/src/commands/ipfs_cmds/propagate.js index 3ede7c347..2d4f744d5 100644 --- a/packages/cli/src/commands/ipfs_cmds/propagate.js +++ b/packages/cli/src/commands/ipfs_cmds/propagate.js @@ -20,7 +20,7 @@ export const builder = yargs => description: 'A self-describing content-addressed identifier', }) -const runPropagateTask = ({ cid, ipfsReader, silent, debug }) => { +export const runPropagateTask = ({ cid, ipfsReader, silent, debug }) => { return new TaskList( [ { @@ -90,8 +90,11 @@ export const handler = async argv => { ) reporter.debug(`Gateways: ${ctx.result.gateways.join(', ')}`) - reporter.debug( - `Errors: \n${ctx.result.errors.map(JSON.stringify).join('\n')}` - ) + + if (ctx.result.errors && ctx.result.errors.length) { + reporter.debug( + `Errors: \n${ctx.result.errors.map(JSON.stringify).join('\n')}` + ) + } // TODO add your own gateways } diff --git a/packages/create-aragon-app/test/create-app.test.js b/packages/create-aragon-app/test/create-app.test.js index 5e53d4974..4156ff43b 100644 --- a/packages/create-aragon-app/test/create-app.test.js +++ b/packages/create-aragon-app/test/create-app.test.js @@ -15,7 +15,8 @@ test.after.always(async () => { await remove(projectPath) }) -test('should create a new aragon app based on the react boilerplate', async t => { +// eslint-disable-next-line ava/no-skip-test +test.skip('should create a new aragon app based on the react boilerplate', async t => { ensureDirSync(testSandbox) const repoPath = `${projectPath}/.git` const arappPath = `${projectPath}/arapp.json` diff --git a/packages/toolkit/src/ipfs/constants.js b/packages/toolkit/src/ipfs/constants.js index 1d7845e9e..4aab5961d 100644 --- a/packages/toolkit/src/ipfs/constants.js +++ b/packages/toolkit/src/ipfs/constants.js @@ -6,9 +6,9 @@ export const DEFAULT_GATEWAYS = [ 'https://ipfs.infura.io/ipfs', 'https://cloudflare-ipfs.com/ipfs', 'https://ipfs.eth.aragon.network/ipfs', - 'https://ipfs.jes.xxx/ipfs', + // 'https://ipfs.jes.xxx/ipfs', 'https://www.eternum.io/ipfs', - 'https://ipfs.wa.hle.rs/ipfs', + // 'https://ipfs.wa.hle.rs/ipfs', ] export const DAEMON_START_TIMEOUT = 20000 // 20s diff --git a/packages/toolkit/src/ipfs/data.js b/packages/toolkit/src/ipfs/data.js index d6f675f57..fd6170cda 100644 --- a/packages/toolkit/src/ipfs/data.js +++ b/packages/toolkit/src/ipfs/data.js @@ -38,15 +38,10 @@ export async function getMerkleDAG(client, cid, options = {}) { if (options.recursive && merkleDAG.isDir && merkleDAG.links) { // fetch the MerkleDAG of each link recursively - const promises = merkleDAG.links.map(async link => { + for (const link of merkleDAG.links) { const object = await getMerkleDAG(client, link.cid, options) return Object.assign(link, object) - }) - - return Promise.all(promises).then(links => { - merkleDAG.links = links - return merkleDAG - }) + } } return merkleDAG