Pages:
Author

Topic: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff - page 45. (Read 221044 times)

hero member
Activity: 560
Merit: 501
I'm getting "Commands out of sync; you can't run this command now" MySQL errors.
Hmm, that's a new one to me.  Could you post a way to reliably produce the error in my own environment?  Or the next best thing would be to run with --log-sql and post a section of log including, say, 5 SQL commands leading up to the error.

I've switched to Postgres, and it seems to be holding up fairly well so far, other than the FastCGI process dying every once in a while.

I will set a test environment up this weekend and work on reproducing it myself.
hero member
Activity: 481
Merit: 529
I'm getting "Commands out of sync; you can't run this command now" MySQL errors.
Hmm, that's a new one to me.  Could you post a way to reliably produce the error in my own environment?  Or the next best thing would be to run with --log-sql and post a section of log including, say, 5 SQL commands leading up to the error.
hero member
Activity: 560
Merit: 501
I'm getting "Commands out of sync; you can't run this command now" MySQL errors. Could this tie in to Litecoin experiencing spamming in the form of hundreds if not thousands of 0.00000001 outputs per block?

Case in point: http://explorer.liteco.in/
hero member
Activity: 481
Merit: 529
If I'd like to modify Abe without modifying the original code, what's the go-to way of hooking or wrapping into it so as to maintain compatibility with the original codebase and its updates?

+1. I've been "hacking up" bitcoin-abe by adding functions "q_whatever(...)" to abe.py. Now I can't easily update.
Just uploaded an example (untested by me) of subclassing Abe.abe to add handle_* functions.  I suspect q_* would work too.

https://github.com/jtobey/bitcoin-abe/blob/master/contrib/ecdsa.py

If you come to rely on an undocumented interface, the best way to keep it around is to document it and ask me to commit the doc. Smiley
donator
Activity: 2772
Merit: 1019
If I'd like to modify Abe without modifying the original code, what's the go-to way of hooking or wrapping into it so as to maintain compatibility with the original codebase and its updates?

+1. I've been "hacking up" bitcoin-abe by adding functions "q_whatever(...)" to abe.py. Now I can't easily update.
hero member
Activity: 560
Merit: 501
If I'd like to modify Abe without modifying the original code, what's the go-to way of hooking or wrapping into it so as to maintain compatibility with the original codebase and its updates?
hero member
Activity: 560
Merit: 501
And set "Alias / /usr/lib/cgi-bin/abe/" or the nginx equivalent in the server configuration.
It's not quite that simple. nginx's lightweight nature does not automagically spawn FastCGI threads.

If anyone cares, you can use spawn-fcgi, 'fastcgi_pass'ing the requests from nginx to loopback or UNIX socket or whatever you decide to use. Remember to have nginx serve your static files, or you'll lose the entire benefit of using it in the first place.
newbie
Activity: 58
Merit: 0
I used Abe to output transactions for a given address to CSV format: https://bitcointalksearch.org/topic/output-transactions-in-csv-51121
Thanks for sharing!

I wonder if your GetTransactions function would work as a VIEW.  That might translate easily to MySQL etc.


I don't think views can take a dynamic parameter, which is why I went with a function.

However, one could make a view with all the transactions and then just use a select statement from the view for records with the given address. I don't know which method (function vs. view) would be faster for selecting transactions and updating the database with new transactions. I guess the view would need to either be persisted, meaning it gets updated on every update, or dynamically generated on every query, which I would guess does not have a significant performance difference from the current function method.

As for compatibility, I know contemporary versions of MySQL have function capabilities, but I'm not sure about some of the older versions. Actually, I think older versions of PostgreSQL may not allow for the type of function I'm using, i.e. returning a table.
hero member
Activity: 481
Merit: 529
I used Abe to output transactions for a given address to CSV format: https://bitcointalksearch.org/topic/output-transactions-in-csv-51121
Thanks for sharing!

I wonder if your GetTransactions function would work as a VIEW.  That might translate easily to MySQL etc.
newbie
Activity: 58
Merit: 0
I used Abe to output transactions for a given address to CSV format: https://bitcointalksearch.org/topic/output-transactions-in-csv-51121
hero member
Activity: 481
Merit: 529
Yeah, I got it up and running. What I've been doing is reverse-proxying the requests from nginx to the built in server Abe uses. That isn't feasible for a production environment, though.

My next big challenge is getting Abe to run in a spawned FastCGI process using nginx.
I have no experience with nginx, but FastCGI should work the same on any server.  I might add that the "sudo" overhead is not essential, it's just how I set things up to keep any Abe exploits out of Apache and vice versa.  If your security policy doesn't need that separation, I suggest naming the script /usr/lib/cgi-bin/abe and removing --watch-pid="$1":

Code:
#! /bin/sh
PYTHONUNBUFFERED=1 exec python -m Abe.abe \
--config /home/USER/abe.conf --static-path static/

And set "Alias / /usr/lib/cgi-bin/abe/" or the nginx equivalent in the server configuration.
full member
Activity: 154
Merit: 102
Bitcoin!
Following this discussion.  Looks like a very nice tool.
hero member
Activity: 560
Merit: 501
I might also add that getting it run over Apache using FastCGI was easy as pie.
hero member
Activity: 560
Merit: 501
No luck?
When you have finished following the instructions, the file /home/user/cgi-bin/abe should exist and be executable.  Issue "ls -l /home/user/cgi-bin/abe" and post its output if unsure.

Then test the site and post any error message from your server log or browser.

Yeah, I got it up and running. What I've been doing is reverse-proxying the requests from nginx to the built in server Abe uses. That isn't feasible for a production environment, though.

My next big challenge is getting Abe to run in a spawned FastCGI process using nginx.
hero member
Activity: 481
Merit: 529
No luck?
When you have finished following the instructions, the file /home/user/cgi-bin/abe should exist and be executable.  Issue "ls -l /home/user/cgi-bin/abe" and post its output if unsure.

Then test the site and post any error message from your server log or browser.
hero member
Activity: 560
Merit: 501
No luck?
hero member
Activity: 560
Merit: 501
Code:
root@terrytibbs:/home/user/src/bitcoin-abe# /usr/bin/python
sudo: /home/user/cgi-bin/abe: command not found
You have to replace "USER" with your login, for example /home/terrytibbs/cgi-bin/abe.  And the doc tells you later how to create that file.
Edit: the file could be anywhere, ~/cgi-bin is just a suggested location.

I know, but my user is aptly named just that, "user". Smiley
hero member
Activity: 481
Merit: 529
Code:
root@terrytibbs:/home/user/src/bitcoin-abe# /usr/bin/python
sudo: /home/user/cgi-bin/abe: command not found
You have to replace "USER" with your login, for example /home/terrytibbs/cgi-bin/abe.  And the doc tells you later how to create that file.
Edit: the file could be anywhere, ~/cgi-bin is just a suggested location.
hero member
Activity: 560
Merit: 501
Trying to get Abe running with Apache and FastCGI doing all the heavy lifting, but I'm getting this:
Code:
root@terrytibbs:/home/user/src/bitcoin-abe# /usr/bin/python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess, sys, os
>>> command=["sudo", "-u", "user", "/home/user/cgi-bin/abe", str(os.getpid())]
>>> subprocess.Popen(command, stdin=sys.stdin).wait()
sudo: /home/user/cgi-bin/abe: command not found
1

What's up?
hero member
Activity: 481
Merit: 529
Is this code stable?
Sorry, I overlooked this question.  I hope to have a test suite one day and won't release a 1.0 without one.  Numbered versions 0.4, 0.5, and 0.6 all have git branches for bugfixes, and I intend to backport any critical fixes to these.  As for the latest commit, it may contain untested code and disruptive changes.
Pages:
Jump to: