Bitcoin Forum
September 30, 2025, 11:19:47 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Bitcoin Technical Support / Re: can't get walletnotify to work on: February 13, 2015, 06:36:26 PM
Make sure you're modifying the right php.ini
php -i|grep php.ini
should tell you the location of the php.ini file
php -i|grep argc_argv
should tell you if register_argc_argv is really on.



Make sure you're modifying the right php.ini
php -i|grep php.ini
should tell you the location of the php.ini file
php -i|grep argc_argv
should tell you if register_argc_argv is really on.


apperantly I was editing the wrong ini file, but now I edited the right one and when i call
Code:
php-i|grep argc_argv
, it returns
Code:
register_argc_argv => On => On
,
though when it still shows the error "Undefined variable: argc"

Maybe the fact that there is 2 "on"s means that I did something wrong?

Do you know which variables i would use in nodejs instead of "argc" and "argv"?
2  Bitcoin / Bitcoin Technical Support / can't get walletnotify to work on: February 13, 2015, 02:51:17 PM
Hey,

I'm trying to Setup a script that executes whenever my wallet receives a Transaction and found out that walletnotify is a good solution to that.  Though there is really only one helpful thread about this on here and that thread's solution didn't work for me.(https://bitcointalk.org/index.php?topic=203438.0)
I would prefer do this with nodejs, though I don't know nodejs's equivalent to argv and argv, so I tried the php solution that the above thread suggests:

my bitcoin.conf:
Code:
bitcoin.conf:
server=1
daemon=1
rpcuser=user
rpcpassword=password
walletnotify =/usr/bin/php /var/www/laravel/app/views/walletnotify.php %s

my walletnotify.php:
Code:
if(2==$argc){
require_once('/var/www/laravel/app/controllers/easybitcoin.php');
$bitcoin = new Bitcoin('user', 'password', 'localhost', '8332');

$walletinfo = $bitcoin->getinfo();
$trxinfo = $bitcoin->gettransaction($argv[1]);

// Append data to the file
$new = "\n\nTransaction hash: ".$argv[1]."\nGetinfo balance: ".$walletinfo["balance"]
."\n Gettransaction amount: ".$trxinfo["amount"]
."\n Gettransaction confirmations: ".$trxinfo["confirmations"]
."\n Gettransaction blockhash: ".$trxinfo["blockhash"]
."\n Gettransaction blockindex: ".$trxinfo["blockindex"]
."\n Gettransaction blocktime: ".$trxinfo["blocktime"]
."\n Gettransaction txid: ".$trxinfo["txid"]
."\n Gettransaction time: ".$trxinfo["time"]
."\n Gettransaction timereceived: ".$trxinfo["timereceived"]
."\n Gettransaction account: ".$trxinfo["details"][0]["account"]
."\n Gettransaction address: ".$trxinfo["details"][0]["address"]
."\n Gettransaction category: ".$trxinfo["details"][0]["category"]
."\n Gettransaction amount: ".$trxinfo["details"][0]["amount"]
//."\n Gettransaction fee: ".$trxinfo["details"][0]["fee"]
$fp=fopen("notify_wallet.txt","a");
fwrite($fp,$new);
}

with this i got the error "Undefined variable: argc", so I did some Research that led me to putting this into my php.ini(line 650):

Code:
register_argc_argv = On

I'm still getting the "undefined variable: argc" error though.

If anyone could help me out here, I would highly appreciate it!(If anyone knows how to do this with nodejs, that would be even better!)
3  Bitcoin / Bitcoin Technical Support / How to get instant message on new block in bitcoind on: February 12, 2015, 10:53:38 AM
Hey,

I'm using nodejs & bitcoind. I would like nodejs to emit a message via websockets whenever a new block was found or a new tx was broadcasted. I know i could do that with the blockchain.info websocket API, but i would like to do it locally. The only way I can think of to emit every new block right when it reaches my Server would be an AJAX longpoll, since i dont know when I want to emit the newest block, because I dont know any way of getting the new block instantly.

Is there any way to emit a message every time a new block/tx is broadcasted to me?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!