Title: Get transactions from bitcoin core or bitcoind Post by: torbente on January 06, 2016, 04:28:07 PM Hi everyone.
Im been reading the forums for some years. I actually have my own faucet and im working to develop another web site which will accept bitcoins. To keep the website, i also developed a desktop application in delphi, which makes all a lot easier. The program process the .csv files that bitcoin core generates and automatically update de server database. Until this point everything works perfect and secure. The program itself its fully automatic: every 15 minutes, it checks adresses.csv and transactions.csv and update to the server database what is required. But i need manually export the .csv files from the bitcoin core, so if someone send me money, it is not reflected in the server until i do this. Is there anyway to make this automatic? What i want is someting like this. c:/program files/bitcoin/bitcoind export addresses to c:/myfolder/myaddressesfile.csv c:/program files/bitcoin/bitcoind export transactions to c:/myfolder/mytransactionsfile.csv Is any workaround for this? I tried it for weeks and i dont find nothing usefull. Thanks you in advance. Title: Re: Get transactions from bitcoin core or bitcoind Post by: achow101 on January 06, 2016, 07:26:44 PM You can use the command line and RPC commands getaddressesbyaccount and listtransactions to get the addresses and transactions respectively.
Title: Re: Get transactions from bitcoin core or bitcoind Post by: torbente on January 06, 2016, 07:53:52 PM You can use the command line and RPC commands getaddressesbyaccount and listtransactions to get the addresses and transactions respectively. I know it can be done, but i dont have idea how ??? Using testnet? I try connecting to the daemon with json-rpc but i was unable. There are not a shortcut to generate the .csv files from the commandline? I have the feeling that the solutions is very easy but im missing something. Title: Re: Get transactions from bitcoin core or bitcoind Post by: achow101 on January 06, 2016, 08:38:23 PM You can use the command line and RPC commands getaddressesbyaccount and listtransactions to get the addresses and transactions respectively. I know it can be done, but i dont have idea how ??? Using testnet? I try connecting to the daemon with json-rpc but i was unable. There are not a shortcut to generate the .csv files from the commandline? I have the feeling that the solutions is very easy but im missing something. Title: Re: Get transactions from bitcoin core or bitcoind Post by: torbente on January 06, 2016, 11:13:33 PM You can use the command line and RPC commands getaddressesbyaccount and listtransactions to get the addresses and transactions respectively. I know it can be done, but i dont have idea how ??? Using testnet? I try connecting to the daemon with json-rpc but i was unable. There are not a shortcut to generate the .csv files from the commandline? I have the feeling that the solutions is very easy but im missing something. Yes, I have the bitcoin.conf with those values. I did not received an specific error; i said i was unable since i do not know how i could connect my program to a rcp port in delphi. I searched the web for many days and i dont found nothing about it: yes, i deeply searched and nothing! I have good experience with TCP/IP connections (i designed a server-client program some years ago) but i never worked with RCP before. What about the main question? Is possible to export the .csv files from the bitcoind? Title: Re: Get transactions from bitcoin core or bitcoind Post by: achow101 on January 06, 2016, 11:28:28 PM Yes, I have the bitcoin.conf with those values. I did not received an specific error; i said i was unable since i do not know how i could connect my program to a rcp port in delphi. I searched the web for many days and i dont found nothing about it: yes, i deeply searched and nothing! I have good experience with TCP/IP connections (i designed a server-client program some years ago) but i never worked with RCP before. It just uses HTTP Post requests to port 8333 and uses JSON formatted results.What about the main question? Is possible to export the .csv files from the bitcoind? No, however you could also automate what you are doing manually with a macro. Just get some macro program and you can use that to automatically do everything you do by hand since it just records and executes mouse moves, clicks, and keyboard typing.Title: Re: Get transactions from bitcoin core or bitcoind Post by: torbente on January 07, 2016, 03:40:28 AM Well, the macro workaround is not valid for me.
I just downloaded a library for delphi (indy) which have a httpclient. I set the values like this: lParamList.Add('method=getnewaddress'); lParamList.Add('params=[0]'); lParamList.Add('id=test'); PostExample := lHTTP.Post('http://myuser:mypassword@localhost:8332/', lparamlist); And i got this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <HTML> <HEAD> <TITLE>Error</TITLE> <META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'> </HEAD> <BODY><H1>401 Unauthorized.</H1></BODY> </HTML> User and password are exactly like in the bitcoin.conf file. I feel im very close Title: Re: Get transactions from bitcoin core or bitcoind Post by: achow101 on January 07, 2016, 03:49:35 AM Well, the macro workaround is not valid for me. Do you have rpcallowip in bitcoin.conf to allow your ip address (including 127.0.0.1)?I just downloaded a library for delphi (indy) which have a httpclient. I set the values like this: lParamList.Add('method=getnewaddress'); lParamList.Add('params=[0]'); lParamList.Add('id=test'); PostExample := lHTTP.Post('http://myuser:mypassword@localhost:8332/', lparamlist); And i got this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <HTML> <HEAD> <TITLE>Error</TITLE> <META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'> </HEAD> <BODY><H1>401 Unauthorized.</H1></BODY> </HTML> User and password are exactly like in the bitcoin.conf file. I feel im very close Title: Re: Get transactions from bitcoin core or bitcoind Post by: torbente on January 07, 2016, 04:32:02 AM My bitcoin.conf file
rpcuser=myuser rpcpassword=mypassword daemon=1 server=1 rpcallowip=127.0.0.1 Im actually connecting to the server: if i close bitcoind and try again the test program i get socket error, connection refused. But if i write a wrong password i get the same response. Maybe my bitcoin.conf is not in the right folder? To be sure, i copied it to the same folder than bitcoin core and daemon but it do not works yet. EDIT im working in another aproach too: just run butcoin-cli methods from my program using commandline and read responses. This way looks very promising. Title: Re: Get transactions from bitcoin core or bitcoind Post by: torbente on January 08, 2016, 01:54:04 PM Well, after a lot of job, i was able to get the info from bitcoind using the commandline, without need to connect to the server via HTTP. I just run a commandline from my program and get the results, all this automatically.
If anyone wants support of how you can do this in delphi, lazarus, FPC just let me know. Thanks to you all. |