Bitcoin Forum
May 27, 2024, 12:57:14 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 3 4 5 6 7 [8] 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 »
141  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: April 25, 2013, 02:44:00 AM
I don't know much about the blockchain format but I wonder if there would be much mileage in merely indexing into the blockchain data and only storing the indexes in the database...
Yes, Abe could store blockfile offsets and read from the files as bitcoind does, or store hashes and fetch raw data by RPC to bitcoind.  A table with just address and transaction identifier (hash or blockfile coordinates), indexed by address, would be useful all alone.  So would a table mapping transaction to block number.  Ideally, the whole database would be built of minimal pieces such as these, and the loader would consult metadata to figure out what it has to do.
142  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: April 24, 2013, 08:46:46 PM
Absolute first thing in my book would be to give up on sqlite. It's really not meant for this kind of abuse. Other than that though...

Edit: That is to say, you could continue to offer sqlite as an option but I wouldn't waste any time trying to optimize it.

Well, if you mean the BTC chain, or any kind of server use, I agree.  It would be nice to add some advice about back-end selection in the docs.

On the other hand, given Abe's SQL abstraction layer, any optimizations tend to benefit all databases, unless we start parallel loading, which SQLite won't support.

I'd like to support a lot more configurable features.  Currently, there is keep-scriptsig and use-firstbits, both of which control the existence of certain columns in the database.  The no-statistics branch also omits some columns and a table.  We could have a bare-bones option that omits transaction inputs and outputs from the database, fetching them as needed from bitcoind.  At the other extreme, we could support denormalization (copying columns into dependent tables) for faster queries at the cost of insertion time and space.  This motivated me to clean up the SQL abstraction layer (not yet merged from no-statistics to master).  I want to abstract over more SQL dialect differences to facilitate configuration changes that modify table structure.

Keeping the front end usable under all configurations would be a challenge, but not to worry: we can declare some configurations unsupported by the HTML front end.  One might even imagine a zero-init mode that starts loading and using new blockchain data before it fills in the old.

Of course, optimization could be easier if we commit to MySQL or PostgreSQL, but I think there is enough low-hanging fruit to postpone that idea for a while.
143  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: April 24, 2013, 07:26:56 PM
I'll have to have a closer look. I'm thinking I'd like something of this but more for event-based notification rather than aggregate/historical data.

There may be some way to improve the speed of the inserts too. I'll take a look at that.
I'll appreciate it.  You may want to peruse the GitHub issue.
144  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: April 24, 2013, 03:49:01 PM
Is most of the slowness with importing the blockchain in the SQL inserts?
I think so, but I don't have profile data.
145  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: April 19, 2013, 06:24:55 PM
A bug has caused http://abe.john-edwin-tobey.org to lose track of the bitcoins outstanding as of Block 230560.  Details are in TODO.txt.

This affects the experimental no-statistics branch and possibly the master branch.  It appears to depend on multiple concurrent loading processes.  For best results, use the master branch and avoid concurrent loading until this is fixed.  To avoid concurrent loading, either use a single process (not FastCGI) or have all but one process use an empty datadir list ("datadir []" in abe.conf).  When I set up FastCGI, I use datadir=[] and create a separate loader job that runs Abe continuously in a loop with the live datadir(s) and --no-serve.

Sorry for any inconvenience!
146  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: April 18, 2013, 08:26:06 PM
@salfter

Thanks for the education.  It would be pretty easy to add JSON and JSONP support for API functions.  I'll add it to the to-do list and create an issue on GitHub.  Patches are welcome.
147  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: April 18, 2013, 03:16:20 PM
John,

Does the current master branch work with bitcoind 0.8.1 if the -txindex=1 setting is used?
What about the no-statistics branch?
Can I leave bitcoind 0.8.1 running while using Abe?

In theory, both branches work with and without txindex.  You only need txindex if you want to load data over RPC from bitcoind.  Benefits of RPC loading are (1) you see unconfirmed transactions, and (2) large new blocks show up faster because most of the transactions are already in (provided that you frequently force a catch-up by loading a page or running in --no-serve mode).  See the comments about "default-loader" in abe.conf or Issue #17 about setting up RPC.

You might even manage to run in RPC mode without txindex, given an already loaded database, but this situation is vulnerable to a condition where bitcoind processes an output and its spending input before Abe loads the output.  So I specify txindex.

Note that I mistakenly documented a need to run "bitcoind -rescan" the first time with txindex in effect; that should be "bitcoind -reindex" instead.

In practice, I sometimes see the following error [EDIT: fixed] with bitcoind 0.8.1 when a blockfile other than the current one contains trailing NULs (zero bytes).
Code:
MerkleRootMismatch: Block header Merkle root does not match its transactions. block hash=14508459b221041eab257d2baaa7459775ba748246c8403609eb708f0e57e74b
I work around it by trimming the NULs from the file (using /usr/bin/truncate in Linux and the blkfile_offset value from the error trace) and restarting.  I would like to fix this in the code.

In theory, reading the blockfiles while bitcoind runs is unsafe due to race conditions and the use of an undocumented feature.  In practice, I do not recall this ever causing a problem until Bitcoin 0.8, and the problems related to running simultaneously with 0.8.x are fixed.  Abe checks each block's Merkle root so as not to load a corrupt or incomplete block, so at worst, an error should involve resetting the datadir row to the start of the current file (or pass --rescan to Abe for a slower but easier fix).

Also, do you know any way to check that -txindex=1 is indeed active and was used for the last reindex? My ~/.bitcoin/blocks is currently 8.6GiB of which 837MiB is index. ~/.bitcoin/chainstate is 208MiB.

I am sure there is some file that will be a certain size, but I don't know it.  My blocks, index, and chainstate directories are similar to yours in size, and I have a confirmed working txindex.  The way I know is by finding a transaction all of whose outputs are spent, and fetching it with "bitcoind getrawtransaction".  If it says "transaction not in index" bad, if it gives you a hex string, good.

Thanks for your work, I just donated ฿0.2.

Thank you for your support.
148  Other / Beginners & Help / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: April 17, 2013, 12:12:43 AM
If you have good SQL skills and a few hours to spare, I can outline the steps.  But if you can afford to wait for the reload, that will be much easier.

Please do! I think I can do it if you give me a few instructions Smiley
Answered via PM.  If anything useful results from this exercise, one of us will post it.
149  Other / Beginners & Help / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: April 16, 2013, 08:54:41 PM
I loaded the blockchain to an Abe sqlite DB, but now I want to use Postgres.
Is there a way to convert the sqlite DB to pg, or do I have to rescan the whole blockchain again?
This would be a nice feature but is not supported currently.  If you have good SQL skills and a few hours to spare, I can outline the steps.  But if you can afford to wait for the reload, that will be much easier.
150  Bitcoin / Project Development / Re: [Abe Block Explorer] Who is interested in full support for multisig/P2SH tx? on: April 08, 2013, 04:11:44 PM
Thanks to deflation, I am asking 4.5 BTC.

EDIT: still "at current rates".  IOW, $800 USD.

But the early Bitcoin adopters got too much.  Not "too much" in the sense of "unfair" nor in the sense of "I want them" or "it can't work", but enough to plague the currency with exchange rate volatility for the foreseeable future.  Perhaps even enough to limit the exchange value's upside.
151  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: March 30, 2013, 05:39:06 AM
The experimental branch (no-statistics) now imports UNCONFIRMED (MEMPOOL) transactions (as well as blocks) over RPC from a running bitcoind, provided that:

  • Bitcoind is new enough to support getrawmempool, getrawtransaction, getblock, and getblockhash (tested 0.8.x; 0.7.x may work)
  • If using bitcoind 0.8.x, -txindex is in effect (see here)
  • The datadir.chain_id column is populated: for BTC, this means execute the following SQL: UPDATE datadir SET chain_id = 1 WHERE chain_id IS NULL

My demonstration server satisfies these requirements and includes unconfirmed transactions in search results.

This feature ought to be easily portable to the master branch, in case anyone wants it.  However, I'd feel more comfortable with a configuration option to tell Abe whether or not to use RPC.  By default, it tries RPC and falls back to blockfile scans if that fails.  Also, the new RPC code could use testing and improvements.
152  Alternate cryptocurrencies / Altcoin Discussion / Re: PPC, TRC and FRC Block Explorer (WWW.CRYPTOCOINEXPLORER.COM) on: March 28, 2013, 06:45:33 PM
After some research I found that Chrome has a tendency to create a rather large amount of parallel connections and then proceeds to communicate on the second connection it created.

Well, that's pretty perverse, but all right, we should be multithreaded.

I will start working on using a different server mechanism for the explorers, possibly Twisted or Fastcgi.

If anybody has suggestions or would like to help, it would be greatly appreciated. The source for the PPC and FRC explorers are on github.

If you have any trouble with README-FASTCGI.txt, I'd like to know.

Easier, though not as well tested: define a server class in abe.py:

Code:
from wsgiref.simple_server import WSGIServer
import SocketServer
class HttpServer(SocketServer.ThreadingMixIn, WSGIServer):
    pass

Then add the text in bold: httpd = make_server(args.host, port, abe, server_class=HttpServer)

There is also SocketServer.ForkingMixIn in case ThreadingMixIn gives weird errors.
153  Bitcoin / Project Development / Re: [Abe Block Explorer] Who is interested in full support for multisig/P2SH tx? on: March 28, 2013, 03:51:43 PM
Thanks to the market, the asking price is down to 8 "at current rates" (c. $750).  But pledges have also been "at current rates"... danged volatility.
154  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: March 25, 2013, 03:44:07 PM
Any news on multisig support? Are you working on it or waiting for donations? Smiley
i would contribute to a multisig bounty.
Like a zero-fee transaction, eventually it'll get in.  Probably.  Smiley  In the absence of a business model, my priorities are driven by my personal needs, which lately are about space efficiency, bitcoind 0.8.x compatibility, and integrating contributions from other developers.  Donations do encourage me to work, at roughly $40/hour for features that I want to add anyway, up to $100 for site-specific things that don't improve Abe for most users.  (I'd quote a price in BTC, but BTC/USD is too volatile, as I have ranted in other threads, for reasons that led me to create Abe in the first place.)

I'd like to get clear what "multisig support" means.  Now that I have a full database, I can search for new transaction types.  There have been a few hundred transaction outputs that use OP_CHECKMULTISIG as specified in BIP 11 M-of-N Standard Transactions.  Blockchain.info calls these "escrow" outputs.  Examples: 1 2.  Given an address that redeemed an M-of-N output, Blockchain.info lists the transaction, as in this example.  But if the address did not sign it, its page does not list the transaction: example.  Mapping from addresses back to these transactions will take some extra work.

There have also been a few hundred outputs as in BIP 16 Pay to Script Hash (P2SH).  These have receiving addresses that start with "3" as per BIP 13.  Example: 1.  These output scripts are opaque, but the redeeming input reveals one or more addresses.  As far as I know, Blockchain.info does not correlate an address so revealed with the original P2SH transaction.  Perhaps it would be useful to do so, and this would require some extra work.

There have also been a few thousand regular pubkey outputs as in this example that Abe can not parse because the public key is shorter than usual.  This has nothing to do with multisig and is really a bug in Abe, but it would be nice to fix.  There are also a thousand or so outputs of miscellaneous types unrecognized by Abe.  They may all be nonstandard, but it would be nice to make sense of any that are frequent or demonstrably redeemable.

ThomasV sent me this:

Hi,

it would be nice if Abe could support multisig addresses. For this I think you only need to update deserialize.py.

I did it in Electrum, so you can lookup Electrum's deserialize.py file:
https://github.com/spesmilo/electrum/blob/master/lib/deserialize.py
(you don't want to use that file as is, it probably has other differences)

see at the end, the function called get_address_from_input_script.

It is not directly usable: Abe would have to pass the script to the function where currently it passes pubkey_hash to another function.  But this would be very easy and would add at least some value regarding P2SH.

A full implementation of M-of-N, P2SH, and mapping from address back to M-of-N transaction would take me about 20 hours, so figure 11 BTC at current rates.
155  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: March 22, 2013, 03:43:32 PM
FYI, http://abe.john-edwin-tobey.org is current with the BTC chain using the no-statistics branch and the HOMEPAGE template variable to make chain/Bitcoin the default view.  It uses the new abe_loader script (in tools/) to stay up-to-date, and the FCGI process has read-only SQL permissions.

Problems?  Please report them here or by email to jtobey@john-edwin-tobey.org.
156  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: March 21, 2013, 02:55:05 PM
The next Namecoin block, 99502, has a size of 52606 bytes. In order to allow 99502 (and subsequent blocks) to be imported into the Abe database, I dropped the txout_detail view (because PostgreSQL does not allow changing the column types in tables used by views), removed the length restriction from the column txout_scriptpubkey in the table txout, and recreated the txout_detail view.

I'm sure this solution is dangerous if someone manages to stuff much larger blocks into a block chain, but I do not know a reasonable limit for this column yet.

Thanks for the report.  It's too bad that junk got into the Namecoin blockchain.  Do you have the actual script length?  http://explorer.dot-bit.org/tx/1474553 shows the transaction size as 32767, and the long script would be most of that, but that explorer may have truncated it.  You can verify this with something like:

Code:
SELECT MAX(LENGTH(txout_scriptPubKey)) FROM txout JOIN tx USING (tx_id) WHERE tx_hash = '0bb558f73a543f2631acbd8c5614d3ed2171eb710a586b4485b8303d4a4a0b61';

I'll consider simply increasing the column width, but that has the side effect of making MySQL create the column as type TEXT rather than VARCHAR (unless using binary-type=binary).  This may not be so bad.  The column does not take part in any joins, and the vanilla app never searches it.  Anyone?
157  Other / Beginners & Help / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: March 20, 2013, 02:09:01 PM
Does the "trim spent outputs" feature in the no-statistics branch mean that you can't see the total amount of BTC received for each account?
Yes, that information is lost.  All you see is total received minus total sent.  It would be possible to store the total received by each address, but it would only be a lower bound on the real value, since addresses themselves are trimmed when empty.

Any particular use case in mind?
158  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: March 19, 2013, 06:33:43 PM
Is there a list somewhere of all of the publicly-available servers/websites running Abe?  When blockchain.info was down, I went looking for one, but couldn't find any that were still running.
The wiki page links to http://abe.bitcoinstats.org:2750/, which appears current.
159  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: March 19, 2013, 05:51:15 PM
i stoped supporting I0Coin due to its memhogging, how do i cleanly delete the I0Coin chain from the MySQL DB? (already uncommented it in abe.conf)
Sorry, I haven't written this feature.  You can remove the currency from the main page by finding its chain_id (in the chain table) and deleting all matching rows from chain_candidate and chain, I think.  It's been a while since I did this.

Then reclaiming the block and tx space is a matter of identifying rows in a half dozen tables and deleting them in dependency order, being careful not to delete other chains' data.  Or you could disable keys, delete in any order, and enable keys again, but this is not advisable while other chains may be loading.  I seem to remember "clean" chain removal taking me 20-30 minutes.  In 1-2 hours I could develop a utility that does it all, but it's still a to-do.

Quote from: TODO.txt
* Admin interface to delete chains, etc.
160  Alternate cryptocurrencies / Altcoin Discussion / Re: PPC, TRC and FRC Block Explorer (WWW.CRYPTOCOINEXPLORER.COM) on: March 18, 2013, 04:12:36 PM
I was never fully happy with my changes.
I sympathize, but if complete satisfaction were a criterion, there would be no Abe.  See: Release Early, Release Often.
Pages: « 1 2 3 4 5 6 7 [8] 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!