transactions – ship bitcoins with out the bitcoin consumer in PHP

0
76


You have to to hook up with a bitcoin node in a method or one other to broardcast to the newtork. There are a variety of php and bitcoin open supply repos that can do that, take a look right here https://github.com/search?q=bitcoind+php&ref=cmdform

An alternative choice if you do not need to run the bitcoin consumer regionally is to hook up with an api to broadcast your transaction.

An instance I discovered for php connecting to blockchain.information is as follows

<?php

$guid="GUID_HERE";
$firstpassword="PASSWORD_HERE";
$secondpassword="PASSWORD_HERE";
$amounta = "10000000";
$amountb = "400000";
$addressa = "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq";
$addressb = "1ExD2je6UNxL5oSu6iPUhn9Ta7UrN8bjBy";
$recipients = urlencode('{
              "'.$addressa.'": '.$amounta.',
              "'.$addressb.'": '.$amountb.'
           }');

$json_url = "http://blockchain.information/service provider/$guid/sendmany?password=$firstpassword&second_password=$secondpassword&recipients=$recipients";

$json_data = file_get_contents($json_url);

$json_feed = json_decode($json_data);

$message = $json_feed->message;
$txid = $json_feed->tx_hash;

?>

Hope this helps

UPDATE: To run requests to the blockchain.information API you have to comply with the setup directions right here https://www.blockchain.com/api/blockchain_wallet_api

NOTE To make use of this API, you will have to run small native service which be answerable for managing your Blockchain Pockets. Your utility interacts with this service regionally through HTTP API calls. Click on right here for full setup directions on GitHub.

LEAVE A REPLY

Please enter your comment!
Please enter your name here