-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add attestation registry for metadata uploads (#58)
* Stub manifest creation & registry upload command * Parameterize upload --------- Co-authored-by: Seth Feibus <sefeibus@gmail.com>
- Loading branch information
1 parent
b3c5353
commit 472b7bf
Showing
6 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@babel/env", "@babel/preset-react"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
build/ | ||
node_modules/ | ||
.env | ||
dist/ | ||
gateway/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
async function uploadToIpfs(content) { | ||
const helia = await createHelia(); | ||
const heliaInstance = json(helia); | ||
|
||
const cid = await heliaInstance.add(content); | ||
try { | ||
console.log("===================================="); | ||
console.log("Added file:", cid); | ||
console.log("Added file:", cid.toString()); | ||
console.log("===================================="); | ||
return cid; | ||
} catch (e) { | ||
throw new Error(`Error uploading content to IPFS: ${e}`); | ||
} | ||
} | ||
|
||
module.exports = { uploadToIpfs }; |