Pages:
Author

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

hero member
Activity: 876
Merit: 1037
Sexcoin Core Dev Team Member
I'm trying to set up Abe for an alt-coin. Everything works fine, except the addresses reported in transactions are not in the correct 'address space'.
ie. our addresses start with 'N', when you click on a block, the from and to addresses all start with 'g'

A search for an address returns correctly.( If you search for 'Nksjfisaudh7shd', the correct data shows up ).

I'm trying to find where this 'translation' takes place. I've double checked the magic number and address version.

Any ideas where to look?

Found it! ( DUH...FAQ.html )
hero member
Activity: 876
Merit: 1037
Sexcoin Core Dev Team Member
I'm trying to set up Abe for an alt-coin. Everything works fine, except the addresses reported in transactions are not in the correct 'address space'.
ie. our addresses start with 'N', when you click on a block, the from and to addresses all start with 'g'

A search for an address returns correctly.( If you search for 'Nksjfisaudh7shd', the correct data shows up ).

I'm trying to find where this 'translation' takes place. I've double checked the magic number and address version.

Any ideas where to look?
hero member
Activity: 481
Merit: 529
I have transferred the Git repository to: https://github.com/bitcoin-abe/bitcoin-abe .  Thanks to Patrick for setting this up.  According to GitHub, the old URL will continue to work, but to avoid confusion, you can run
Code:
git remote set-url origin https://github.com/bitcoin-abe/bitcoin-abe.git
in the bitcoin-abe directory.

I have changed the copyright holder from "John Tobey" to "Abe developers".  Since I don't have much time to maintain Abe any more, I invite other interested people to join the team.
hero member
Activity: 481
Merit: 529
Sorry if it's already been asked but I don't see it in the TODO.txt.

It would be great to be able to purge from the database the already spent transactions (after +6 confirmations or so).

This functionality exists in experimental form on the no-statistics branch in Git.  Search "no-statistics" and "default-trim-depth" in this thread.

This would reduce the database and would still be useful for those applications which only need to work with unspent and new transactions.

In the meantime would it be fine deleting those transactions directly on the database? (or would it break Abe?)

Thanks.

I don't know.  It probably won't severely break Abe.  You might see some wrong numbers, negative values and the like in affected blocks.  The no-statistics branch shows wrong totals in some places.
newbie
Activity: 21
Merit: 0
Sorry if it's already been asked but I don't see it in the TODO.txt.

It would be great to be able to purge from the database the already spent transactions (after +6 confirmations or so).

This would reduce the database and would still be useful for those applications which only need to work with unspent and new transactions.

In the meantime would it be fine deleting those transactions directly on the database? (or would it break Abe?)

Thanks.
hero member
Activity: 905
Merit: 1001
Do you really need an API call for that?

Code:
$blockreward = 50 * pow(0.5, floor($current_block / 210000));

thanks for the formula. this is ok for bitcoin. but i think about all the other altcoins out there. its very hard work to get every formula for each altcoin. i thought maybe there is an easy way trough abe  Tongue
No, sorry.  The block chain shows only past block rewards, almost every alt chain has a different formula, and I know of no RPC call that returns it, so finding the current or future reward in general is not trivial.


past block rewards would also help! but as i see there is also no API call available for getting rewards from the last block Sad
hero member
Activity: 481
Merit: 529
Do you really need an API call for that?

Code:
$blockreward = 50 * pow(0.5, floor($current_block / 210000));

thanks for the formula. this is ok for bitcoin. but i think about all the other altcoins out there. its very hard work to get every formula for each altcoin. i thought maybe there is an easy way trough abe  Tongue
No, sorry.  The block chain shows only past block rewards, almost every alt chain has a different formula, and I know of no RPC call that returns it, so finding the current or future reward in general is not trivial.
hero member
Activity: 905
Merit: 1001
Do you really need an API call for that?

Code:
$blockreward = 50 * pow(0.5, floor($current_block / 210000));

thanks for the formula. this is ok for bitcoin. but i think about all the other altcoins out there. its very hard work to get every formula for each altcoin. i thought maybe there is an easy way trough abe  Tongue
donator
Activity: 543
Merit: 500
Do you really need an API call for that?

Code:
$blockreward = 50 * pow(0.5, floor($current_block / 210000));
hero member
Activity: 905
Merit: 1001
is it possible to calc the current block reward trough the abe API?
hero member
Activity: 481
Merit: 529
Hello John,

When sending Bitcoins to an address, new inputs don't appear in the transactions list until there is at least one confirmation. Are you filtering them out programatically? Can they show up even though they still have no confirmations?

Bitcoind does not write unconfirmed transactions to the blockfile.  You would have to run in RPC mode to see them.  See the comments about default-loader in abe.conf: https://github.com/jtobey/bitcoin-abe/blob/d3f1e2ff6714b1fc4dce11f67d1625304cb5f4ca/abe.conf#L271-296
member
Activity: 73
Merit: 10
I get more or less the same amount:

Code:
mysql> select count(pubkey_id) from pubkey;
+------------------+
| count(pubkey_id) |
+------------------+
|         17263860 |
+------------------+
1 row in set (58.19 sec)
mjb
newbie
Activity: 44
Merit: 0
I have a question regarding the number of public keys that the blockchain has "seen":

Code:
select count(pubkey_id) from pubkey;
+------------------+
| count(pubkey_id) |
+------------------+
|         16794956 |
+------------------+
1 row in set (3 min 50.15 sec)

Is it really only 16.8 millions (as of a few days ago)? Or is there something wrong with my database?
member
Activity: 73
Merit: 10
Hello John,

When sending Bitcoins to an address, new inputs don't appear in the transactions list until there is at least one confirmation. Are you filtering them out programatically? Can they show up even though they still have no confirmations?

Thanks,

Toni
hero member
Activity: 481
Merit: 529
I'm currently using blockchain.info API. Check out this URL to get the unspent outputs:

http://blockchain.info/unspent?address=1A9YA62QvpmE32wu9h4tgC3GHQiUhiTAXi

Abe has a slightly different syntax: http://localhost:2750/unspent/1A9YA62QvpmE32wu9h4tgC3GHQiUhiTAXi

and this URL to get the total sent and received amounts (much clearer than blockexplorer.com IMO):

http://blockchain.info/address/1A9YA62QvpmE32wu9h4tgC3GHQiUhiTAXi?format=json

This would be a nice feature to support.
member
Activity: 73
Merit: 10
I'm currently using blockchain.info API. Check out this URL to get the unspent outputs:

http://blockchain.info/unspent?address=1A9YA62QvpmE32wu9h4tgC3GHQiUhiTAXi

and this URL to get the total sent and received amounts (much clearer than blockexplorer.com IMO):

http://blockchain.info/address/1A9YA62QvpmE32wu9h4tgC3GHQiUhiTAXi?format=json

legendary
Activity: 858
Merit: 1000
Looks good, I bet it will be used with a lot of new altcoins. 
hero member
Activity: 481
Merit: 529
Hello John,

Is it easy to implement N confirmations to addressbalance?

Yes, it should be pretty easy, since the underlying functions get_sent_and_last_block_id and get_received_and_last_block_id both accept a block_height.  Just make the new API pass N less than the current block number.  Please note that I have not had much time to work on new features lately.

Also, is is possible to not show the results of the second SQL in the result set of the first SQL?

I am not sure which API function you mean, but there is commingling of sent and received amounts, and to separate them would take a couple of hours of coding.  Can you point to another block explorer that does it how you want?  I usually try to copy their interfaces rather than invent my own.
member
Activity: 73
Merit: 10
Reading your code I found this function, do_unspent, which makes exactly what I needed.
member
Activity: 73
Merit: 10
Hello John,

Is it easy to implement N confirmations to addressbalance?

Also, is is possible to not show the results of the second SQL in the result set of the first SQL?

mysql> SELECT b.block_nTime, cc.chain_id, b.block_height, 0, b.block_hash, tx.tx_hash, txout.txout_pos, txout.txout_value FROM chain_candidate cc JOIN block b ON (b.block_id = cc.block_id) JOIN block_tx ON (block_tx.block_id = b.block_id) JOIN tx ON (tx.tx_id = block_tx.tx_id) JOIN txout ON (txout.tx_id = tx.tx_id) JOIN pubkey ON (pubkey.pubkey_id = txout.pubkey_id) WHERE pubkey.pubkey_hash = '645677d0601371051c9f723fecdd466c317a01cb';
+-------------+----------+--------------+---+------------------------------------------------------------------+------------------------------------------------------------------+-----------+-------------+
| block_nTime | chain_id | block_height | 0 | block_hash                                                       | tx_hash                                                          | txout_pos | txout_value |
+-------------+----------+--------------+---+------------------------------------------------------------------+------------------------------------------------------------------+-----------+-------------+
|  1375776420 |        1 |       250493 | 0 | 000000000000003dcdc75f30fd1c732944fb62693ac76fc217ec142207ab6ae3 | ac772eed99449ec15254a92f8292da1460ed650691b5b282521948a221dbbe78 |         0 |    18700000 |
|  1375886710 |        1 |       250732 | 0 | 000000000000001cb840f80614ed360324cf9073f0ffce25975a456c0ad41ea2 | f25f9a8fdb83ec5eb8ef99a3532e62dba4c158a6529d919cf5998462d20223a9 |         1 |    17650000 |
|  1376079367 |        1 |       251180 | 0 | 000000000000004d8a953fd3ce48c12f88c5e266b72aa816332e45a740fc377d | 0cd22a486659df7a7435edd426805016f0b26ed2779d947bba3212c9f29f4edd |         1 |   500000000 |
|  1376767233 |        1 |       252686 | 0 | 000000000000000af30ed5b0af8414ad2837c07218b45af00a1c2931f1f9700f | 4f345a39e4af5456f3e03f0322188c1701204df169d9db04844559d4afdcecbf |         1 |   489950000 |
|  1376812393 |        1 |       252796 | 0 | 0000000000000025271bf2ac0e0466ae77d00ab12baad1338bd5fc54468ae6b0 | f3f4eb433ea379b494ce1c22867217008f23da2dc6839668f434d0032665c184 |         1 |   479900000 |
|  1377100725 |        1 |       253425 | 0 | 000000000000004d69bfa91a524c5123192d2c93f84d24f4dc30e7d273e17949 | 0320695bf487ec494734c572a29e0e05521f70eb3e636e3673c810f4e2d6aaa3 |         0 |    10609000 |

|  1377330046 |        1 |       253965 | 0 | 000000000000002f6c0ac43224314d21b95139d8dd76893aa7b231a03d905fe8 | 01b3a6e93f5862ee00a4184b4851b84e6a9e5c63d0a4c122c2221f21bd41d315 |         1 |   480459000 |
|  1377446268 |        1 |       254181 | 0 | 000000000000000363f7e2298cdf320e1dd4867788a49b92bb3c366ad0b4f72c | 16a56d242e5bd5fd35a59f27decce1e0bb1b9f4cbc3ce670552bfd6f639f50b7 |         0 |     5000000 |
|  1377525653 |        1 |       254324 | 0 | 0000000000000024593882cf59758b73160b79042731ea16f4c4963f4da5fa04 | a5ccd0bf756a9b867d3ff95543974ebebf4bbe9c478108a2ee829b28bd63b94c |         0 |     1000000 |
|  1377527510 |        1 |       254325 | 0 | 00000000000000040bfcc8600878065faa2db3eb0d3a9434e922b2620fa8f133 | 11517d88ab64fffcc8779b341512b4e8a307d73e7aa00ce01733acb0cf90a99a |         0 |     1000000 |
|  1377527510 |        1 |       254325 | 0 | 00000000000000040bfcc8600878065faa2db3eb0d3a9434e922b2620fa8f133 | 7710da0657a055eeadf8f45b25530ecf07f4bd2b3871c19a0f17e44d9514e91d |         0 |     1000000 |
+-------------+----------+--------------+---+------------------------------------------------------------------+------------------------------------------------------------------+-----------+-------------+
11 rows in set (0.01 sec)

mysql> SELECT b.block_nTime, cc.chain_id, b.block_height, 1, b.block_hash,tx.tx_hash, txin.txin_pos, -prevout.txout_value FROM chain_candidate cc JOIN block b ON (b.block_id = cc.block_id) JOIN block_tx ON (block_tx.block_id = b.block_id) JOIN tx ON (tx.tx_id = block_tx.tx_id) JOIN txin ON (txin.tx_id = tx.tx_id) JOIN txout prevout ON (txin.txout_id = prevout.txout_id) JOIN pubkey ON (pubkey.pubkey_id = prevout.pubkey_id) WHERE pubkey.pubkey_hash = '645677d0601371051c9f723fecdd466c317a01cb';
+-------------+----------+--------------+---+------------------------------------------------------------------+------------------------------------------------------------------+----------+----------------------+
| block_nTime | chain_id | block_height | 1 | block_hash                                                       | tx_hash                                                          | txin_pos | -prevout.txout_value |
+-------------+----------+--------------+---+------------------------------------------------------------------+------------------------------------------------------------------+----------+----------------------+
|  1375886710 |        1 |       250732 | 1 | 000000000000001cb840f80614ed360324cf9073f0ffce25975a456c0ad41ea2 | f25f9a8fdb83ec5eb8ef99a3532e62dba4c158a6529d919cf5998462d20223a9 |        0 |            -18700000 |
|  1375887925 |        1 |       250734 | 1 | 00000000000000214294e44ef349ccb337b5038d5cfecc2c7a9b086d89d08f20 | 0244b7597b986d9433f719a4decb0ce46f636182099471f982c0cb0eb5dee674 |        0 |            -17650000 |
|  1376767233 |        1 |       252686 | 1 | 000000000000000af30ed5b0af8414ad2837c07218b45af00a1c2931f1f9700f | 4f345a39e4af5456f3e03f0322188c1701204df169d9db04844559d4afdcecbf |        0 |           -500000000 |
|  1376812393 |        1 |       252796 | 1 | 0000000000000025271bf2ac0e0466ae77d00ab12baad1338bd5fc54468ae6b0 | f3f4eb433ea379b494ce1c22867217008f23da2dc6839668f434d0032665c184 |        0 |           -489950000 |
|  1377330046 |        1 |       253965 | 1 | 000000000000002f6c0ac43224314d21b95139d8dd76893aa7b231a03d905fe8 | 01b3a6e93f5862ee00a4184b4851b84e6a9e5c63d0a4c122c2221f21bd41d315 |        0 |           -479900000 |
|  1377330046 |        1 |       253965 | 1 | 000000000000002f6c0ac43224314d21b95139d8dd76893aa7b231a03d905fe8 | 01b3a6e93f5862ee00a4184b4851b84e6a9e5c63d0a4c122c2221f21bd41d315 |        1 |            -10609000 |
+-------------+----------+--------------+---+------------------------------------------------------------------+------------------------------------------------------------------+----------+----------------------+
6 rows in set (0.00 sec)

Thanks
Pages:
Jump to: