Bitcoinjs-lib: How to broadcast a transaction?

Created on 4 Aug 2017  路  10Comments  路  Source: bitcoinjs/bitcoinjs-lib

Hello,

I'm new to BTC and wouldn't want to screw things up. Lets say I can craft and sign a new tx with this library. How do I send it to the network?

how to / question / docs

Most helpful comment

Use this: https://blockchain.info/pushtx
or
https://blockr.io/tx/push
or similar.

(You can push with multiple sites and it's safe)

All 10 comments

Use this: https://blockchain.info/pushtx
or
https://blockr.io/tx/push
or similar.

(You can push with multiple sites and it's safe)

If you have a bitcoind node: sendrawtransaction, or use an API as @arunoda suggested

Hello @arunoda it seems i cant find an API for any of that.

just regular http form.

curl -d '{"hex":"TX_HASH"}' http://btc.blockr.io/api/v1/tx/push

From https://blockr.io/documentation/api~~

edit: blockr is gone

POST https://blockchain.info/pushtx

For blockchain.info

New here

Half the links on this thread points to Coinbase's API on my end..
So just to be clear, your official recommendation is to use a third-party API to broadcast?

So just to be clear, your official recommendation is to use a third-party API to broadcast?

3rd party, 1st party, it doesn't matter, bitcoinjs-lib doesn't connect to the bitcoin network, so you need to use something else. But that something can be your own bitcoind node.

Ahh alright, makes more sense now. Still getting the hang of things :)

Hi.

I have a bitcoind but I don't know how to broadcast a transaction.

Thanks.

sendrawtransaction RPC call or cli.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rbndg picture rbndg  路  3Comments

Beardcoding picture Beardcoding  路  3Comments

tuyennvtb picture tuyennvtb  路  3Comments

coingeek picture coingeek  路  4Comments

ishwarchandratiwari picture ishwarchandratiwari  路  3Comments