fix: re-encode cid to be a webapp
This commit is contained in:
parent
b03234e38e
commit
8e963d4b04
|
@ -1,4 +1,4 @@
|
||||||
import { encodeCid } from "@lumeweb/libportal";
|
import { decodeCid, encodeCid } from "@lumeweb/libportal";
|
||||||
import {
|
import {
|
||||||
BOOTSTRAP_NODES,
|
BOOTSTRAP_NODES,
|
||||||
CID_HASH_TYPES,
|
CID_HASH_TYPES,
|
||||||
|
@ -18,6 +18,7 @@ import fromAsync from "array-from-async";
|
||||||
import * as util from "util";
|
import * as util from "util";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
CID,
|
||||||
concatBytes,
|
concatBytes,
|
||||||
hexToBytes,
|
hexToBytes,
|
||||||
loginActivePortals,
|
loginActivePortals,
|
||||||
|
@ -124,12 +125,15 @@ processedFiles
|
||||||
|
|
||||||
const serializedMetadata = pack(metadata);
|
const serializedMetadata = pack(metadata);
|
||||||
|
|
||||||
const [cid, err] = await uploadObject(serializedMetadata);
|
let [cid, err] = await uploadObject(serializedMetadata);
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error("Failed to publish: ", err);
|
console.error("Failed to publish: ", err);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cid = decodeCid(cid) as CID;
|
||||||
|
cid = encodeCid(cid.hash, cid.size, CID_TYPES.METADATA_WEBAPP);
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
util.format("%s: %s", chalk.green("Web App successfully published"), cid),
|
util.format("%s: %s", chalk.green("Web App successfully published"), cid),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue