forked from interplanaria/bitbus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
push.js
25 lines (25 loc) · 755 Bytes
/
push.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
require('dotenv').config()
const BITCOM = "15TaTqiH6NNUHPCudLaVQMDa5eEErmvvAC"
const datapay = require('datapay')
module.exports = function(filename) {
let j = require(process.cwd() + '/' + filename)
let s = JSON.stringify(j)
datapay.send({
data: [BITCOM, "push", s],
pay: { key: process.env.privateKey }
}, function(err, tx) {
if (err) {
console.log(err)
} else {
console.log("# Successfully published to Bitbus Network!")
console.log("# To browse the network visit https://bitbus.network, or run:")
console.log("")
console.log("bitbus ls")
console.log("")
console.log("# To use, run:")
console.log("")
console.log("bitbus pull " + tx)
console.log("")
}
});
}