Created
November 6, 2019 20:29
-
-
Save iamonuwa/483c097b50f6e1f2b677a9111b49c40b to your computer and use it in GitHub Desktop.
Revisions
-
iamonuwa created this gist
Nov 6, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ const tx = await arweave.createTransaction( { data: JSON.stringify(data) }, key ); console.log(tx); tx.addTag("App-Name", "demo"); tx.addTag("App-Version", "0.0.1"); tx.addTag("Unix-Time", Math.round(new Date().getTime() / 1000)); tx.addTag("Type", "publish"); console.log(tx); await arweave.transactions.sign(tx, key); console.log(tx.id); let { status } = await arweave.transactions.post(tx);