0
    const sources = files.map((file) => ({ path: `${file.index}${extension}`, content: file.buffer }));
        for await (const result of ipfs.addAll(sources, { wrapWithDirectory: true })) {
          Logger.log(`Uploaded: ${result.path}`);
          if (result.path === "") {
            rootCid = result.cid.toString();
          }
        }
    const sources = files.map((file) => ({ path: `root/${file.index}${extension}`, content: file.buffer }));
        for await (const result of ipfs.addAll(sources)) {
          Logger.log(`Uploaded: ${result.path}`);
          if (result.path === "root") {
            rootCid = result.cid.toString();
          }
        }

rootCid は上記の両方のコードで同じになりますが、 { wrapWithDirectory: true } は非常に遅くなります。どうしてこれなの?

4

0 に答える 0