How do I send and receive Bitcoin? Get Started Bitcoin.com

RPC: listreceivedbyaddress and getreceivedbyaddress /r/Bitcoin

RPC: listreceivedbyaddress and getreceivedbyaddress /Bitcoin submitted by BitcoinAllBot to BitcoinAll [link] [comments]

[RPC] listreceivedbyaddress and getreceivedbyaddress /r/Bitcoin

[RPC] listreceivedbyaddress and getreceivedbyaddress /Bitcoin submitted by BitcoinAllBot to BitcoinAll [link] [comments]

How can I get this script to work for Litecoin 0.8.7.5?

What would I need to do to get this script to work for Litecoin 0.8.7.5? https://github.com/litecoin-project/litecoin/releases/tag/v0.8.7.5
 class Bitcoin { // Configuration options private $username; private $password; private $proto; private $host; private $port; private $url; private $CACertificate; // Information and debugging public $status; public $error; public $raw_response; public $response; private $id = 0; /** * @param string $username * @param string $password * @param string $host * @param int $port * @param string $proto * @param string $url */ function __construct($username, $password, $host = 'localhost', $port = 8332, $url = null) { $this->username = $username; $this->password = $password; $this->host = $host; $this->port = $port; $this->url = $url; // Set some defaults $this->proto = $host == 'localhost' ? 'http':'https'; $this->CACertificate = null; } /** * @param string|null $certificate */ function setSSL($certificate = null) { $this->proto = 'https'; // force HTTPS $this->CACertificate = $certificate; } function __call($method, $params) { $this->status = null; $this->error = null; $this->raw_response = null; $this->response = null; // If no parameters are passed, this will be an empty array $params = array_values($params); // The ID should be unique for each call $this->id++; // Build the request, it's ok that params might have any empty array $request = json_encode(array( 'method' => $method, 'params' => $params, 'id' => $this->id )); // Build the cURL session $curl = curl_init("{$this->proto}://{$this->username}:{$this->password}@{$this->host}:{$this->port}/{$this->url}"); $options = array( CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_FOLLOWLOCATION => TRUE, CURLOPT_MAXREDIRS => 10, CURLOPT_HTTPHEADER => array('Content-type: application/json'), CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $request ); if ($this->proto == 'https') { // If the CA Certificate was specified we change CURL to look for it if ($this->CACertificate != null) { $options[CURLOPT_CAINFO] = $this->CACertificate; $options[CURLOPT_CAPATH] = DIRNAME($this->CACertificate); } else { // If not we need to assume the SSL cannot be verified so we set this flag to FALSE to allow the connection $options[CURLOPT_SSL_VERIFYPEER] = FALSE; } } curl_setopt_array($curl, $options); // Execute the request and decode to an array $this->raw_response = curl_exec($curl); $this->response = json_decode($this->raw_response, TRUE); //error_log('this->response: '. print_r($this->response,true)); // If the status is not 200, something is wrong $this->status = curl_getinfo($curl, CURLINFO_HTTP_CODE); // If there was no error, this will be an empty string $curl_error = curl_error($curl); curl_close($curl); if (!empty($curl_error)) { $this->error = $curl_error; } if ($this->response['error']) { // If bitcoind returned an error, put that in $this->error $this->error = $this->response['error']['message']; } elseif ($this->status != 200) { // If bitcoind didn't return a nice error message, we need to make our own switch ($this->status) { case 400: $this->error = 'HTTP_BAD_REQUEST'; break; case 401: $this->error = 'HTTP_UNAUTHORIZED'; break; case 403: $this->error = 'HTTP_FORBIDDEN'; break; case 404: $this->error = 'HTTP_NOT_FOUND'; break; } } if ($this->error) { return FALSE; } return $this->response['result']; } } /* Address History Interface Class */ class AddressHistory { public $address = null; public $n_tx = 0; public $total_sent = 0; public $total_received = 0; public $balance = 0; public $final_balance = 0; public $txns = array(); public function __construct($txn=null) { if(! is_array($txn)) return null; if(array_key_exists('address', $txn)) $this->address = $txn['address']; if(array_key_exists('n_tx', $txn)) $this->n_tx = $txn['n_tx']; if(array_key_exists('total_sent', $txn)) $this->total_sent = $txn['total_sent']; if(array_key_exists('total_received', $txn))$this->total_received = $txn['total_received']; if(array_key_exists('balance', $txn)) $this->balance = $txn['balance']; if(array_key_exists('final_balance', $txn)) $this->final_balance = $txn['final_balance']; if(is_array($txn['txns'])) { foreach($txn['txns'] as $key => $this_txn) { $new_txn = array( 'hash' => $this_txn['hash'], 'block_height' => $this_txn['block_height'], 'value' => $this_txn['value'], 'spent' => $this_txn['spent'], 'spent_by' => $this_txn['spent_by'], 'confirmations'=> $this_txn['confirmations'] ); $this->txns[$key] = new TransRef($new_txn); } } else { $this->txns = null; } return $this; } } /* Transaction Reference Interface Class */ class TransRef { public $hash; public $block_height; public $value; public $spent; public $spent_by; public $confirmations; public function __construct($txnref=null) { if(! is_array($txnref)) return null; if(array_key_exists('hash', $txnref)) $this->hash = $txnref['hash']; if(array_key_exists('block_height', $txnref)) $this->block_height = $txnref['block_height']; if(array_key_exists('value', $txnref)) $this->value = $txnref['value']; if(array_key_exists('spent', $txnref)) $this->spent = $txnref['spent']; if(array_key_exists('spent_by', $txnref)) $this->spent_by = $txnref['spent_by']; if(array_key_exists('confirmations', $txnref)) $this->confirmations = $txnref['confirmations']; return $this; } } /* CoindRPC - JsonRPC Class to talk to bitcoind */ class CoindRPC extends Bitcoin { public function __construct() { return parent::__construct(WN_RPC_USER, WN_RPC_PASS, WN_RPC_HOST, WN_RPC_PORT); } public function __call($method, $params) { return parent::__call($method, $params); } public function get_address_balance($address, $confirmations=0) { try { $address_info = $this->validateaddress($address); if($address_info['isvalid'] == 1 && $address_info['ismine'] == 1) { $balance = $this->getreceivedbyaddress($address, $confirmations); } if($balance != '') { return floatval($balance); } else { return 0; } } catch (Exception $e) { error_log('error: '. print_r($e->getMessage(),true)); error_log('['.__LINE__.'] : '.__FILE__); } } public function get_address_history($address) { try { $address_info = $this->validateaddress($address); if($address_info['isvalid'] == 1 && $address_info['ismine'] == 1) { //- if only listening to one BTC account //$history = $this->listtransactions(WN_RPC_ACCT); $history = $this->listtransactions(); $txns = array(); $final_balance = $balance = 0; foreach($history as $txn) { if($txn['address'] != $address) continue; $n_tx = $total_received = $total_sent = 0; $n_tx = intval($addr_hist['n_tx']) + 1; switch($txn['category']) { case('receive'): $total_received = $addr_hist['total_received'] += $txn['amount']; $balance = $balance + $txn['amount']; //- can we trust final balance here? do we need more history $final_balance = $final_balance + $txn['amount']; break; case('send'): $total_sent = $addr_hist['total_sent'] += $txn['amount']; $balance = $balance + $txn['amount']; //- can we trust final balance here? do we need more history $final_balance = $final_balance + $txn['amount']; break; } $txns[] = array( 'hash' => $txn['txid'], 'value' => $txn['amount'], 'spent' => $txn['spent'], 'spent_by' => $txn['spent_by'], 'confirmations' => $txn['confirmations'], ); } $addr_hist = array( 'address' => $address, 'n_tx' => $n_tx, 'total_sent' => $total_sent, 'total_received' => $total_received, 'balance' => $balance, 'final_balance' => $final_balance, 'txns' => $txns ); $addr_hist = new AddressHistory($addr_hist); } else { $addr_hist = false; error_log('Address invalid: '.$address); error_log('['.__LINE__.'] : '.__FILE__); } return $addr_hist; } catch (Exception $e) { error_log('error: '. print_r($e->getMessage(),true)); error_log('['.__LINE__.'] : '.__FILE__); } } public function get_transaction($hash) { try { return $this->gettransaction($hash); } catch (Exception $e) { error_log('error: '. print_r($e->getMessage(),true)); error_log('['.__LINE__.'] : '.__FILE__); } } } /* Helper class */ class Helper { public static $api = null; public static $db = null; public function __construct($db, $api) { Helper::$api = $api; Helper::$db = $db; } public static function walletnotify_email($txnhead) { //- bitcoind calls walletnotify on 0 confirmations and 1. //- We only want email to go out on the first call. Otherwise //- if we want only one 1 confrime, change this to //- confirmations == 0) return; if($txnhead['confirmations'] > 0) return; $tmpl = file_get_contents('email.notify.tmpl.html'); foreach($txnhead as $key => $val) { $map['{'.$key.'}'] = $val; } $map['{timestamp}'] = date('Y-m-d H:i:s', WN_GLOBAL_TIMESTAMP); $map['{hostname}'] = php_uname('n'); $html = str_replace(array_keys($map), array_values($map), $tmpl); $txid_short = substr($txnhead['txid'], 0, 4).' .. '.substr($txnhead['txid'], -4); $msg = "=WNotify=". "\ntxid: ".$txid_short. "\nAmt : ".$txnhead['amount']. "\nCmnt: ".$txnhead['comment']. "\nAcct: ".$txnhead['account']. "\nConf: ".$txnhead['confirmations']. "\nCat : ".$txnhead['category']. "\nAddr: ".$txnhead['address']. ""; //- send to carrier's email to SMS gateway if configured if(defined('WN_SMS_ADMIN') && filter_var(WN_SMS_ADMIN, FILTER_VALIDATE_EMAIL)) { Helper::send_email_sms($msg, WN_SMS_ADMIN); } return Helper::send_email($html, 'WN:WalletNotify', WN_EMAIL_ADMIN);; } public static function send_email($msg, $subj, $to) { $headers = 'From: '.WN_EMAIL_FROM."\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; if(trim($msg) == '') return false; return mail($to, $subj, $msg, $headers); } public static function send_email_sms($msg, $to) { if(trim($msg) == '') return false; if($to == '') return false; $headers = 'From: '.WN_EMAIL_FROM."\r\n"; return mail($to, null, $msg."\n.", $headers); } } 
submitted by Mjjjokes to cryptodevs [link] [comments]

We'd like to sponsor an esports team

So, as you may know we have advertising budget on the subreddit thanks to your kind donations. Since Reddit is kind enough to advertise us for free with a sidebar ad, that money has been sitting idly by waiting for some good thing to spend it on.
Last time we used the money was to sponsor a StarCraft 2 tournament organized by TotalBiscuit. A lot of people enjoyed the show and we as mods thought it was money well spent promoting Bitcoin.
Today we figured, why not continue working with TotalBiscuit to promote our subreddit and currency? Luckily enough, he is running an esports team - Axiom, and they are taking sponsorship deals.
So, here is roughly the deal we are talking about:
What we get from this deal? Branding on:
As well as some small in-house Starcraft tournament.
At the moment we as mods are for the idea, but we would like to know your opinion. Would you like us to spend your generous donations on this?
submitted by ThePiachu to Bitcoin [link] [comments]

Trying to salvage some coins from 2013. Core (bitcoin-qt.exe v0.8.1-beta on Windows 8.1) is taking weeks to DL the blockchain as expected but keeps crashing now. Can I upgrade to a newer version without losing what I've gotten already (about 75% complete)?

Currently there are 134305 blocks remaining. When I start it up it works pretty smoothly for a while but then slows down. I leave it running while I'm gone but the last several days when I've come back it has crashed and gives me an I/O error, and I have to hit OK then start it back up. It does appear to be further along when I start it back up but not by a whole lot. So this has really slowed my progress. It's reindexed about 75% though, and so I don't want to start over from the beginning.
The drive it is on has ~400gb of free space so that's not the issue. I have 8gb of memory, and the task manager says bitcoin is taking up about 500mb, but it's using 60-85% of my cpu at a time.
If I download a newer version of core, I can just copy/paste the old wallet.dat file, right? But wouldn't it have to start downloading the entire blockchain again from the beginning? If so, is there any quicker method?
While typing this, it crashed twice. It only runs for about 10 minutes.
The version I have doesn't have any settings I can change. I read that there's a db size limit you can change in later versions that could help. This one does have a "debug window" with a command line console but I don't really know what to do with it. Here is a list of available commands: 
addmultisigaddress <'["key","key"]'> [account]
addnode
backupwallet
createmultisig <'["key","key"]'>
createrawtransaction [{"txid":txid,"vout":n},...] {address:amount,...}
decoderawtransaction
dumpprivkey
encryptwallet
getaccount
getaccountaddress
getaddednodeinfo [node]
getaddressesbyaccount
getbalance [account] [minconf=1]
getblock
getblockcount
getblockhash
getblocktemplate [params]
getconnectioncount
getdifficulty
getgenerate
gethashespersec
getinfo
getmininginfo
getnewaddress [account]
getpeerinfo
getrawmempool
getrawtransaction [verbose=0]
getreceivedbyaccount [minconf=1]
getreceivedbyaddress [minconf=1]
gettransaction
gettxout [includemempool=true]
gettxoutsetinfo
getwork [data]
help [command]
importprivkey [label] [rescan=true]
keypoolrefill
listaccounts [minconf=1]
listaddressgroupings
listlockunspent
listreceivedbyaccount [minconf=1] [includeempty=false]
listreceivedbyaddress [minconf=1] [includeempty=false]
listsinceblock [blockhash] [target-confirmations]
listtransactions [account] [count=10] [from=0]
listunspent [minconf=1] [maxconf=9999999] ["address",...]
lockunspent unlock? [array-of-Objects]
move [minconf=1] [comment]
sendfrom [minconf=1] [comment] [comment-to]
sendmany {address:amount,...} [minconf=1] [comment]
sendrawtransaction
sendtoaddress [comment] [comment-to]
setaccount
setgenerate [genproclimit]
settxfee
signmessage
signrawtransaction [{"txid":txid,"vout":n,"scriptPubKey":hex,"redeemScript":hex},...] [,...] [sighashtype="ALL"]
stop
submitblock [optional-params-obj]
validateaddress
verifymessage

submitted by closer_to_the_flame to Bitcoin [link] [comments]

$100 in Bitcoin to the first person to give me simple source code I can copy paste and it'll work.

source has to be super simple: 1) get the bitcoin received balance (from an arbitrary address) using getreceivedbyaddress/Address from https://blockchain.info/q 2) load it into a variable 3) display the variable
I need this in Vbscript or javascript to run on an HTML page.
PM me if you have questions.
goodluck!
submitted by cryptohoney to btc [link] [comments]

Bitcoin core not showing a receiving transaction

I sent from one bitcoin core to another bitcoin core. The transaction is unconfirmed as shown in blockchain.info
https://blockchain.info/tx/c552453ed645a8a5c30d123017efa92831fcd89a0508b11ae79a09e49210e749
But the receiving bitcoin core seems not received anything. Listtransactions do not show neither. mempool is high but hope this will catch up.
bitcoin-cli getreceivedbyaddress 1JWEnrxAcKRHCFshgJpcg4P62oiqiu1nQr 0.00917000
P.S. I don't want to run rescan as it will take days and I can't afford my system to be down for so long.
Will this catch up eventually ? Can I trigger a rebroadcast ?
submitted by daisykylim to Bitcoin [link] [comments]

Bitcoind, change to txindex=1

I have a fullnode without txindex. Some transactions of mine related to my wallet are not being found by fullnode, only in blockchain.info. My HD is around 130GB, and it's fully synced to the last block. I would like to know, if using txindex = 1, will solve my problem with transactions that are not found. Using txindex = 1 and -reindex, how long does it take to finish? Fullnode will have to download again the 130GB? Will increase storage?
For exemple: https://blockchain.info/pt/tx/1585045cf36e18829292eef72281c8a0a748488d960816437dbd0797d896adf9 This transaction send for 1BS3caAYJH5LTKprkbvhkSLVUhpa9QsvMp my wallet.
When i run bitcoin-cli getreceivedbyaddress 1BS3caAYJH5LTKprkbvhkSLVUhpa9QsvMp 0, result is 0.00000000 When i run bitcoin-cli gettransaction 1585045cf36e18829292eef72281c8a0a748488d960816437dbd0797d896adf9, resulti is error code: -5 error message: Invalid or non-wallet transaction id How i solve it ?
Thank you.
submitted by thamerphpmaster to Bitcoin [link] [comments]

BCH block explorer with API?

I am needing a (bitcoin cash) replacement for APIs that work only for BTC, like:
http://blockexplorer.com/q/getreceivedbyaddress/ [btc address here]
http://blockchain.info/q/getreceivedbyaddress/ [btc address][?confirmations=6]
I see blockdozer.com and blockchair.com have good block explorers for BCH chain but neither seems to have an API? any suggestions?
submitted by dank_memestorm to btc [link] [comments]

$100 in Bitcoin to the first person to give me simple source code I can copy paste and it'll work.

source has to be super simple: 1) get the bitcoin received balance (from an arbitrary address) using getreceivedbyaddress/Address from https://blockchain.info/q 2) load it into a variable 3) display the variable
I need this in Vbscript or javascript to run on an HTML page.
PM me if you have questions.
goodluck!
submitted by cryptohoney to Bitcoin [link] [comments]

How to find your Bitcoin wallet address on Luno.com - YouTube Coinbase - How to Find your Bitcoin wallet address - YouTube How to Trace a Bitcoin Transaction using a Bitcoin ... How to get a Bitcoin Wallet Address - FREE & in under a ... All about Blockchain. Send and receive. Locate your wallet address and hashcode

Bitcoin Cash Node documentation GitLab Home Setup instructions Release notes Release notes Release Notes for Bitcoin Cash Node version 22.0.0 Release notes 0.21.2 Release notes 0.21.1 Release notes 0.21.0 Bitcoin ABC 0.14.1-0.20 Bitcoin ABC 0.14.1-0.20 Release notes 0.20.12 Release notes 0.20.11 ... We can't show a full list of emails but we can check Bitcoin address related to email. Compromised Private Keys. Total: 3796799. Last week: +50758. Last month: +50758. Compromised, leaked, or popular private keys are collected via allprivatekeys.com service. Most addresses had good balances. Recently Abused Addresses: Total collected 185286 abuses for Bitcoin Addresses. For the last week ... getreceivedbyaddress "address" ( minconf ) Returns the total amount received by the given address in transactions with at least minconf confirmations. Arguments: 1. "address" (string, required) The bitcoin address for transactions. 2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times. Result: amount (numeric) The total amount in BTC received at ... getreceivedbyaddress "address" ( minconf ) Returns the total amount received by the given address in transactions with at least minconf confirmations. Arguments: 1. "address" (string, required) The bitcoin address for transactions. 2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times. Result: amount (numeric) The total amount in BTC received at ... Bitcoin-cli. Another change in the 0.9 release is moving away from the bitcoind executable functioning both as a server and as a RPC client. The RPC client functionality (“tell the running bitcoin daemon to do THIS”) was split into a separate executable, ‘bitcoin-cli’. The RPC client code will eventually be removed from bitcoind, but ...

[index] [35782] [19077] [9065] [50178] [46341] [5073] [20577] [36120] [27471] [24804]

How to find your Bitcoin wallet address on Luno.com - YouTube

If you want to find out more about the tools we have for cryptocurrency investors in our Masters area, see video here: https://moocharoo.ninja/bmm Also try: ... Tracking Bitcoin Transactions on the Blockchain - SANS DFIR Summit 2017 - Duration: 29:09. SANS Digital Forensics and Incident Response 8,931 views. 29:09. http://coinrepublic.com/ This video explains how to log into and get your Bitcoin Wallet Address in the Coinbase online wallet system. https://coinbase.com/?... The Crypto Dad shows you how to trace a Bitcoin transaction. Important software used is: Electrum bitcoin wallet: https://electrum.org/#home The Blockchain e... Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.

#