Should I install bitcoin daemon to my server for broadcast a transaction into bitcoin network?
Should I install bitcoin daemon to my server for broadcast a transaction into bitcoin network?
I'm a newbie about bitcoin things. I have an app idea which includes bitcoin transaction processes.
When i searched web about it I just found code sample below.
var bitcoin = require('bitcoinjs-lib');
// define bitcoin addrewss we want to transfer coins from
var key = bitcoin.ECPair.fromWIF("L1Kzcyy88LyckShYdvoLFg1FYpB5ce1JmTYtieHrhkN65GhVoq73");
var txb = new bitcoin.TransactionBuilder();
// (in)15000 - (out)12000 = (fee)3000, this is the miner fee
// Alice's previous transaction output, has 15000 satoshis
txb.addInput('61d520ccb74288c96bc1a2b20ea1c0d5a704776dd0164a396efec3ea7040349d', 0);
txb.addOutput('1cMh228HTCiwS8ZsaakH8A8wze1JR5ZsP', 12000);
txb.sign(0, key);
As you can see I can prepare a transaction correctly but how can I broadcast it to bitcoin network?
When I keep going to searching I also found a few bitcoin client libraries for node but all of that have code lines below.
var client = new bitcoin.Client({
host: 'localhost',
port: 8332,
user: 'user',
pass: 'pass'
});
What's this credentials? Should I run a bitcoin server/daemon or something like that for broadcast transactions to bitcoin network?
Thanks in advance.
http://ift.tt/2nqj934
Comments
Post a Comment