Pages:
Author

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

sr. member
Activity: 504
Merit: 254
Hey John,

I just wanted to make sure that this part of the code

Code:
AND cc.in_longest = 1

in this SQL query

Code:
SELECT b.block_hash, b.block_height, b.block_nTime, b.block_num_tx,
                   b.block_nBits, b.block_value_out,
                   b.block_total_seconds, b.block_satoshi_seconds,
                   b.block_total_satoshis, b.block_ss_destroyed,
                   b.block_total_ss
              FROM block b
              JOIN chain_candidate cc ON (b.block_id = cc.block_id)
             WHERE cc.chain_id = 1
               AND cc.block_height BETWEEN 100 AND 200
               AND cc.in_longest = 1
             ORDER BY cc.block_height DESC LIMIT 50

makes sure that the query returns only valid blocks. leaving orphans out.

inversely, if I would be writing

Code:
AND cc.in_longest = 0


I would have be getting only orphans?  is that correct?
hero member
Activity: 481
Merit: 529
This might be a silly question, but how would I use Abe functions in my own Python programs.  The web interface is nice and all, but it is slow.  And the command line --query statements aren't exactly fast either.  I'm thinking if I could call a function directly from within my own Python code, instead of parsing web API output, what I'm writing could be so much more efficient and speedy.

For example, if I wanted to get the balance of an address, it would be nice to be able to directly call the function in Abe that calculates the balance.

Does that make sense?

Yes, check out these programs in the source tree for example code, possibly out of date:

Abe/admin.py
Abe/reconfigure.py
Abe/verify.py
Abe/mixup.py
tools/namecoin_dump.py
contrib/ecdsa.py
newbie
Activity: 46
Merit: 0
This might be a silly question, but how would I use Abe functions in my own Python programs.  The web interface is nice and all, but it is slow.  And the command line --query statements aren't exactly fast either.  I'm thinking if I could call a function directly from within my own Python code, instead of parsing web API output, what I'm writing could be so much more efficient and speedy.

For example, if I wanted to get the balance of an address, it would be nice to be able to directly call the function in Abe that calculates the balance.

Does that make sense?
hero member
Activity: 821
Merit: 1000
Not sure why but anytime I try to use the newest version of the chain explorer with a proof of stake coin I get this when browsing any block


Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/home/*/Downloads/bitcoin-abe/Abe/abe.py", line 250, in __call__
    handler(page)
  File "/home/*/Downloads/bitcoin-abe/Abe/abe.py", line 673, in handle_block
    abe._show_block(page, '', None, block_hash=block_hash)
  File "/home/*/Downloads/bitcoin-abe/Abe/abe.py", line 564, in _show_block
    is_stake_block = is_stake_chain and b['is_proof_of_stake']
KeyError: 'is_proof_of_stake'



I've tried faircoin and community coin, I use policy NovaCoin, it seems to load all the blocks but when browsing any block I get the above error, when accessing addresses and transaction everything works fine.

Sorry, I have been busy, but this looks fixable.  Did you have it working with an older version?

yes, it works on the previous version, I'm just gonna downgrade for now.
thanks.

Did that work? if so what did you downgrade to? Thanks
member
Activity: 111
Merit: 10
Not sure why but anytime I try to use the newest version of the chain explorer with a proof of stake coin I get this when browsing any block


Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/home/*/Downloads/bitcoin-abe/Abe/abe.py", line 250, in __call__
    handler(page)
  File "/home/*/Downloads/bitcoin-abe/Abe/abe.py", line 673, in handle_block
    abe._show_block(page, '', None, block_hash=block_hash)
  File "/home/*/Downloads/bitcoin-abe/Abe/abe.py", line 564, in _show_block
    is_stake_block = is_stake_chain and b['is_proof_of_stake']
KeyError: 'is_proof_of_stake'



I've tried faircoin and community coin, I use policy NovaCoin, it seems to load all the blocks but when browsing any block I get the above error, when accessing addresses and transaction everything works fine.

Sorry, I have been busy, but this looks fixable.  Did you have it working with an older version?

yes, it works on the previous version, I'm just gonna downgrade for now.
thanks.
hero member
Activity: 481
Merit: 529
Not sure why but anytime I try to use the newest version of the chain explorer with a proof of stake coin I get this when browsing any block


Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/home/*/Downloads/bitcoin-abe/Abe/abe.py", line 250, in __call__
    handler(page)
  File "/home/*/Downloads/bitcoin-abe/Abe/abe.py", line 673, in handle_block
    abe._show_block(page, '', None, block_hash=block_hash)
  File "/home/*/Downloads/bitcoin-abe/Abe/abe.py", line 564, in _show_block
    is_stake_block = is_stake_chain and b['is_proof_of_stake']
KeyError: 'is_proof_of_stake'



I've tried faircoin and community coin, I use policy NovaCoin, it seems to load all the blocks but when browsing any block I get the above error, when accessing addresses and transaction everything works fine.

Sorry, I have been busy, but this looks fixable.  Did you have it working with an older version?
hero member
Activity: 481
Merit: 529
This will allow my to use the explorer but the currency is labeled "Hirocoin", while all transactions and blocks appear to be from Logicoin. If I change "loader": "Logicoin" then it shows 0 blocks and doesn't work at all. Not sure what I've missed?

Leave "loader" as "blkfile" and "policy" as what it was when you could browse the blocks.  Add "chain":"Logicoin".  If you omit "policy" it defaults to the chain name, but Abe does not recognize "Logicoin" as a policy name.  (Ideally, we should tell Abe/Chain.py about Logicoin.)  If you specify "policy", then Abe uses the chain name for display and search only, so "chain" will not affect the block count or content.
hero member
Activity: 750
Merit: 500
Hey I'm trying to set up Abe with an X11 coin.

In Chain.py I've made the following changes

Code:
class X11Chain(Chain):
    def block_header_hash(chain, header):
        import xcoin_hash
        return xcoin_hash.getPoWHash(header)

class Logicoin(X11Chain):
    def __init__(chain, **kwargs):
        chain.name = 'Logicoin'
        chain.code3 = 'LGC'
        chain.address_version = '\x30'
        chain.script_addr_vers = '\x05'
        chain.magic = '\xf6\xc6\xb6\xd6'
        Chain.__init__(chain, **kwargs)

    datadir_conf_file_name = 'logicoin.conf'
    datadir_rpcport = 9652
    datadir_p2pport = 9653

and for abe.conf

Code:
default-loader = blkfile
dbtype MySQLdb
connect-args = {"user":"abe","db":"abe", "passwd":"xxx"}
upgrade
port 2750
host 184.82.172.92
datadir += [{
    "dirname": "/home/crypto/.logicoin",
    "loader": "blkfile",
    "chain": "Hirocoin",
    "policy": "X11"
}]

This will allow my to use the explorer but the currency is labeled "Hirocoin", while all transactions and blocks appear to be from Logicoin. If I change "loader": "Logicoin" then it shows 0 blocks and doesn't work at all. Not sure what I've missed?

Here's the explorer in its current form. http://184.82.172.92:2750/

change the chain to Logicoin in the abe.conf file like this  "chain": "Logicoin", then delete the database and recreate it.

Tried that many times. Leads to the block explorer not displaying any blocks and I read earlier on that thats the behaviour when it doesn't recognize the chain.

I've made the change and recreated the database so that you can see what I'm talking about. http://184.82.172.92:2750/
member
Activity: 111
Merit: 10
Hey I'm trying to set up Abe with an X11 coin.

In Chain.py I've made the following changes

Code:
class X11Chain(Chain):
    def block_header_hash(chain, header):
        import xcoin_hash
        return xcoin_hash.getPoWHash(header)

class Logicoin(X11Chain):
    def __init__(chain, **kwargs):
        chain.name = 'Logicoin'
        chain.code3 = 'LGC'
        chain.address_version = '\x30'
        chain.script_addr_vers = '\x05'
        chain.magic = '\xf6\xc6\xb6\xd6'
        Chain.__init__(chain, **kwargs)

    datadir_conf_file_name = 'logicoin.conf'
    datadir_rpcport = 9652
    datadir_p2pport = 9653

and for abe.conf

Code:
default-loader = blkfile
dbtype MySQLdb
connect-args = {"user":"abe","db":"abe", "passwd":"xxx"}
upgrade
port 2750
host 184.82.172.92
datadir += [{
    "dirname": "/home/crypto/.logicoin",
    "loader": "blkfile",
    "chain": "Hirocoin",
    "policy": "X11"
}]

This will allow my to use the explorer but the currency is labeled "Hirocoin", while all transactions and blocks appear to be from Logicoin. If I change "loader": "Logicoin" then it shows 0 blocks and doesn't work at all. Not sure what I've missed?

Here's the explorer in its current form. http://184.82.172.92:2750/

change the chain to Logicoin in the abe.conf file like this  "chain": "Logicoin", then delete the database and recreate it.
hero member
Activity: 750
Merit: 500
Hey I'm trying to set up Abe with an X11 coin.

In Chain.py I've made the following changes

Code:
class X11Chain(Chain):
    def block_header_hash(chain, header):
        import xcoin_hash
        return xcoin_hash.getPoWHash(header)

class Logicoin(X11Chain):
    def __init__(chain, **kwargs):
        chain.name = 'Logicoin'
        chain.code3 = 'LGC'
        chain.address_version = '\x30'
        chain.script_addr_vers = '\x05'
        chain.magic = '\xf6\xc6\xb6\xd6'
        Chain.__init__(chain, **kwargs)

    datadir_conf_file_name = 'logicoin.conf'
    datadir_rpcport = 9652
    datadir_p2pport = 9653

and for abe.conf

Code:
default-loader = blkfile
dbtype MySQLdb
connect-args = {"user":"abe","db":"abe", "passwd":"xxx"}
upgrade
port 2750
host 184.82.172.92
datadir += [{
    "dirname": "/home/crypto/.logicoin",
    "loader": "blkfile",
    "chain": "Hirocoin",
    "policy": "X11"
}]

This will allow my to use the explorer but the currency is labeled "Hirocoin", while all transactions and blocks appear to be from Logicoin. If I change "loader": "Logicoin" then it shows 0 blocks and doesn't work at all. Not sure what I've missed?

Here's the explorer in its current form. http://184.82.172.92:2750/
member
Activity: 111
Merit: 10
Not sure why but anytime I try to use the newest version of the chain explorer with a proof of stake coin I get this when browsing any block


Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/home/*/Downloads/bitcoin-abe/Abe/abe.py", line 250, in __call__
    handler(page)
  File "/home/*/Downloads/bitcoin-abe/Abe/abe.py", line 673, in handle_block
    abe._show_block(page, '', None, block_hash=block_hash)
  File "/home/*/Downloads/bitcoin-abe/Abe/abe.py", line 564, in _show_block
    is_stake_block = is_stake_chain and b['is_proof_of_stake']
KeyError: 'is_proof_of_stake'



I've tried faircoin and community coin, I use policy NovaCoin, it seems to load all the blocks but when browsing any block I get the above error, when accessing addresses and transaction everything works fine.
hero member
Activity: 481
Merit: 529

As my disk is not so big and I don't want to download further block chain data, so I changed the loader of Abe to "blkfile' from 'rpc', and I expected that the database won't increase. However, it seems Abe reloaded the blkfile into the database from the scratch and the block_tx number continued to increase though the block data was not updated. It did re-index the data into database according to the Abe browser that the block number just several thousands.

What's the problem? How can I recover to the right database?

Thanks.


loading from rpc or blkfile, yields the same database information, i would delete the database and reload everything again, or add new space to your server and change the directory where mysql puts the database.

Yes, the database is equally huge whichever loader you use.  I've started a new branch ("small") where I try to keep the database size down, but I don't know when it will be usable.  Meanwhile, people are saying good things about Insight: https://github.com/bitpay/insight
hero member
Activity: 481
Merit: 529
Abe is stuck on a block height... when I search for the block after, it gives me 3 choices and if I click on either of them... it crashes with this

Code:
: 'NoneType' object has no attribute 'has_feature' 
      args = ("'NoneType' object has no attribute 'has_feature'",)
      message = "'NoneType' object has no attribute 'has_feature'"

So I guess those are orphans and Abe doesn't know what to do with those (or witch one to chose)

My question would be, am I correct? how can this be fixed?

I don't really have enough information, but it looks as if some code is not specifying the chain where it should.  I think this is a recent bug.  I tried to fix some cases like this here but it is not well tested.  You might try inserting "chain/.../" into the links returned by the search.

In any case, orphan blocks should not get Abe "stuck" so there is something else wrong.
member
Activity: 111
Merit: 10

As my disk is not so big and I don't want to download further block chain data, so I changed the loader of Abe to "blkfile' from 'rpc', and I expected that the database won't increase. However, it seems Abe reloaded the blkfile into the database from the scratch and the block_tx number continued to increase though the block data was not updated. It did re-index the data into database according to the Abe browser that the block number just several thousands.

What's the problem? How can I recover to the right database?

Thanks.


loading from rpc or blkfile, yields the same database information, i would delete the database and reload everything again, or add new space to your server and change the directory where mysql puts the database.
hero member
Activity: 589
Merit: 500

As my disk is not so big and I don't want to download further block chain data, so I changed the loader of Abe to "blkfile' from 'rpc', and I expected that the database won't increase. However, it seems Abe reloaded the blkfile into the database from the scratch and the block_tx number continued to increase though the block data was not updated. It did re-index the data into database according to the Abe browser that the block number just several thousands.

What's the problem? How can I recover to the right database?

Thanks.

sr. member
Activity: 504
Merit: 254
Abe is stuck on a block height... when I search for the block after, it gives me 3 choices and if I click on either of them... it crashes with this

Code:
: 'NoneType' object has no attribute 'has_feature' 
      args = ("'NoneType' object has no attribute 'has_feature'",)
      message = "'NoneType' object has no attribute 'has_feature'"

So I guess those are orphans and Abe doesn't know what to do with those (or witch one to chose)

My question would be, am I correct? how can this be fixed?
hero member
Activity: 481
Merit: 529
Anyone know how to have Abe show top wallet balances?  If not already built in, how could I query the mysql DB for this info?

As unick says, it is not built in.  You can search this thread for "txout_value" to find a query that gives the amount received by an address ("pubkey").  A similar query (joining txin with txout on txout_id) can give the amount received.  Subtract to get the "balance" for that particular public key (which, you must know, is not the same as a wallet.dat file).  Use GROUP BY to put them all into a table and select from it ordering by balance.  Remember to limit the results to where chain_candidate.in_longest=1 in case your database contains side-chains.
sr. member
Activity: 504
Merit: 254
Anyone know how to have Abe show top wallet balances?  If not already built in, how could I query the mysql DB for this info?

No, Abe does not have this feature built in, and the addresses are not store in the database.

What you have is the public keys.  So the way to go would be to query the database for all the public keys, transform the public keys to the network address, then ask Abe to give you the balance for that specific address.

You do that in a loop and then show the results with descending by top address
member
Activity: 99
Merit: 10
Anyone know how to have Abe show top wallet balances?  If not already built in, how could I query the mysql DB for this info?
full member
Activity: 189
Merit: 100
जगत् िमत
Hi Everyone,
Check out the new design of Abe at http://ancblockchain.com
You can see the new branch in github at https://github.com/bitcoin-abe/bitcoin-abe/tree/geekz-patch-1

currently,  @jtobey is reviewing the code and soon it will be part of main ABE explorer Smiley

Feel free to provide any suggestions for improvements in the design And of course, You can also make donation if you liked the work and would like to see continued improvement.  Smiley
Pages:
Jump to: