If I have a Bitcore transaction:
var simpleTx = new bitcore.Transaction();
simpleTx.to(req.body.destination, amount);
simpleTx.sign(privateKey);
var txSerialized = simpleTx.toObject();
How do I broadcast it to the Bitcoin network ?
After Googling, I found this, but it didn’t work.
var insight = new Insight();
insight.broadcast(txSerialized, function(err, returnedTxId) {
if (err) {
// Handle errors...
} else {
// Mark the transaction as broadcasted
}
});
I just want to create a transaction and send it. It shouldn’t be that complicated. The library should make it simple.
How do I submit a transaction ? What’s the easiest way ?