|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
var _ = require('lodash');
|
|
|
|
var program = require('commander');
|
|
|
|
var Client = require('../lib/client');
|
|
|
|
var utils = require('./cli-utils');
|
|
|
|
program = utils.configureCommander(program);
|
|
|
|
|
|
|
|
program
|
|
|
|
.usage('[options] <txpid>')
|
|
|
|
.parse(process.argv);
|
|
|
|
|
|
|
|
var args = program.args;
|
fix bit cmds: address, addresses, balance, broadcast, confirm, history, reject, rm, send, sign, status & txproposals
10 years ago
|
|
|
var txpid = args[0] || '';
|
|
|
|
|
fix bit cmds: address, addresses, balance, broadcast, confirm, history, reject, rm, send, sign, status & txproposals
10 years ago
|
|
|
utils.getClient(program, function (client) {
|
|
|
|
client.getTxProposals({}, function(err, txps) {
|
|
|
|
utils.die(err);
|
fix bit cmds: address, addresses, balance, broadcast, confirm, history, reject, rm, send, sign, status & txproposals
10 years ago
|
|
|
|
|
|
|
var txp = utils.findOneTxProposal(txps, txpid);
|
|
|
|
client.broadcastTxProposal(txp, function(err, txp) {
|
|
|
|
utils.die(err);
|
|
|
|
console.log('Transaction Broadcasted: TXID: ' + txp.txid);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|