MatthewLM / PeercoinAbeExplorer

Abe Explorer adapted for peercoinexplorer.info
GNU Affero General Public License v3.0
6 stars 12 forks source link

Problem with has_feature #3

Closed leandrogomesmachado closed 9 years ago

leandrogomesmachado commented 9 years ago

Hello, I try to work and now my instance are running good and I can see TX, but when I try to find by blockhash show me this screen: error Another problem is that don't show blocks on front of page.

What I need to do?

Thank you

leandrogomesmachado commented 9 years ago

Frontpage: tela_front

TX page: tx

And the page the give me error on the first post when I try to see the hashfile: screen

MatthewLM commented 9 years ago

Hi, can you show more (all) of the error please.

TheTribesman commented 9 years ago

I have forked HTMLExplorer and I get to block 4005 with no errors, and then DB has null values in importanf mysqlDB columns.

4005

Would you like me to send you the .py files I'm working with? It may help to have something to compare yours with. Let me know.

leandrogomesmachado commented 9 years ago

Thanks for the fast reply Mr. Matthew and kobocoin.

@MatthewLM The error consist when I go to the blockexplorer and try to see a blockhash, not block tx.

Starting the Explorer: html5_error I open the Explorer on the browser: html5_error2 and html5_error3

so, now I try to see a tx: html5_error4

and see: html5_error5

BUT, when I try to see the block by the hash: html5_error6

I see this on webpage: html5_error7

THE OUTPUT:

root@vps:~/HTMLCoinExplorer# python -m HTMLCoin-Abe.abe --config /root/HTMLCoinExplorer/HTMLCoin-Abe/abe-load.conf
Opened /root/.HTML5/blk0001.dat
Opened /root/.HTML5/blk0001.dat
Abe initialized.
Listening on http://64.57.133.2:80
Opened /root/.HTML5/blk0001.dat
block_tx 269322 425481
commit
Opened /root/.HTML5/blk0001.dat
177.179.77.173 - - [19/Mar/2015 13:26:24] "GET /chain/HTMLcoin HTTP/1.1" 200 2417
177.179.77.173 - - [19/Mar/2015 13:26:25] "GET /layout.css HTTP/1.1" 200 16813
177.179.77.173 - - [19/Mar/2015 13:26:25] "GET /abe.css HTTP/1.1" 200 1398
177.179.77.173 - - [19/Mar/2015 13:26:25] "GET /htmlcoin_explorer_info.png HTTP/1.1" 200 17751
177.179.77.173 - - [19/Mar/2015 13:26:25] "GET /sidebar_shadow.png HTTP/1.1" 200 204
Opened /root/.HTML5/blk0001.dat
block_tx 269323 425482
commit
Opened /root/.HTML5/blk0001.dat
177.179.77.173 - - [19/Mar/2015 13:28:07] "GET /search?q=cb20a83bfb566946a32402628af10455abf67e580677e883d5b601b974971a3c HTTP/1.1" 301 309
Opened /root/.HTML5/blk0001.dat
Opened /root/.HTML5/blk0001.dat
177.179.77.173 - - [19/Mar/2015 13:28:08] "GET /tx/cb20a83bfb566946a32402628af10455abf67e580677e883d5b601b974971a3c HTTP/1.1" 200 3268
177.179.77.173 - - [19/Mar/2015 13:28:08] "GET /abe.css HTTP/1.1" 200 1398
177.179.77.173 - - [19/Mar/2015 13:28:09] "GET /layout.css HTTP/1.1" 200 16813
177.179.77.173 - - [19/Mar/2015 13:28:09] "GET /htmlcoin_explorer_info.png HTTP/1.1" 200 17751
177.179.77.173 - - [19/Mar/2015 13:28:09] "GET /sidebar_shadow.png HTTP/1.1" 200 204
Opened /root/.HTML5/blk0001.dat
Opened /root/.HTML5/blk0001.dat
177.179.77.173 - - [19/Mar/2015 13:29:24] "GET /search?q=0000000024879da76c0253c440d3b494bc97bfcd7ea9a41264e1685d1011f950 HTTP/1.1" 301 315
Opened /root/.HTML5/blk0001.dat
Opened /root/.HTML5/blk0001.dat
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 "/root/HTMLCoinExplorer/HTMLCoin-Abe/abe.py", line 252, in __call__
    handler(page)
  File "/root/HTMLCoinExplorer/HTMLCoin-Abe/abe.py", line 803, in handle_block
    abe._show_block('block_hash = ?', (dbhash,), page, '', None)
  File "/root/HTMLCoinExplorer/HTMLCoin-Abe/abe.py", line 663, in _show_block
    is_stake_chain = chain.has_feature('nvc_proof_of_stake')
AttributeError: 'NoneType' object has no attribute 'has_feature'
177.179.77.173 - - [19/Mar/2015 13:29:25] "GET /block/0000000024879da76c0253c440d3b494bc97bfcd7ea9a41264e1685d1011f950 HTTP/1.1" 500 59

OBSERVATION: The block dump on the wallet:

{
"hash" : "0000000024879da76c0253c440d3b494bc97bfcd7ea9a41264e1685d1011f950",
"confirmations" : 1,
"size" : 247,
"height" : 269314,
"version" : 6,
"merkleroot" : "cb20a83bfb566946a32402628af10455abf67e580677e883d5b601b974971a3c",
"mint" : 5000.00000000,
"time" : 1426782361,
"nonce" : 14839808,
"bits" : "1c7e4ca3",
"difficulty" : 2.02689934,
"blocktrust" : "206e4e6eb",
"chaintrust" : "70db29ab303a1",
"previousblockhash" : "000000003263cad0ab7a19167a186b780d2eed666f6ee7f25044b49bd50cafff",
"flags" : "proof-of-work",
"proofhash" : "0000000024879da76c0253c440d3b494bc97bfcd7ea9a41264e1685d1011f950",
"entropybit" : 0,
"modifier" : "ce0b64083172090f",
"modifierchecksum" : "bf130bb8",
"tx" : [
"cb20a83bfb566946a32402628af10455abf67e580677e883d5b601b974971a3c"
]
}
TheTribesman commented 9 years ago

Looks like you need to edit the Chain.py (I think you are using only one modified Chain file). Check functions being imported for HTMLcoin.

This: is_stake_chain = chain.has_feature('nvc_proof_of_stake') AttributeError: 'NoneType' object has no attribute 'has_feature'

Looks like you may need to Add PpcPosChain to Chain.py entry for HTMLcoin or some dependency of that nature. Somewhere to start looking.

leandrogomesmachado commented 9 years ago

Hello, Thank you for you fast reply again Mr. Kobocoin!

See my Chain.py file:

# Copyright(C) 2014 by Abe developers.

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Affero General Public License for more details.
# 
# You should have received a copy of the GNU Affero General Public
# License along with this program.  If not, see
# <http://www.gnu.org/licenses/agpl.html>.

import deserialize
import util

def create(policy, **kwargs):
    #print "create(%s, %r)" % (policy, kwargs)
    if policy in [None]:
        return HTMLcoin(**kwargs)

    if policy == "Latium":
        return Latium(**kwargs)
    if policy == "Peercoin":
        return Peercoin(**kwargs)
    if policy == "NovaCoin":
        return NovaCoin(**kwargs)
    if policy == "HTMLcoin":
        return HTMLcoin(**kwargs)
    return Sha256NmcAuxPowChain(**kwargs)

class Chain(object):
    def __init__(chain, src=None, **kwargs):
        for attr in [
            'id', 'magic', 'name', 'code3', 'address_version', 'decimals']:

            if attr in kwargs:
                val = kwargs.get(attr)
            elif hasattr(chain, attr):
                continue
            elif src is not None:
                val = getattr(src, attr)
            else:
                val = None
            setattr(chain, attr, val)

    def has_feature(chain, feature):
        return feature == 'nvc_proof_of_stake'

    def ds_parse_block_header(chain, ds):
        return deserialize.parse_BlockHeader(ds)

    def ds_parse_transaction(chain, ds):
        return deserialize.parse_Transaction(ds)

    def ds_parse_block(chain, ds):
        d = chain.ds_parse_block_header(ds)
        d['transactions'] = []
        nTransactions = ds.read_compact_size()
        for i in xrange(nTransactions):
            d['transactions'].append(chain.ds_parse_transaction(ds))
        return d

    def ds_serialize_block_header(chain, block):
        import BCDataStream
        ds = BCDataStream.BCDataStream()
        ds.write_int32(block['version'])
        ds.write(block['hashPrev'])
        ds.write(block['hashMerkleRoot'])
        ds.write_uint32(block['nTime'])
        ds.write_uint32(block['nBits'])
        ds.write_uint32(block['nNonce'])
        ds.seek_file(0)
        return ds

    def serialize_block_header(chain, block):
        return chain.ds_serialize_block_header(block).input

    def ds_block_header_hash(chain, ds):
        return chain.block_header_hash(
            ds.input[ds.read_cursor : ds.read_cursor + 80])

    def transaction_hash(chain, binary_tx):
        return util.double_sha256(binary_tx)

    def parse_transaction(chain, binary_tx):
        return chain.ds_parse_transaction(util.str_to_ds(binary_tx))

    datadir_conf_file_name = "Latium.conf"
    datadir_rpcport = 12689

class Sha256Chain(Chain):
    def block_header_hash(chain, header):
        return util.double_sha256(header)

    def has_feature(chain, feature):
        return feature == 'nvc_proof_of_stake'  

class NmcAuxPowChain(Chain):
    def __init__(chain, **kwargs):
        chain.block_version_bit_merge_mine = 8
        Chain.__init__(chain, **kwargs)

    def ds_parse_block_header(chain, ds):
        d = Chain.ds_parse_block_header(chain, ds)
        if d['version'] & (1 << 8):
            d['auxpow'] = deserialize.parse_AuxPow(ds)
        return d

    def has_feature(chain, feature):
        return feature == 'nvc_proof_of_stake'

class Sha256NmcAuxPowChain(Sha256Chain, NmcAuxPowChain):
    pass

class LtcScryptChain(Chain):
    def block_header_hash(chain, header):
        import ltc_scrypt
        return ltc_scrypt.getPoWHash(header)

class X15Chain(Chain):
    def block_header_hash(chain, header):
        import x15_hash
        return x15_hash.getPoWHash(header)

class PpcPosChain(Chain):
    def ds_parse_transaction(chain, ds):
        return deserialize.parse_Transaction(ds, has_nTime=True)

    def ds_parse_block(chain, ds):
        d = Chain.ds_parse_block(chain, ds)
        d['block_sig'] = ds.read_bytes(ds.read_compact_size())
        return d

class NovaCoin(LtcScryptChain, PpcPosChain):
    def __init__(chain, **kwargs):
        chain.name = 'NovaCoin'
        chain.code3 = 'NVC'
        chain.address_version = "\x08"
        chain.magic = "\xe4\xe8\xe9\xe5"
        chain.decimals = 6
        Chain.__init__(chain, **kwargs)

    def has_feature(chain, feature):
        return feature == 'nvc_proof_of_stake'

    datadir_conf_file_name = "novacoin.conf"
    datadir_rpcport = 8344

class Latium(LtcScryptChain, PpcPosChain):
    def __init__(chain, **kwargs):
        chain.name = 'Latium'
        chain.code3 = 'LAT'
        chain.address_version = "\x17"
        chain.magic = "\xae\xdb\xfc\xb2"
        chain.decimals = 6
        Chain.__init__(chain, **kwargs)

    def has_feature(chain, feature):
        return feature == 'nvc_proof_of_stake'

    datadir_conf_file_name = "Latium.conf"
    datadir_rpcport = 12689

class Peercoin(Sha256Chain, PpcPosChain):
    def __init__(chain, **kwargs):
        chain.name = 'Peercoin'
        chain.code3 = 'PPC'
        chain.address_version = "\x85"
        chain.magic = "\xe6\xe8\xe9\xe5"
        chain.decimals = 6
        Chain.__init__(chain, **kwargs)

    def has_feature(chain, feature):
        return feature == 'nvc_proof_of_stake'

    datadir_conf_file_name = "ppcoin.conf"
    datadir_rpcport = 9902

class HTMLcoin(X15Chain, PpcPosChain):
    def __init__(chain, **kwargs):
        chain.name = 'HTMLcoin'
        chain.code3 = 'HTM'
        chain.address_version = "\x28"
        chain.magic = "\xa8\xa3\xa1\xa4"
        chain.decimals = 6
        Chain.__init__(chain, **kwargs)

    def has_feature(chain, feature):
        return feature == 'nvc_proof_of_stake'

    datadir_conf_file_name = "Htmlcoin.conf"
    datadir_rpcport = 6876
TheTribesman commented 9 years ago

:) I believe our problem is the same. I see you have 2 entries of

def has_feature(chain, feature):
    return feature == 'nvc_proof_of_stake'

in the Chain.py file. Is the first entry required?

        if attr in kwargs:
            val = kwargs.get(attr)
        elif hasattr(chain, attr):
            continue
        elif src is not None:
            val = getattr(src, attr)
        else:
            val = None
        setattr(chain, attr, val)

def has_feature(chain, feature):
    return feature == 'nvc_proof_of_stake'

def ds_parse_block_header(chain, ds):
    return deserialize.parse_BlockHeader(ds)

I'm not a coder, I just know code structure so I may be wrong.

leandrogomesmachado commented 9 years ago

Your problem I know where (to continue validating the blocks) is located, I made a "hook" to work, but I need test before to show...

New Chain.py file, same error:

# Copyright(C) 2014 by Abe developers.

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Affero General Public License for more details.
# 
# You should have received a copy of the GNU Affero General Public
# License along with this program.  If not, see
# <http://www.gnu.org/licenses/agpl.html>.

import deserialize
import util

def create(policy, **kwargs):
    #print "create(%s, %r)" % (policy, kwargs)
    if policy in [None]:
        return HTMLcoin(**kwargs)

    if policy == "Latium":
        return Latium(**kwargs)
    if policy == "Peercoin":
        return Peercoin(**kwargs)
    if policy == "NovaCoin":
        return NovaCoin(**kwargs)
    if policy == "HTMLcoin":
        return HTMLcoin(**kwargs)
    return Sha256NmcAuxPowChain(**kwargs)

class Chain(object):
    def __init__(chain, src=None, **kwargs):
        for attr in [
            'id', 'magic', 'name', 'code3', 'address_version', 'decimals']:

            if attr in kwargs:
                val = kwargs.get(attr)
            elif hasattr(chain, attr):
                continue
            elif src is not None:
                val = getattr(src, attr)
            else:
                val = None
            setattr(chain, attr, val)

    def ds_parse_block_header(chain, ds):
        return deserialize.parse_BlockHeader(ds)

    def ds_parse_transaction(chain, ds):
        return deserialize.parse_Transaction(ds)

    def ds_parse_block(chain, ds):
        d = chain.ds_parse_block_header(ds)
        d['transactions'] = []
        nTransactions = ds.read_compact_size()
        for i in xrange(nTransactions):
            d['transactions'].append(chain.ds_parse_transaction(ds))
        return d

    def ds_serialize_block_header(chain, block):
        import BCDataStream
        ds = BCDataStream.BCDataStream()
        ds.write_int32(block['version'])
        ds.write(block['hashPrev'])
        ds.write(block['hashMerkleRoot'])
        ds.write_uint32(block['nTime'])
        ds.write_uint32(block['nBits'])
        ds.write_uint32(block['nNonce'])
        ds.seek_file(0)
        return ds

    def serialize_block_header(chain, block):
        return chain.ds_serialize_block_header(block).input

    def ds_block_header_hash(chain, ds):
        return chain.block_header_hash(
            ds.input[ds.read_cursor : ds.read_cursor + 80])

    def transaction_hash(chain, binary_tx):
        return util.double_sha256(binary_tx)

    def parse_transaction(chain, binary_tx):
        return chain.ds_parse_transaction(util.str_to_ds(binary_tx))

    datadir_conf_file_name = "Latium.conf"
    datadir_rpcport = 12689

class Sha256Chain(Chain):
    def block_header_hash(chain, header):
        return util.double_sha256(header)

    def has_feature(chain, feature):
        return feature == 'nvc_proof_of_stake'  

class NmcAuxPowChain(Chain):
    def __init__(chain, **kwargs):
        chain.block_version_bit_merge_mine = 8
        Chain.__init__(chain, **kwargs)

    def ds_parse_block_header(chain, ds):
        d = Chain.ds_parse_block_header(chain, ds)
        if d['version'] & (1 << 8):
            d['auxpow'] = deserialize.parse_AuxPow(ds)
        return d

    def has_feature(chain, feature):
        return feature == 'nvc_proof_of_stake'

class Sha256NmcAuxPowChain(Sha256Chain, NmcAuxPowChain):
    pass

class LtcScryptChain(Chain):
    def block_header_hash(chain, header):
        import ltc_scrypt
        return ltc_scrypt.getPoWHash(header)

class X15Chain(Chain):
    def block_header_hash(chain, header):
        import x15_hash
        return x15_hash.getPoWHash(header)

class PpcPosChain(Chain):
    def ds_parse_transaction(chain, ds):
        return deserialize.parse_Transaction(ds, has_nTime=True)

    def ds_parse_block(chain, ds):
        d = Chain.ds_parse_block(chain, ds)
        d['block_sig'] = ds.read_bytes(ds.read_compact_size())
        return d

class NovaCoin(LtcScryptChain, PpcPosChain):
    def __init__(chain, **kwargs):
        chain.name = 'NovaCoin'
        chain.code3 = 'NVC'
        chain.address_version = "\x08"
        chain.magic = "\xe4\xe8\xe9\xe5"
        chain.decimals = 6
        Chain.__init__(chain, **kwargs)

    def has_feature(chain, feature):
        return feature == 'nvc_proof_of_stake'

    datadir_conf_file_name = "novacoin.conf"
    datadir_rpcport = 8344

class Latium(LtcScryptChain, PpcPosChain):
    def __init__(chain, **kwargs):
        chain.name = 'Latium'
        chain.code3 = 'LAT'
        chain.address_version = "\x17"
        chain.magic = "\xae\xdb\xfc\xb2"
        chain.decimals = 6
        Chain.__init__(chain, **kwargs)

    def has_feature(chain, feature):
        return feature == 'nvc_proof_of_stake'

    datadir_conf_file_name = "Latium.conf"
    datadir_rpcport = 12689

class Peercoin(Sha256Chain, PpcPosChain):
    def __init__(chain, **kwargs):
        chain.name = 'Peercoin'
        chain.code3 = 'PPC'
        chain.address_version = "\x85"
        chain.magic = "\xe6\xe8\xe9\xe5"
        chain.decimals = 6
        Chain.__init__(chain, **kwargs)

    def has_feature(chain, feature):
        return feature == 'nvc_proof_of_stake'

    datadir_conf_file_name = "ppcoin.conf"
    datadir_rpcport = 9902

class HTMLcoin(X15Chain, PpcPosChain):
    def __init__(chain, **kwargs):
        chain.name = 'HTMLcoin'
        chain.code3 = 'HTM'
        chain.address_version = "\x28"
        chain.magic = "\xa8\xa3\xa1\xa4"
        chain.decimals = 6
        Chain.__init__(chain, **kwargs)

    def has_feature(chain, feature):
        return feature == 'nvc_proof_of_stake'

    datadir_conf_file_name = "Htmlcoin.conf"
    datadir_rpcport = 6876

@kobocoin Please, see at my github my last commit. Will solve your problem with merkle verification!

Thanks

TheTribesman commented 9 years ago

I'll check. Thanks.

MatthewLM commented 9 years ago

Your explorer configuration is not using the "HTMLcoin" policy. Have you set the coin policy in the configuration file? Can you please confirm that the row for your coin in the chain table contains HTMLcoin for the chain_policy column.

leandrogomesmachado commented 9 years ago

Hello @MatthewLM Thanks for your time and help, Here are my abe-load.conf file:

# Config file for HTMLCoin-HTMLCoin-Abe.

# dbtype and connect-args are required.
# If not configured to run under FastCGI, host OR port is required.

# "NAME=VALUE" and "NAME VALUE" are equivalent.  Just "NAME" sets
# value to True.  Values of the form "..." or [...]  or {...} are
# parsed as extended JSON, as are the values true, false, and null.
# HTMLCoin-Abe extends JSON syntax to allow strings to contain control
# characters (tab, LF, and CR) and to allow comments (from # to end of
# line) between tokens.

# "NAME += VALUE" appends VALUE to an array or updates an object
# defined by NAME.  Hyphen in NAME is read as underscore, so
# "connect_args" and "connect-args" are synonymous.  Later values
# override earlier ones (unless using "+=").

# All values may be passed as command-line arguments by preceding NAME
# with "--".  Example: "python -m HTMLCoin-Abe.abe --upgrade --dbtype=sqlite3
# --connect-args=abe.sqlite --port 2750".

# dbtype is the name of a Python module.  connect-args are arguments
# to pass to the module's "connect" function.  Consult the module's
# documentation for values.  The user needs permission to create
# tables.  Consult your database documentation on how to configure a
# database.  See also README.txt.

# PostgreSQL example; see also README-POSTGRES.txt:
#dbtype = psycopg2
#connect-args = { "database": "abe" }

# MySQL example; see also README-MYSQL.txt:
dbtype MySQLdb
connect-args {"user":"abe","db":"abe","passwd":"TuSiRa2203"}

# SQLite3 example:
#dbtype = sqlite3
#connect-args = abe.sqlite

# Oracle example:
#dbtype=cx_Oracle
#connect-args=user/pass@SID

# ODBC examples.  Don't use the same schema via ODBC and non-ODBC!
#dbtype = pyodbc
#connect-args = DSN=HTMLCoin-Abe;PWD=B!tc0iN;
#connect-args = DRIVER={ORACLE};DB=ORCL;UID=abe;PWD=Bitcoin;
#connect-args = DRIVER={PostgreSQL ANSI};Database=abe;

# Workaround for ODBC drivers that begin in autocommit mode:
#connect-args {"":"DRIVER={PostgreSQL ANSI};Database=abe;","autocommit":false}

# IBM DB2 example:
#dbtype = ibm_db_dbi
#connect-args {"dsn":"DATABASE=abe;UID=db2inst1;PWD=B!tCo1N","conn_options":{"102":0}}

# Specify port and/or host to serve HTTP instead of FastCGI:
port 80
host 64.57.133.2

# Specify no-serve to exit immediately after importing block files:
#no-serve

# Specify no-load to start abe server without ever loading the
# blockchain - this is useful if you have a dedicated instance loading
# blocks into your HTMLCoin-Abe database.
#no-load

# "upgrade" tells HTMLCoin-Abe to upgrade database objects automatically after
# code updates:
upgrade
#
# Sometimes upgrades fail and leave the database unusable.  Sometimes
# upgrades take several minutes or longer.  You may get an idea of the
# time required by looking at comments near the bottom of
# HTMLCoin-Abe/upgrade.py.  For example, if your schema version is HTMLCoin-Abe18 and
# you are upgrading to schema version HTMLCoin-Abe19, the relevant lines are:
#
#    ('Abe18',   add_block_num_tx),       # Seconds
#    ('Abe18.1', add_block_ss_destroyed), # Seconds
#    ('Abe18.2', init_block_tx_sums),     # 5 minutes
#    ('Abe18.3', replace_chain_summary),  # Fast
#
# In this case, you could expect a 5-minute upgrade.  The following
# SQL shows the current schema version, provided that it is at least
# Abe13:
#
#    SELECT configvar_value FROM configvar
#     WHERE configvar_name = 'schema_version'
#
# "python -m HTMLCoin-Abe.abe -v" shows the schema version that the software
# requires.  Sometimes you can upgrade a live database by running
# "python -m HTMLCoin-Abe.abe --config YOUR_ABE_CONFIG --no-serve --upgrade"
# but this often results in server errors and may sometimes corrupt
# the data.  It is best if the upgrade process has exclusive access to
# the database.

# Include another configuration file, relative to this one's directory.
#config ../secret/abe.conf

# Add or replace object fields.  This example assumes connect-args
# previously held an object such as { "user": "abe" }.
#connect-args += { "password": "B!tc0iN" }

# datadir lists directories to scan for block files.
#datadir += /home/bitcoin/.bitcoin/testnet
#datadir += /home/bitcoin/.namecoin
#datadir += /home/bitcoin/.novacoin

# datadir 
datadir += [{
        "dirname": "/root/.HTML5",
        "chain": "HTMLcoin",
        "code3":   "HTM",
        "address_version": "\u0028", 
        "policy": "HTMLcoin"
        }]
#datadir += [{
#        "dirname": "/home/bitcoin/.bitcoin",
#        "loader": "rpc",    # See the comments for default-loader below.
#        "chain": "Bitcoin"
#      }]
#datadir += [{
#        "dirname": "/home/jtobey/.novacoin",
#        "chain": "NewCoin",   # Display as "NewCoin" ...
#        "policy": "NovaCoin"  # ... but use the "NovaCoin" loader.
#      }]

# datadir can supply information about new currencies.
# Note that "address_version" is a byte string: the byte (or, perhaps
# someday, several bytes) preceding the public key hash before base-58
# conversion.  Example:
#
#datadir += [{
#        "dirname": "/home/weeds/testnet",
#        "chain":   "Weeds",
#        "code3":   "WDS",
#        "address_version": "\u00f3" }]
#datadir += [{
#        "dirname":"/home/namecoin/.namecoin/testnet",
#        "chain":"NCTestnet",
#        "code3":"NC0",
#        "address_version":"\u006f",
#        "conf": "namecoin.conf" }]

# ignore-bit8-chains: list of chains for which block version bit 8 does
# NOT indicate a Namecoin-style merge-mined auxiliary proof-of-work.
#ignore-bit8-chains = ["Bitcoin", "Testnet"]

# Set binary-type=hex if you want to store binary data (hashes,
# scripts, keys, etc.) as hexadecimal strings regardless of the
# database's binary data support.
#
# To use experimental support for PostgreSQL BYTEA storage, set
# binary-type=pg-bytea.  This may become the default on databases that
# support it.
#
# To use MySQL binary types, set binary-type=binary. This may become the
# default on databases that support it.
#
# The binary-type setting affects only the first run, where HTMLCoin-Abe
# creates its tables.
binary-type binary

# Some databases have trouble with the large integers that HTMLCoin-Abe uses
# for statistics.  Setting int-type=str causes HTMLCoin-Abe to pass certain
# integers to the database as strings and cast them to floating point
# in SQL expressions that calculate statistics.  Try this if SQLite
# complains "OverflowError: long too big to convert".
#int-type str

# URL component for static content: logos, style sheets.
#static-path =

# Filesystem location of static content, if served by HTMLCoin-Abe.
#document-root = HTMLCoin-Abe/htdocs

# Uncomment "auto-agpl" to add a "Source" link to each page pointing
# to a "/download" URL that streams the directory containing abe.py
# and all subdirectories as a compressed TAR archive.  This exposes
# files outside of the htdocs directory to the client, so use it with
# caution.
#auto-agpl

# Directory name and tarfile name prefix for auto-agpl source
# download.
#download-name = abe

# Primitive template system until I separate view from controller.
#template_vars += {
#    "CONTENT_TYPE": "text/html; charset=utf-8",
#    "APPNAME": "HTMLCoin-Abe"
#}
#template_vars += { "HOMEPAGE": "chain/HTMLcoin" }
#template = "
#<!DOCTYPE html>
#<html lang=\"en\">
#<head>
#    <link rel=\"stylesheet\" type=\"text/css\" href=\"%(dotdot)s%(STATIC_PATH)slayout.css\" />
#    <link rel=\"stylesheet\" type=\"text/css\" href=\"%(dotdot)s%(STATIC_PATH)sabe.css\" />
#    <link rel=\"shortcut icon\" href=\"%(dotdot)s%(STATIC_PATH)sfavicon.ico\" />
#    %(extraHead)s
#    <title>%(title)s</title>
#</head>
#<body>
#    <section id=\"main\">
#    <a href=\"http://explorer.htmlcoin.com\" title=\"Go back to the explorer.htmlcoin.com home\">
#        <img id=\"htmlcoinexplorerinfo\" alt=\"Go back to the explorer.htmlcoin.com home\" src=\"%(dotdot)s%(STATIC_PATH)shtmlcoin_explorer_info.png\" />
#    </a>
#    %(body)s
#        <div id=\"footer\">
#            <p><a href=\"%(dotdot)sq\">API</a> (machine-readable pages)</p>
#            <p style=\"font-size: smaller\">
#                <span style=\"font-style: italic\">
#                    Powered by <a href=\"%(ABE_URL)s\">%(APPNAME)s</a>
#                </span>
#                %(download)s
#            </p>
#        </div>
#    </section>
#</body>
#</html>
#"

# Save blocks to the database after reading this many bytes from a
# file.  HTMLCoin-Abe may run faster with a higher value, for example 10000,
# while loading lots of data with a single process.  Non-zero values
# can lead to errors when two processes load transaction data
# simultaneously.
commit-bytes = 10000

# "rescan" causes HTMLCoin-Abe to search all block files for new blocks.  This
# can take several minutes on a large chain, longer if many of the
# blocks are not already in HTMLCoin-Abe's database.  You might want to do this
# if HTMLCoin-Abe becomes stuck at an old block number: new blocks are loaded
# but not attached to the chain.  You must run once with "rescan"
# after switching to another copy of the block files.
#rescan

# For displaying short links, base-url overrides the first part of the
# URL.  This does not affect the link target, only the visible text.
# The value must include the trailing slash (/) if applicable.
# base-url = http://explorer.htmlcoin.com/

# History pages of addresses with more than this many receipts will be
# not be shown.  This protects against denial of service.  Use -1 for
# no limit.  This also limits the total inputs shown by
# /unspent/ADDR|ADDR|...
#address-history-rows-max 1000

# Argument to logging.config.dictConfig.  Requires Python 2.7 or later.
# http://docs.python.org/library/logging.config.html#logging-config-dictschema
#logging = {
#    "version":1,
#    "handlers": {
#        "console": {
#            "class": "logging.StreamHandler",
#            "formatter": "full",
#            "level": "DEBUG"}},
#    "formatters": {
#        "full": {
#            "format": "%(asctime)s [%(process)d:%(threadName)s] %(name)s %(levelname)s - %(message)s"}},
#    "root": {
#        "handlers": ["console"],
#        "level": "DEBUG"}}

# --log-sql logs all queries.  This is quite verbose, so it is disabled
# by default.
#log-sql

# Create and use the abe_firstbits table.  This affects only the first
# run, where HTMLCoin-Abe creates its tables, or the first run after an upgrade
# to firstbits-enabled HTMLCoin-Abe.  This is disabled by default.
#use-firstbits

# shortlink-type=firstbits constructs address short links using
# firstbits.  This is the default when use-firstbits is true.
# Otherwise, shortlink-type is a number of address characters to use.
# Fewer characters result in more collisions, where the page shows a
# list of matches instead of redirecting to the address history.
#shortlink-type 10

# keep-scriptsig=false prevents storage and display of transaction
# input signature scripts (scriptSig) and sequence numbers.  This
# reduces the database size by about 20%.
#keep-scriptsig

# Add transactions to the database.  The genesis transaction is
# unavailable via RPC and must be specified to enable full loading
# over RPC.  See HTMLCoin-Abe/genesis_tx.py.
#import-tx += 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000

# Use default-loader=blkfile to force HTMLCoin-Abe to load data by scanning
# blockfiles.  Use default-loader=rpc to force the use of RPC
# with a running bitcoind (or *coin daemon).  This requires:
#
#     * A readable bitcoin.conf with the RPC username and password
#
#     * HTTP access to bitcoind (SSL is not yet supported.)
#
#     * Bitcoin 0.8 or newer with the -txindex option.  (Run bitcoind
#       once with -reindex if you previously ran it without -txindex.)
#
#     * A "datadir" option with "chain":"Bitcoin" (or other chain
#       name)
#
#     * The "import-tx" option specifying the genesis transaction, if
#       "bitcoid getrawtransaction" does not return it and it is not
#       in HTMLCoin-Abe/genesis_tx.py.  (Bitcoin's genesis transaction is in
#       HTMLCoin-Abe/genesis_tx.py.  Otherwise, it requires manually parsing
#       the first blockfile.)
#
# By default, HTMLCoin-Abe tries RPC and falls back to blkfile if that fails.
# Use "rpc,blkfile" to specify this behaviour across upgrades, or
# "default" to let HTMLCoin-Abe choose.  The "loader" specified in a "datadir"
# entry takes precedence over "default-loader".
#
default-loader = blkfile

Here the chain on mysql: chain

MatthewLM commented 9 years ago

My assumption is that the policy is not loaded into the database. Please either:

  1. Edit the database with the correct policy manually.
  2. Drop the database and create it again, before starting Abe again.
leandrogomesmachado commented 9 years ago

@MatthewLM please see my comment below. I will try to recreate again the database with this poly and see if are ok! Thanks

TheTribesman commented 9 years ago

No Luck I'm afraid. I recreated DB and here's block 4007. Same NULL values

mysql> select * from block where block_id = 4007; +----------+----------------------------------+---------------+----------------------------------+-------------+-------------+--------------+--------------+---------------+-----------------+------------------+----------------+-----------------+----------------------+---------------------+-----------------------+----------------+--------------+--------------------+ | block_id | block_hash | block_version | block_hashMerkleRoot | block_nTime | block_nBits | block_nNonce | block_height | prev_block_id | search_block_id | block_chain_work | block_value_in | block_value_out | block_total_satoshis | block_total_seconds | block_satoshi_seconds | block_total_ss | block_num_tx | block_ssdestroyed | +----------+----------------------------------+---------------+----------------------------------+-------------+-------------+--------------+--------------+---------------+-----------------+------------------+----------------+-----------------+----------------------+---------------------+-----------------------+----------------+--------------+--------------------+ | 4007 | |�F>�Xy�z�D�ې�J}�]e=t42�cP�� | 6 | �Zz1�����:l�8��o<���4�������]�J | 1423542721 | 504222244 | 0 | NULL | NULL | NULL | NULL | 100000000000 | 100073319698 | -1 | NULL | NULL | NULL | 2 | NULL | +----------+----------------------------------+---------------+----------------------------------+-------------+-------------+--------------+--------------+---------------+-----------------+------------------+----------------+-----------------+----------------------+---------------------+-----------------------+----------------+--------------+--------------------+ 1 row in set (0.00 sec)

mysql>

MatthewLM commented 9 years ago

@machado-rev Hmm, I'm not sure what this is happening, I'd have to look via pdb, which is the python debugger to figure it out.

@kobocoin How about select * from block where block_id = 4006; ?

TheTribesman commented 9 years ago

Is it normal for the chain table to have empty values as I'm seeing

mysql> select * from chain; +----------+------------+-------------+-----------------------+------------------------+-------------+--------------+----------------+---------------------+ | chain_id | chain_name | chain_code3 | chain_address_version | chain_script_addr_vers | chain_magic | chain_policy | chain_decimals | chain_last_block_id | | ���� | Kobocoin | NULL | 4006 | +----------+------------+-------------+-----------------------+------------------------+-------------+--------------+----------------+---------------------+ 1 row in set (0.01 sec)

mysql>

TheTribesman commented 9 years ago

I posted select * from block where block_id = 4007 above. Here's 4005:

mysql> select * from block where block_id = 4005; +----------+----------------------------------+---------------+----------------------------------+-------------+-------------+--------------+--------------+---------------+-----------------+----------------------------------------+----------------+-----------------+----------------------+---------------------+-----------------------+----------------------+--------------+--------------------+ | block_id | block_hash | block_version | block_hashMerkleRoot | block_nTime | block_nBits | block_nNonce | block_height | prev_block_id | search_block_id | block_chain_work | block_value_in | block_value_out | block_total_satoshis | block_total_seconds | block_satoshi_seconds | block_total_ss | block_num_tx | block_ss_destroyed | z�a�r | 100000000000 | 100074786910 | 399900352090624 | 2451872 | 28986973939046511674 | 51068829309047800866 | 2 | 23584800000000000 | +----------+----------------------------------+---------------+----------------------------------+-------------+-------------+--------------+--------------+---------------+-----------------+----------------------------------------+----------------+-----------------+----------------------+---------------------+-----------------------+----------------------+--------------+--------------------+ 1 row in set (0.00 sec)

mysql>

TheTribesman commented 9 years ago

Here's block 4006 which also seems healthy but will not display:

mysql> select * from block where block_id = 4006; +----------+----------------------------------+---------------+----------------------------------+-------------+-------------+--------------+--------------+---------------+-----------------+----------------------------------------+----------------+-----------------+----------------------+---------------------+-----------------------+----------------------+--------------+--------------------+ | block_id | block_hash | block_version | block_hashMerkleRoot | block_nTime | block_nBits | block_nNonce | block_height | prev_block_id | search_block_id | block_chain_work | block_value_in | block_value_out | block_total_satoshis | block_total_seconds | block_satoshi_seconds | block_total_ss | block_num_tx | block_ss_destroyed | +----------+----------------------------------+---------------+----------------------------------+-------------+-------------+--------------+--------------+---------------+-----------------+----------------------------------------+----------------+-----------------+----------------------+---------------------+-----------------------+----------------------+--------------+--------------------+ | 4006 | �5��nI A�M�r� �yr#���"–i� | 6 | k�q^7�]x(�mQ��}��W�� r(��P��d | 1423542713 | 504222244 | 0 | 4005 | 4005 | 3005 | z�a*oC | 100000000000 | 100074746955 | 399900426837579 | 2451825 | 28944606422498252346 | 51050033992499541538 | 2 | 23572200000000000 | +----------+----------------------------------+---------------+----------------------------------+-------------+-------------+--------------+--------------+---------------+-----------------+----------------------------------------+----------------+-----------------+----------------------+---------------------+-----------------------+----------------------+--------------+--------------------+ 1 row in set (0.00 sec)

mysql>

leandrogomesmachado commented 9 years ago

I am creating a new instance based on tips, back soon with more news!

getting new errors when try to install here, I am downloading the blockchain again.

Thanks

leandrogomesmachado commented 9 years ago

Good morning @MatthewLM I have here some problems, explained with images, please can you acess my server to see the source? If you can, please send me email to sr.machado @ gmail.com (without spaces).

Commit without errors: commit_done

Now abe load without errors: abe_loaded_without_errors

I do a database backup: backup_of_database

And see the database looking for errors: database_populated database_chain_address_version datadir

So, when I edited and all are good, or not, I go to website and the Chain show 0 blocks:

website_not_showing_blocks website_not_showing_blocks2

I look for a tx: showing_transaction_message

And finally I look for a blockhash: showing_transaction_message

The console show this: final_hash_error_on_console

My server are only for tests and you can access it as root to know if you can and want, please help me I do all that I can but I don't know nothing about Python!

TheTribesman commented 9 years ago

I'm not sure. Run the following command on your system (from root of HTMLCoinExplorer):

find . | xargs grep 'has_feature' 2>>/dev/null

It might give you a pointer. I noticed you don't have NvcChain setup in your environment:

class NvcChain(LtcScryptChain, PpcPosChain): """ Chain with NovaCoin-style proof of stake. """ def has_feature(chain, feature): return feature == 'nvc_proof_of_stake'

Might help

Edit: also you don't have a 'Chain' directory

TheTribesman commented 9 years ago

But when I had only block 0 showing it was to do with PUBKEY's, magic numbers, address_versions etc

TheTribesman commented 9 years ago

SOLVED!!

I have a fix for you :dart:

My Abe explorer is now working, and I think this fix applies to all Abe explorers experiencing hashing issues. When I tell you, you'll laugh.

I matched the x15_hash module with the hashblock.h file. It meant creating a new x15_hash module. It appears x15hash module is so heavily modified that it now cannot be used without modification. Make sure you also use the sph* files that come with the coin in /src. Most files in x15_hash have been modified so best to use the ones that come with the coin source code. The two files to also check are x15_hash/x15.c and x15_hash/setup.py. They must both match the coin's hashblock.h file. Do not modify entries after the following line:

//these uint512 in the c++ source of the client are backed by an array of uint32

The format is different in the hashblock.h file.

Here's my working Abe http://82.211.31.186:8080/

I'm going to do a bit more testing and download a fresh copy of Abe and re-install to prove the fix.

Let me know if this works for you.

leandrogomesmachado commented 9 years ago

@kobocoin Please, can you add me on skype to talk?

leandro.coins

Thank you

leandrogomesmachado commented 9 years ago

@kobocoin can you do a commit on your github? I need see what I am doing with error, like no "Chain" folder.

Thanks sir

leandrogomesmachado commented 9 years ago

@kobocoin @MatthewLM just to say, works properly and good the tips that MR. Kobocoin said.

Running 100% good and fine now. Congratulations and thanks congrats

TheTribesman commented 9 years ago

Nice! I think that being aware of the hashblock.h file will definitely help any future Abe builds. Custom modules can be built for any coin quite quickly using this method. In fact every coin can have it's own module.

leandrogomesmachado commented 9 years ago

Yes, it's really good work together and find a solution! :)

Thank you

leandrogomesmachado commented 9 years ago

Now I just need learn setup FAST-CGI!

TheTribesman commented 9 years ago

Same here. I think I need a holiday first!

leandrogomesmachado commented 9 years ago

@kobocoin my blockexplorer are showing wrong value for blocks mined and address!

TheTribesman commented 9 years ago

What is it showing, and what are you expecting it to show?

leandrogomesmachado commented 9 years ago

It's showing 500000 coins, it's expected 5000! I know that is base on this lines: https://github.com/machado-rev/HTMLCoinExplorer/blob/master/HTMLCoin-Abe/abe.py#L2157-L2159

And: https://github.com/machado-rev/HTMLCoinExplorer/blob/master/HTMLCoin-Abe/DataStore.py#L2430

When I change and repopulate the DB change the values, it's very strange.

Another questions is the address that show from mined coin: error_address_value

It's really hard to work with abe!

TheTribesman commented 9 years ago

OK. Change your chain decimal in HTMLcoin.py

change this line chain.decimals = 6 to this: chain.decimals = 8

I think this will fix it. Also, check your abe.conf or whatever conf you're using to check if chain decimal has also been set there.

TheTribesman commented 9 years ago

My new clean kobocoin-abe cloned direct from from bitcoin-abe and updated with Kobocoin support is now committed to github. I'm having issues committing local changes to the github repository using push and commit for some reason. Very frustrating. Is ANYTHING easy to use in this game?

TheTribesman commented 9 years ago

for incorrect address showing, check address_version and PUBKEY_HASH. It is probably only the address prefix that is incorrect.

leandrogomesmachado commented 9 years ago

are ok on database, but I will see again the addess question and another minor changes. I can't use the new abe because don't have the function needed to work with Android wallet.. https://github.com/MatthewLM/PeercoinAbeExplorer/commit/f9b5428895ff440518816f8bd107f60377568bf5

TheTribesman commented 9 years ago

ah ok. I will have to redo Abe then. I'm also building android wallet.

TheTribesman commented 9 years ago

I've built Abe for Kobocoin using a cloned Peercoin Abe Explorer. It's running at the following address

http://167.160.36.102:2751/ (Test version - showing 'no block data found' - I'm running a separate coin daemon and using a new blkfile)

The live version is here - http://167.160.36.102:2750/. The live version is not using Peercoin Abe Explorer. It's cloned directly from bitcoin-abe.

@machado-rev I'm now receiving one of the errors you posted:

Opened /home/cronos/.Kobocoin/blk0001.dat Exception at 5199969820556132490 Failed to catch up {'blkfile_offset': 0, 'blkfile_number': 1, 'chain_id': 9, 'loader': u'blkfile', 'conf': u'Kobocoin.conf', 'dirname': u'/home/cronos/.Kobocoin', 'id': 17L} Traceback (most recent call last): File "Kobocoin-Abe/DataStore.py", line 2771, in catch_up store.catch_up_dir(dircfg) File "Kobocoin-Abe/DataStore.py", line 3035, in catch_up_dir store.import_blkdat(dircfg, ds, blkfile['name']) File "Kobocoin-Abe/DataStore.py", line 3157, in import_blkdat b = chain.ds_parse_block(ds) File "Kobocoin-Abe/Chain.py", line 63, in ds_parse_block d['transactions'].append(chain.ds_parse_transaction(ds)) File "Kobocoin-Abe/Chain.py", line 56, in ds_parse_transaction return deserialize.parse_Transaction(ds) File "Kobocoin-Abe/deserialize.py", line 90, in parse_Transaction d['txIn'].append(parse_TxIn(vds)) File "Kobocoin-Abe/deserialize.py", line 46, in parse_TxIn d['sequence'] = vds.read_uint32() File "Kobocoin-Abe/BCDataStream.py", line 71, in read_uint32 def read_uint32 (self): return self._read_num('<I') File "Kobocoin-Abe/BCDataStream.py", line 110, in _read_num (i,) = struct.unpack_from(format, self.input, self.read_cursor) error: unpack_from requires a buffer of at least 4 bytes

I've tried excatly what solved it previously but it's not resolving it this time around. I haven't yet uploaded to git but settings in kobo.conf, Chain.py, and DataStore.py are exactly the same as the working Abe.

I've also added the following lines to Chain.py:

class X15Chain(Chain): def block_header_hash(chain, header): import x15_hash return x15_hash.getPoWHash(header)

class X15PosChain(X15Chain, PpcPosChain): def has_feature(chain, feature): return feature == 'nvc_proof_of_stake'

class NvcChain(LtcScryptChain, PpcPosChain): def has_feature(chain, feature): return feature == 'nvc_proof_of_stake'

And further down:

class Kobocoin(X15PosChain, NvcChain): def init(chain, _kwargs): chain.name = 'Kobocoin' chain.code3 = 'KOBO' chain.address_version = "\x23" chain.magic = "\xa1\xa0\xa2\xa3" chain.decimals = 6 Chain.init(chain, _kwargs)

def has_feature(chain, feature): return feature == 'nvc_proof_of_stake'

datadir_conf_file_name = "Kobocoin.conf"
datadir_rpcport = 3341

Any ideas on what could be causing this failure? I can imagine there's something to be said for my 'unusual' chain configuration above (but it works fine for the current kobocoin-abe - though thats a different code layout). Any pointers appreciated.

I did notice that Peercoin is using a sha256 chain here, so I am a bit confused.

TheTribesman commented 9 years ago

Latest work is here:

https://github.com/kobocoin/PeercoinAbeExplorer/tree/Kobocoin

There is both the original Peercoin-Abe directory (which is untouched), and the Kobocoin-Abe directory (with all changes)

leandrogomesmachado commented 9 years ago

Good morning, your need do some things:

From Chain directory: chain_files 8d4a-a03cd6394439.jpg)

Remember you need send your x15 algorithm files based on your coin source, like sph_blake.c, sph_keccak.c, etc

Detail: probaly your coin Chain decimals are 8 too! This will run good

TheTribesman commented 9 years ago

Thanks! I will try it out and let you know.

TheTribesman commented 9 years ago

I have done this but am now getting the following error:

root@localhost:~/koboabe# Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/root/koboabe/Kobocoin-Abe/abe.py", line 32, in import DataStore File "Kobocoin-Abe/DataStore.py", line 34, in import Chain File "Kobocoin-Abe/Chain/init.py", line 52, in class BaseChain(object): File "Kobocoin-Abe/Chain/init.py", line 164, in BaseChain coinbase_prevout_hash = util.NULL_HASH AttributeError: 'module' object has no attribute 'NULL_HASH'

Not sure how to get over this one.

I've created the Chain directory and moved everything in there. Is there more I need to do after this to get it working. I know that some variables require values e.g

NULL_PUBKEY_HASH = "\0" * Chain.PUBKEY_HASH_LENGTH (must be substituted with integer)

Is this the same thing?

leandrogomesmachado commented 9 years ago

Oh well, I get this error too, just delete the file init.py located on CHAIN folder and run again, will work good!

TheTribesman commented 9 years ago

I am fast losing hope. I am back to this now:

root@localhost:~/koboabe# ./rebuild.sh root@localhost:~/koboabe# ddl_implicit_commit=true create_table_epilogue='' Kobocoin-Abe/DataStore.py:561: Warning: Converting column 'a' from VARCHAR to TEXT store.cursor.execute(stmt) Kobocoin-Abe/DataStore.py:561: Warning: Converting column 'b' from VARCHAR to TEXT store.cursor.execute(stmt) max_varchar=4294967295 clob_type=LONGTEXT Kobocoin-Abe/DataStore.py:561: Warning: Converting column 'test_varbit' from VARCHAR to TEXT store.cursor.execute(stmt) binary_type=hex int_type=int Created silly table abe_dual sequence_type=mysql limit_style=native Kobocoin-Abe/DataStore.py:561: Warning: Converting column 'txout_scriptPubKey' from VARCHAR to TEXT store.cursor.execute(stmt) Kobocoin-Abe/DataStore.py:561: Warning: Converting column 'txin_scriptSig' from VARCHAR to TEXT store.cursor.execute(stmt) Kobocoin-Abe/DataStore.py:525: Warning: Data truncated for column 'chain_code3' at row 1 store.cursor.execute(stmt, params) Opened /home/cronos/.Kobocoin/blk0001.dat Exception at 5199969820556132490 Failed to catch up {'blkfile_offset': 0, 'blkfile_number': 1, 'chain_id': 9, 'loader': u'blkfile', 'conf': u'Kobocoin.conf', 'dirname': u'/home/cronos/.Kobocoin', 'id': 1L} Traceback (most recent call last): File "Kobocoin-Abe/DataStore.py", line 2771, in catch_up store.catch_up_dir(dircfg) File "Kobocoin-Abe/DataStore.py", line 3035, in catch_up_dir store.import_blkdat(dircfg, ds, blkfile['name']) File "Kobocoin-Abe/DataStore.py", line 3157, in import_blkdat b = chain.ds_parse_block(ds) File "Kobocoin-Abe/Chain.py", line 63, in ds_parse_block d['transactions'].append(chain.ds_parse_transaction(ds)) File "Kobocoin-Abe/Chain.py", line 56, in ds_parse_transaction return deserialize.parse_Transaction(ds) File "Kobocoin-Abe/deserialize.py", line 90, in parse_Transaction d['txIn'].append(parse_TxIn(vds)) File "Kobocoin-Abe/deserialize.py", line 46, in parse_TxIn d['sequence'] = vds.read_uint32() File "Kobocoin-Abe/BCDataStream.py", line 71, in read_uint32 def read_uint32 (self): return self._read_num('<I') File "Kobocoin-Abe/BCDataStream.py", line 110, in _read_num (i,) = struct.unpack_from(format, self.input, self.read_cursor) error: unpack_from requires a buffer of at least 4 bytes

I'm wondering what is this exception??

Opened /home/cronos/.Kobocoin/blk0001.dat Exception at 5199969820556132490

It's as though chain config is wrong.

TheTribesman commented 9 years ago

Also, it seems to be still reading the Chain.py

File "Kobocoin-Abe/Chain.py", line 63, in ds_parse_block d['transactions'].append(chain.ds_parse_transaction(ds)) File "Kobocoin-Abe/Chain.py", line 56, in ds_parse_transaction return deserialize.parse_Transaction(ds)

I thought it would bypass the Chain.py for the Chain directory

TheTribesman commented 9 years ago

Do you know if there's any way to incorporate the Peercoin updates to my working Abe explorer?

TheTribesman commented 9 years ago

I have tried everything. I have rebuilt the entire explorer from scratch (at least 5 times) starting with a clone of PeercoinAbeExplorer.

All I need is something that can make this number change

Opened /root/.Kobocoin/blk0001.dat Exception at 5199969820556132490

My working Abe can read the blkfile without issue.

Most people are getting Exception at 8 (or at least a single digit). If I can get the exception number to change then I know I'm on the right track (that a setting is responsible or something to work with at least). That exception number has not changed no matter what I've tried.

I have no idea why that exception is occurring. Is there any way to further investigate what this Exception means. Any debugging tools you recommend?

leandrogomesmachado commented 9 years ago

Hello @kobocoin sorry I was sleeping, this error seems to be with the blocks on your .kobocoin, so, let's talk on skype to work together and fix this! :)

TheTribesman commented 9 years ago

OK, I have tried you already. One question. I ran the debugger and got something strange as a result. I saw this:

pi = '.', env = {'ANDROID_HOME': '/home/cronos/android-sdk-linux', 'ANDROID_SDK_HOME': '/home/cronos/android-sdk-linux', 'HOME': '/root', 'LANG': 'en_US.UTF-8', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'LOGNAME': 'root', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:d..._.axa=00;36:_.oga=00;36:_.spx=00;36:_.xspf=00;36:', 'MAIL': '/var/mail/root', 'OLDPWD': '/root/koboabe/Abe', ...}

<type 'exceptions.IndexError'>: string index out of range
      args = ('string index out of range',)
      message = 'string index out of range' Do you know if I need the Android SDK installed to build this version of Abe?