-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpublish-main.js
29 lines (25 loc) · 916 Bytes
/
publish-main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
This is the main publish file that aggregates the other publish libraries
and orchestrates them, so that one command can publish to different platforms.
*/
// Local libraries
const publishToFilecoin = require('./publish-filecoin')
const publishToPinata = require('./publish-pinata')
const publishToBch = require('./publish-bch')
async function publish () {
try {
// Publish to Filecoin
const cid = await publishToFilecoin()
console.log('Content added to Filecoin with CID:', cid)
console.log(`https://${cid}.ipfs.dweb.link/`)
// Publish to Pinata
await publishToPinata(cid)
// Public to BCH
const txid = await publishToBch(cid)
console.log(`\nBCH blockchain updated with new CID. TXID: ${txid}`)
console.log(`https://blockchair.com/bitcoin-cash/transaction/${txid}`)
} catch (err) {
console.error('Error while trying to publish app: ', err)
}
}
publish()