GithubHelp home page GithubHelp logo

multichain / multichain-explorer Goto Github PK

View Code? Open in Web Editor NEW
178.0 178.0 140.0 2.44 MB

Web-based explorer for MultiChain blockchains

License: GNU Affero General Public License v3.0

Python 98.18% CSS 0.16% JavaScript 1.49% Shell 0.17%

multichain-explorer's Introduction

MultiChain

MultiChain is an open source platform for private blockchains, which offers a rich set of features including extensive configurability, rapid deployment, permissions management, native assets and data streams. Although it is designed to enable private blockchains, MultiChain provides maximal compatibility with the bitcoin ecosystem, including the peer-to-peer protocol, transaction/block formats and Bitcoin Core APIs/runtime parameters.

Copyright (c) 2014-2019 Coin Sciences Ltd
License: GNU General Public License version 3, see COPYING

Portions copyright (c) 2009-2016 The Bitcoin Core developers
Portions copyright many others - see individual files

System requirements

These compilation instructions have been tested on Ubuntu 16.04 x64 (xenial) and Ubuntu 18.04 x64 (bionic) only.

C++ compilers are memory-hungry, so it is recommended to have at least 1 GB of memory available when compiling MultiChain. With less memory, compilation may take much longer due to swapfile thrashing.

Linux Build Notes (on Ubuntu 16.04 x64 or later)

Install dependencies

sudo apt-get update
sudo apt-get install -y software-properties-common
sudo apt-get install -y build-essential libtool autotools-dev automake pkg-config git
sudo apt-get install libboost-all-dev
sudo apt-get install libevent-dev

Clone MultiChain

git clone https://github.com/MultiChain/multichain.git

Prepare to download or build V8

cd multichain
MULTICHAIN_HOME=$(pwd)
mkdir v8build
cd v8build

You can use pre-built headers and binaries of Google's V8 JavaScript engine by downloading and expanding linux-v8.tar.gz in the current directory. If, on the other hand, you prefer to build the V8 component yourself, please follow the instructions in V8.md.

Compile MultiChain for Ubuntu (64-bit)

cd $MULTICHAIN_HOME
./autogen.sh
./configure
make

Notes

  • This will build multichaind, multichain-cli and multichain-util in the src directory.

  • The release is built with GCC after which strip multichaind strings the debug symbols, which reduces the executable size by about 90%.

Windows Build Notes

Please see the instructions in win.md to build MultiChain for use with Windows.

Mac Build Notes (on MacOS Sierra)

Please see the instructions in mac.md to build MultiChain for use with MacOS.

multichain-explorer's People

Contributors

amescornish avatar bitbandi avatar bitcartel avatar bitfoo avatar crowning- avatar csyangchen avatar dermoth avatar framer99 avatar gidgreen avatar jabbervorx avatar jl2035 avatar jtobey avatar melech avatar morinpa avatar n00bsys0p avatar recursive-rat4 avatar rixu101 avatar schinzelh avatar sdvii avatar sigshen avatar teamdandelion avatar zackster avatar ztarem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multichain-explorer's Issues

Multichain 2.0 Support

Hello,
I am wondering if or/and when will Multichain 2.0 be supported by the explorer.
Thanks in advance.

Traceback while running the multichain Explorer

Hi,

I tried running the explorer using the docker images at link:

https://github.com/Kunstmaan/docker-multichain

However, I'm running into an error where the explorer would keep giving the following stacktrace:

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/.local/lib/python2.7/site-packages/Mce/abe.py", line 319, in call
handler(page)
File "/root/.local/lib/python2.7/site-packages/Mce/abe.py", line 507, in handle_chains
body += abe.create_recent_table(page, chain)
File "/root/.local/lib/python2.7/site-packages/Mce/abe.py", line 541, in create_recent_table
sorted_recenttx = sorted(recenttx, key=lambda tx: tx['time'], reverse=True)
File "/root/.local/lib/python2.7/site-packages/Mce/abe.py", line 541, in
sorted_recenttx = sorted(recenttx, key=lambda tx: tx['time'], reverse=True)
KeyError: 'time'

It will always be "connection refused" and multichaind will always to abort

error:

127.0.0.1 - - [07/Nov/2017 20:52:34] "GET /logo32.png HTTP/1.1" 200 1376
RPC failed: [Errno socket error] [Errno 61] Connection refused
catch_up_rpc: abort
Opened /Users/michael/.multichain/monet/blocks/blk00000.dat
Exception: [Errno socket error] [Errno 61] Connection refused
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/Users/michael/repos/multichain-explorer/Mce/abe.py", line 321, in __call__
    handler(page)
  File "/Users/michael/repos/multichain-explorer/Mce/abe.py", line 1194, in handle_tx
    return abe.show_tx(page, tx)
  File "/Users/michael/repos/multichain-explorer/Mce/abe.py", line 1668, in show_tx
    row_to_html(txout, 'o', 'i', 'Not yet redeemed')
  File "/Users/michael/repos/multichain-explorer/Mce/abe.py", line 1595, in row_to_html
    abe.show_tx_row_to_html_impl(chain, body, asset_txid_dict, binscript, script_type, data)
  File "/Users/michael/repos/multichain-explorer/Mce/abe.py", line 1261, in show_tx_row_to_html_impl
    assetref = asset_txid_dict[dict['assetref']]['assetref']
KeyError: 'b21f78291b609eceffa576717ebb1110'
127.0.0.1 - - [07/Nov/2017 20:52:40] "GET /MultiChain%20chain1/tx/e4cbcb37c42cd8c65ade711b165f431a49dd9351854b29e8d36c830a7bddc6a0 HTTP/1.1" 500 59
RPC failed: [Errno socket error] [Errno 61] Connection refused
catch_up_rpc: abort
Opened /Users/michael/.multichain/monet/blocks/blk00000.dat
Exception: [Errno socket error] [Errno 61] Connection refused
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/Users/michael/repos/multichain-explorer/Mce/abe.py", line 321, in __call__
    handler(page)
  File "/Users/michael/repos/multichain-explorer/Mce/abe.py", line 1194, in handle_tx
    return abe.show_tx(page, tx)
  File "/Users/michael/repos/multichain-explorer/Mce/abe.py", line 1668, in show_tx
    row_to_html(txout, 'o', 'i', 'Not yet redeemed')
  File "/Users/michael/repos/multichain-explorer/Mce/abe.py", line 1595, in row_to_html
    abe.show_tx_row_to_html_impl(chain, body, asset_txid_dict, binscript, script_type, data)
  File "/Users/michael/repos/multichain-explorer/Mce/abe.py", line 1261, in show_tx_row_to_html_impl
    assetref = asset_txid_dict[dict['assetref']]['assetref']
KeyError: 'b21f78291b609eceffa576717ebb1110'
127.0.0.1 - - [07/Nov/2017 20:52:45] "GET /MultiChain%20chain1/tx/63c57e6afd1deb251c3c41219bada002b2b1763fa70ee84892edd917b453611e HTTP/1.1" 500 59
RPC failed: [Errno socket error] [Errno 61] Connection refused
catch_up_rpc: abort
Opened /Users/michael/.multichain/monet/blocks/blk00000.dat
[Errno socket error] [Errno 61] Connection refused
127.0.0.1 - - [07/Nov/2017 20:52:53] "GET / HTTP/1.1" 200 2793
RPC failed: [Errno socket error] [Errno 61] Connection refused
catch_up_rpc: abort
Opened /Users/michael/.multichain/monet/blocks/blk00000.dat
127.0.0.1 - - [07/Nov/2017 20:52:53] "GET /MultiChain%20chain1/recent?random=0.4414431583956733 HTTP/1.1" 200 103

It looks like some i query some address i have no permissions. But i should not abort

Error while syncing blocks

Hey guys,
Love what you are doing!

But I get this error while trying to sync blocks from the existing blockchain.

block_tx 62 63
block_tx 63 64
Exception at 3388430958997887345
Failed to catch up {'blkfile_offset': 0, 'blkfile_number': 100000, 'chain_id': 1, 'loader': u'default', 'conf': None, 'dirname': u'/root/.multichain/pharmacy', 'id': 1}
Traceback (most recent call last):
  File "Mce/DataStore.py", line 2903, in catch_up
    store.catch_up_dir(dircfg)
  File "Mce/DataStore.py", line 3215, in catch_up_dir
    store.import_blkdat(dircfg, ds, blkfile['name'])
  File "Mce/DataStore.py", line 3337, in import_blkdat
    b = chain.ds_parse_block(ds)
  File "Mce/Chain/__init__.py", line 133, in ds_parse_block
    d['transactions'].append(chain.ds_parse_transaction(ds))
  File "Mce/Chain/__init__.py", line 126, in ds_parse_transaction
    return deserialize.parse_Transaction(ds)
  File "Mce/deserialize.py", line 90, in parse_Transaction
    d['txIn'].append(parse_TxIn(vds))
  File "Mce/deserialize.py", line 46, in parse_TxIn
    d['sequence'] = vds.read_uint32()
  File "Mce/BCDataStream.py", line 71, in read_uint32
    def read_uint32 (self): return self._read_num('<I')
  File "Mce/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

MultiChain 1.0.9 Daemon (protocol 10004-10012)
Latest multichain-explorer version.
Ubuntu 18.04.3 LTS

Any idea why?
Thanks in advance!

Performance issues

I'm running a quite active network (20tx/block, 10s blocktime, 124k blocks) and the explorer has died completely.

The log is full of the following, but no more pages are being served.

block_tx 124391 7697233
block_tx 124391 7697234
block_tx 124391 7697235
block_tx 124391 7697236
block_tx 124391 7697237
block_tx 124391 7697238
block_tx 124391 7697239
commit
block_tx 124392 7697240
block_tx 124392 7697241
block_tx 124392 7697242
block_tx 124392 7697243
block_tx 124392 7697244
block_tx 124392 7697245
block_tx 124392 7697246
block_tx 124392 7697247
block_tx 124392 7697248
block_tx 124392 7697249
block_tx 124392 7697250
block_tx 124392 7697251
block_tx 124392 7697252
block_tx 124392 7697253
block_tx 124392 7697254
block_tx 124392 7697255
block_tx 124392 7697256
block_tx 124392 7697257
block_tx 124392 7697258
block_tx 124392 7697259
commit
block_tx 124393 7697260
block_tx 124393 7697261
block_tx 124393 7697262
block_tx 124393 7697263
block_tx 124393 7697264
block_tx 124393 7697265
block_tx 124393 7697266
block_tx 124393 7697267
block_tx 124393 7697268
block_tx 124393 7697269
block_tx 124393 7697270
block_tx 124393 7697271
block_tx 124393 7697272
block_tx 124393 7697273
block_tx 124393 7697274
block_tx 124393 7697275
block_tx 124393 7697276
block_tx 124393 7697277
block_tx 124393 7697278
block_tx 124393 7697279
block_tx 124393 7697280
block_tx 124393 7697281
block_tx 124393 7697282
block_tx 124393 7697283
block_tx 124393 7697284
block_tx 124393 7697285
block_tx 124393 7697286
block_tx 124393 7697287
block_tx 124393 7697288
block_tx 124393 7697289
block_tx 124393 7697290
block_tx 124393 7697291
block_tx 124393 7697292
block_tx 124393 7697293
block_tx 124393 7697294
block_tx 124393 7697295
block_tx 124393 7697296
block_tx 124393 7697297
block_tx 124393 7697298
block_tx 124393 7697299
block_tx 124393 7697300
block_tx 124393 7697301
block_tx 124393 7697302
block_tx 124393 7697303
block_tx 124393 7697304
block_tx 124393 7697305
block_tx 124393 7697306
block_tx 124393 7697307
block_tx 124393 7697308
block_tx 124393 7697309
block_tx 124393 7697310
block_tx 124393 7697311
block_tx 124393 7697312
block_tx 124393 7697313
block_tx 124393 7697314
block_tx 124393 7697315
block_tx 124393 7697316
block_tx 124393 7697317
commit

curl -i http://localhost:2750 just stalls

The explorer just goes to 100% CPU on one core and stays there indefinitely.

screen shot 2017-05-17 at 08 27 00

Any clue on how to revive the explorer?

Problem when not using multichain explorer from root path

There is a problem when multichain is for example used behind a reverse proxy.

e.g. when you use nginx and do the following mapping:

location /explorer {
    proxy_pass http://localhost:2750;
}

There are some links broken.
Most of the links use a relative link path, but there are some links that use the absolute root path.

For example:

 body += ['<td>Blocks</td>','<td><a href="/', escape(chain.name), '/blocks/">', info_resp['blocks'], '</a></td>']

at: https://github.com/MultiChain/multichain-explorer/blob/master/Mce/abe.py#L718

does not link to /explorer/ChainName/blocks/
it links to /ChainName/blocks because of the / at the beginning of the link ref.

Address does not exist

Hi,

I have a question. Not sure if it actually is a bug, if not, I would like to understand why this happens.

If I click on the miner address of the first two blocks (block 0 and block 1), it shows me

"Sorry, /address/1UcyC7TeBz4Dk... does not exist on this server."

If I click on the exact same address on the third block (block 2), it actually shows me the address information. Why is this?

Trying to create a protocol 10006 for explorer

[root@genesis bin]# multichain-util create explorer protocol-version=10006
MultiChain utilities build 1.0 alpha 27 protocol 10007

ERROR: Invalid value for protocol version. Valid range: 10002 - 10007
ERROR: Blockchain parameter set was not generated.

Error after creating a publishfrom transaction

Traceback (most recent call last):
  File "Mce/DataStore.py", line 2851, in catch_up
    if not store.catch_up_rpc(dircfg):
  File "Mce/DataStore.py", line 3083, in catch_up_rpc
    store.import_block(block, chain = chain)
  File "Mce/DataStore.py", line 1193, in import_block
    tx['tx_id'] = store.import_and_commit_tx(tx, pos == 0, chain)
  File "Mce/DataStore.py", line 2175, in import_and_commit_tx
    tx_id = store.import_tx(tx, is_coinbase, chain)
  File "Mce/DataStore.py", line 2115, in import_tx
    address = util.hash_to_address_multichain(vers, pubkey_hash, checksum)
  File "Mce/util.py", line 142, in hash_to_address_multichain
    vh += hash[pos:pos+5]
TypeError: unhashable type

Server error on Metadata transaction

Hi, i'm trying to access the details of a transacion marked as "metadata" by the explorer, and i got "A server error occurred. Please contact the administrator." All the other transactions looks ok

Traceback says:

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)
...
...
/multichain-explorer/Mce/abe.py", line 1167, in row_to_html
    if row['address_version'] is chain.script_addr_vers:
KeyError: 'address_version'

Multichain version Version 1.0 alpha 20
Blockexplorer is in sync with latests master branch

Let me know if you need any further information

JsonrpcException: getrawtransaction: No information available about transaction (code -710)

Hi, I got the explorer working on another PC so im unsure as to why its not working right now. I got a PC with Ubuntu Server 16.04.2 and want to start the explorer, however the following error is preventing me from that:

Failed to catch up {'blkfile_offset': 0, 'blkfile_number': 1, 'chain_id': 1, 'loader': u'default', 'conf': None, 'dirname': u'/home/USER/.multichain/development', 'id': 10}
Traceback (most recent call last):
File "Mce/DataStore.py", line 2892, in catch_up
if not store.catch_up_rpc(dircfg):
File "Mce/DataStore.py", line 3117, in catch_up_rpc
tx = get_tx(rpc_tx_hash)
File "Mce/DataStore.py", line 2974, in get_tx
rpc_tx_hex = rpc("getrawtransaction", rpc_tx_hash)
File "Mce/DataStore.py", line 2949, in rpc
ret = util.jsonrpc(chain_name, url, func, *params)
File "Mce/util.py", line 246, in jsonrpc
raise JsonrpcException(resp['error'], method, params)
JsonrpcException: getrawtransaction: No information available about transaction (code -710)

I've setup a multichain with protocol 10006 because that was the same protocol I was running on another PC. on the other multichain protocols i got the same error.

Can't use MySQL db

I'm trying to use Multichain's explorer with a mysql database but I'm getting:

root@instance-4:~/explorer# python -m Mce.abe --config mychain.conf --commit-bytes 100000 --no-serve
ddl_implicit_commit=true
create_table_epilogue=''
Mce/SqlAbstraction.py:437: Warning: Converting column 'a' from VARCHAR to TEXT
  sql.cursor().execute(stmt)
Mce/SqlAbstraction.py:437: Warning: Converting column 'b' from VARCHAR to TEXT
  sql.cursor().execute(stmt)
max_varchar=4294967295
clob_type=LONGTEXT
binary_type=binary
int_type=int
sequence_type=update
limit_style=native
Mce/SqlAbstraction.py:407: Warning: Truncated incorrect INTEGER value: 'foo'
  sql.cursor().execute(stmt, params)
Mce/SqlAbstraction.py:407: Warning: Truncated incorrect INTEGER value: 'bar'
  sql.cursor().execute(stmt, params)
Mce/SqlAbstraction.py:407: Warning: Truncated incorrect INTEGER value: 'baz'
  sql.cursor().execute(stmt, params)
Mce/SqlAbstraction.py:407: Warning: Truncated incorrect DOUBLE value: 'foo'
  sql.cursor().execute(stmt, params)
Mce/SqlAbstraction.py:407: Warning: Truncated incorrect DOUBLE value: 'bar'
  sql.cursor().execute(stmt, params)
Mce/SqlAbstraction.py:407: Warning: Truncated incorrect DOUBLE value: 'baz'
  sql.cursor().execute(stmt, params)
((0L, 0L),)
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, 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/explorer/Mce/abe.py", line 4300, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/root/explorer/Mce/abe.py", line 4294, in main
    store = make_store(args)
  File "/root/explorer/Mce/abe.py", line 193, in make_store
    store = DataStore.new(args)
  File "Mce/DataStore.py", line 4348, in new
    return DataStore(args)
  File "Mce/DataStore.py", line 187, in __init__
    store.initialize()
  File "Mce/DataStore.py", line 725, in initialize
    store.configure()
  File "Mce/DataStore.py", line 1072, in configure
    config = store._sql.configure()
  File "Mce/SqlAbstraction.py", line 547, in configure
    sql.configure_concat_style()
  File "Mce/SqlAbstraction.py", line 887, in configure_concat_style
    raise Exception("Can not find suitable concatenation style.")
Exception: Can not find suitable concatenation style.

I couldn't find anything about this on bitcoin-abe repo, so I though I should ask here first.

Assetref encoded

Please hel me,
on display transaction ammount allways show 0, because assetref its encoded on transaction

'd1f6ab03bbe476301895745655984c5e'
u'181-267-63185'

please help me to correct this

elif opdrop_type==util.OP_DROP_TYPE_SEND_ASSET or opdrop_type==util.OP_DROP_TYPE_ISSUE_MORE_ASSET:
for dict in val:
quantity = dict['quantity']
assetref = dict['assetref']
print(assetref,asset['assetref']);
if assetref == asset['assetref'].encode('hex'):
return quantity

Support for alpha 29?

Hi - just upgraded to build 1.0 alpha 29 and pulled the newest multichain-explorer code and now when I try to start multichain-explorer I get the following error:

Failed to catch up {'blkfile_offset': 0, 'blkfile_number': 1, 'chain_id': 1, 'loader': u'default', 'conf': None, 'dirname': u'/home/synergy/.multichain/guild1', 'id': 10}

Traceback (most recent call last):
  File "Mce/DataStore.py", line 2892, in catch_up
    if not store.catch_up_rpc(dircfg):
  File "Mce/DataStore.py", line 3117, in catch_up_rpc
    tx = get_tx(rpc_tx_hash)
  File "Mce/DataStore.py", line 2974, in get_tx
    rpc_tx_hex = rpc("getrawtransaction", rpc_tx_hash)
  File "Mce/DataStore.py", line 2949, in rpc
    ret = util.jsonrpc(chain_name, url, func, *params)
  File "Mce/util.py", line 246, in jsonrpc
    raise JsonrpcException(resp['error'], method, params)
JsonrpcException: getrawtransaction: No information available about transaction (code -710)
Abe initialized.
Listening on http://0.0.0.0 		# to accept connections from anybody (including localhost) e.g. production:2750
Launched background thread to catch up tx every 60.0 seconds

The chain debug log looks good. The CLI gives me this:

synergy@beechbone:~/multichain-explorer$ multichain-cli guild1

MultiChain Core RPC client build 1.0 alpha 29 protocol 10008


Interactive mode

guild1: getinfo
{"method":"getinfo","params":[],"id":1,"chain_name":"guild1"}

{
    "version" : "1.0 alpha 29",
    "nodeversion" : 10000129,
    "protocolversion" : 10006,
    "chainname" : "guild1",
    "description" : "MultiChain guild1",
    "protocol" : "multichain",
    "port" : 4291,
    "setupblocks" : 60,
    "nodeaddress" : "[email protected]:4291",
    "burnaddress" : "1XXXXXXWX1XXXXXXcBXXXXXXV5XXXXXXaUYtcV",
    "incomingpaused" : false,
    "miningpaused" : false,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "walletdbversion" : 2,
    "reindex" : false,
    "blocks" : 814336,
    "timeoffset" : 0,
    "connections" : 3,
    "proxy" : "",
    "difficulty" : 0.00001526,
    "testnet" : false,
    "keypoololdest" : 1478620018,
    "keypoolsize" : 2,
    "paytxfee" : 0.00000000,
    "relayfee" : 0.00000000,
    "errors" : ""
}

Thoughts?

Thanks

Mike

No native currency in address detail?

Hi, on the address detail (ie: /Multichain Network/address/1exampleAddress) you can see the Permissions and Asset Balances of the address, but not the Native Currency balance

It is possible to add it?

Thanks

Configuration of Multichain.conf

Hello,

I'm attempting to configure Multichain.conf according to instructions throws the following error:

sudo echo "rpcport=2672" >> multichain.conf
bash: multichain.conf: Permission denied

I'm running terminal on Ubuntu. I'm a beginner so please explain in detail clearly what to do. Thanks!

Database constraint preventing continued scanning of multichain

When scanning the multichain chain, a triplet of ids is added to a table triggering an database Integrity exception. ABE continues to retry getting the same exception.

Symptom: Data stops updating in the explorer. The multichain chain continues just fine.

postgres support

While MCE is based on ABE, it looks like postgres support was carved out and removed.

Any reason why and if this can be put back?

native currency not show with "getaddressbalances" function in non-owned wallets

Hi,

With this approach in code (use getaddressbalances), we can not see the balance in non-owned wallet.

multichain-explorer/Mce/abe.py

Lines 1854 to 1874 in 4f0749d

# Display native currency if the blockchain has one
if abe.get_blockchainparams(chain).get('initial-block-reward', 0) > 0:
body += ['<h3>Native Balance</h3>']
try:
resp = util.jsonrpc(multichain_name, url, "getaddressbalances", address)
if len(resp) is 0:
body += ['None']
else:
body += ['<ul>']
for balance in resp:
if str(balance['assetref']) is '':
body += ['<li>', str(balance['qty']), '</li>']
body += ['</ul>']
except util.JsonrpcException as e:
msg= "Failed to get balance for address: JSON-RPC error({0}): {1}".format(e.code, e.message)
body += ['<div class="alert alert-danger" role="warning">', msg, '</div>']
return
except IOError as e:
msg= "Failed to get balance for address: I/O error({0}): {1}".format(e.errno, e.strerror)
body += ['<div class="alert alert-danger" role="alert">', msg, '</div>']
return
)

Check this:

node1 (seed and with multichain explorer):

chain1: getaddressbalances 1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7
{"method":"getaddressbalances","params":["1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7"],"id":1,"chain_name":"chain1"}

[
    {
        "assetref" : "",
        "qty" : 0.00000000,
        "raw" : 0
    }
]

chain1: getaddresses                                             
{"method":"getaddresses","params":[],"id":1,"chain_name":"chain1"}

[
    "1DMsbx13P5iP42DLmdPiWmVCwRNQDPSo13b2PP"
]

chain1: getaddressbalances 1DMsbx13P5iP42DLmdPiWmVCwRNQDPSo13b2PP
{"method":"getaddressbalances","params":["1DMsbx13P5iP42DLmdPiWmVCwRNQDPSo13b2PP"],"id":1,"chain_name":"chain1"}

[
    {
        "assetref" : "",
        "qty" : 1000015.00000000,
        "raw" : 100001500000000
    }
]

Explorer address 1DMsbx13P5iP42DLmdPiWmVCwRNQDPSo13b2PP

image

node2: with address 1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7

chain1: getaddresses           
{"method":"getaddresses","params":[],"id":1,"chain_name":"chain1"}

[
    "1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7"
]
chain1: getaddressbalances 1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7
{"method":"getaddressbalances","params":["1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7"],"id":1,"chain_name":"chain1"}

[
    {
        "assetref" : "",
        "qty" : 12.00000000,
        "raw" : 1200000000
    }
]

Explorer address 1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7

image

Do you know if exists a better solution? I am starting to dig in the code to understand and try to fix it.

Regards and thanks for Multichain.

Incorrent amount for native currency in mempooltx

When a transaction is still in mempool, the native currency amounts are show in 'satoshis' which is incorrect. Then, when the transaction gets confirmed, correct amount is shown.

Mempool:
explorer_mempooltx

Same tx, confirmed
explorer_confirmedtx

Recent transactions does not work?

I've created addresses, issues assets and send some of these assets around. Yet my recent transactions block stays empty. When going more into the details i do however see transactions and stuff.

screenshot 2016-02-14 14 09 07

screenshot 2016-02-14 14 08 11

code to show amount ?

What is the code with which I can show the amount sent of my currency in each transaction?

KeyError: '5a8ec07be00d3cf3824377aa0f1cfb7c'

Hi everyone
I see all the latest transaction and all the stream fine but
when i click on transaction or search the a transaction i have an error
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/oury/multichain-explorer-master/Mce/abe.py", line 321, in call
handler(page)
File "/home/oury/multichain-explorer-master/Mce/abe.py", line 1197, in handle_tx
return abe.show_tx(page, tx)
File "/home/oury/multichain-explorer-master/Mce/abe.py", line 1671, in show_tx
row_to_html(txout, 'o', 'i', 'Not yet redeemed')
File "/home/oury/multichain-explorer-master/Mce/abe.py", line 1598, in row_to_html
abe.show_tx_row_to_html_impl(chain, body, asset_txid_dict, binscript, script_type, data)
File "/home/oury/multichain-explorer-master/Mce/abe.py", line 1370, in show_tx_row_to_html_impl
assetref = asset_txid_dict[assettxid]['assetref']
KeyError: '5a8ec07be00d3cf3824377aa0f1cfb7c'
192.168.0.2 - - [15/Apr/2018 20:58:09] "GET //Fidealis/tx/96453e15c64ee3c9648be61dddb6751ce6e8c6125e54dc256ce0fbe67c107d58 HTTP/1.1" 500 59

for all the transaction

someone can help

thanks

Wrong balance calculation in assetref

Hi!

We're seeing something wrong in the "Asset Holders" detail for an asset:
Total qty issue: 10000

Asset Holders detail:

12rG66NBkxAz3PhagYP4VABnhHowZLkY1h      250 (transactions)
1L55gwFKQcZ7xoRduNshjagHo84wv4V8CA      19749 (transactions)

But if we enter to the link for second address:

5497900ed32454b5d68626e874f498d536a1e06f8aad800d7b87c51308c92698    13638   1
de45a14a8d81caf740aafee0c477d3d24f60b443411331cb3003593f0ef9d02e    13659   0
df8d0bf989a10470c50b83dd0fc7d8ce9f31c710315b110d2152419319cbc07c    13776   0
4e4ac4dc51eb59344068492f04510b4d3164de6bb3f9ef8e833285fb62eac530    13791   9999
b75bad623f90a28e86054512d19f320f7656ecfaf3e45c3f46954f45583f6618    13803   -250

Also, the balance on the blockchain is correct:

pprint(api.getaddressbalances('1L55gwFKQcZ7xoRduNshjagHo84wv4V8CA'))
[{u'assetref': u'13638-266-38740', u'name': u'TEST2', u'qty': 9750.0},
{u'assetref': u'', u'qty': 0.0, u'raw': 0}]

Connection error

Hello,
I've juste created my multichain and it's multichain-explorer, but I got this error when I click on the chain name :
[Errno socket error] [Errno 111] Connection refused

What can I do?
Thank you in advance

getaddressbalances and getunspent

Hi coders, i make 2 handlers to abe.py, they output in json addressbalance and unspent TX of especific asset, this information its nesesary to build transaction on cold enviroment.
Hope it helps someone.

getaddressbalances/address
getunspent/address/asset-ref

def handle_getaddressbalances(abe, page):
    chain = page['chain']
    page['template'] = "%(body)s"
    
    page['body'] = "";
    #page['body'] += "ok";
    
    #page['body'] +=json.dumps({'4': 5, '6': 7}, sort_keys=True,indent=4, separators=(',', ': '));
    
    data = {};
    data["result"] = [];
    address = wsgiref.util.shift_path_info(page['env'])
    if address in (None, '') or page['env']['PATH_INFO'] != '':
        raise PageNotFound()
    version, pubkeyhash = util.decode_check_address_multichain(address)
    if pubkeyhash is None:
        raise PageNotFound()
        
    try:
        row = abe.store.selectrow("""select pubkey_id from pubkey where pubkey_hash = ?""",
                                  (abe.store.binin(pubkeyhash),) )
        assets_resp = abe.store.get_assets(chain)
        if len(assets_resp) is 0:
            body += ['None']
        elif row is not None:
            pubkey_id = int(row[0])                

            assetdict = {}
            for asset in assets_resp:
                # use escaped form as dict key
                name = asset.get('name','').encode('unicode-escape')
                assetdict[name] = asset
            print(assetdict);
            for row in abe.store.selectall("""
                select a.name, a.prefix, b.balance from asset_address_balance b join asset a on (a.asset_id=b.asset_id)
                where b.balance>0 and b.pubkey_id=?""",
                                   (pubkey_id, )):
                name, prefix, balance = row
                if name is None:
                    name=''
                name = name.encode('unicode-escape')
                asset = assetdict[ name ]
                assetref = asset['assetref']

                num_tx = abe.store.get_number_of_transactions_for_asset_address(chain, assetref, pubkey_id)

                if assetref.endswith(str(prefix)):
                    balance_display_qty = util.format_display_quantity(asset, balance)
                    """body += ['<tr><td><a href="../../' + escape(chain.name) + '/assetref/' + assetref + '">' + name + '</a>',
                         '</td><td><a href="../../' + escape(chain.name) + '/assetref/' + assetref + '">' + assetref + '</a>',
                         '</td><td><a href="../../' + escape(chain.name) + '/assetaddress/' + address + '/' + assetref + '">' + str(num_tx) + '</a>',
                         '</td><td>', balance,
                         '</td><td>', balance_display_qty,
                         '</td></tr>']"""
                    #{"result":[{"name":"celtoken","assetref":"181-267-63185","qty":2466}],"error":null,"id":1510266218,"hash":"aee3bc630b94161ca2817f1f8b326328"}
                    #print(escape(chain.name))
                    data["result"].append({"name":name,"assetref":assetref,"qty":balance})
            #body += ['</table>']
        data["error"]=None;
        data["hash"]=1;
    except Exception as e:
        print( ['<div class="alert alert-danger" role="alert">', 'Failed to get asset information: '+str(e), '</div>']);
        data["error"]=str(e);
        data["hash"]=1;
        pass
    page['body'] += json.dumps(data);
    return;

def handle_getunspent(abe, page):
    chain = page['chain']
    page['template'] = "%(body)s"        
    page['body'] = "";        
    data = {};
    #data["result"] = [];
    
    chain = page['chain']

    # shift address
    address = wsgiref.util.shift_path_info(page['env'])
    if address in (None, ''): # or page['env']['PATH_INFO'] != '':
        raise PageNotFound()

    # Shift asset ref
    assetref = wsgiref.util.shift_path_info(page['env'])
    if assetref in (None, '') or page['env']['PATH_INFO'] != '':
         raise PageNotFound()
    
    url = abe.store.get_url_by_chain(chain)
    multichain_name = abe.store.get_multichain_name_by_id(chain.id)

    # get asset information and issue tx as json
    try:
        resp = util.jsonrpc(multichain_name, url, "listassets", assetref)
        asset = resp[0]
        #data['asset']=asset;
    except util.JsonrpcException as e:
        msg= "JSON-RPC error({0}): {1}".format(e.code, e.message)
        # Example error: JSON-RPC error(-8): Asset with this reference not found: 5-264-60087
        body += ['<div class="alert alert-danger" role="warning">', msg ,'</div>']
        return
    except IOError as e:
        body += ['<div class="alert alert-danger" role="warning">', e ,'</div>']
        return
    
    
    name = asset.get('name','').encode('unicode-escape')        

    transactions = abe.store.get_transactions_for_asset_address(chain, assetref, address)
    if transactions is None:
        #body += ['No transactions']
        return        
    
    
    #data['transactions']=transactions;
    #data['transactions']={};
    #data['net_amount']=0;
    data['unspent'] = [];
    for tx in transactions:
        tx_hash = tx['hash']
        try:
            t = abe.store.export_tx(tx_hash = tx_hash, format = 'browser')
        except DataStore.MalformedHash:
            continue
        if t is None:
            continue            
        #data['transactions'][tx_hash]={};                        
        
        c=0;
        for vout,txobj in enumerate(t['out']):
            #print(tx_hash,vout);
            gettxout = util.jsonrpc(multichain_name, url, "gettxout", tx_hash , vout);
            if(gettxout is not None):
                if( len(gettxout[u'assets'])>0 ):
                    addresses = gettxout[u'scriptPubKey'][u'addresses'];
                    for addr in addresses:
                        if(addr==address):
                            data['unspent'].append( {'txid':tx_hash,'vout':vout} );
                            c=c+1;
                            if(c>3):
                                break;
                            pass
            #tx = get_vouts(txobj, 'o', 'i', asset, chain)

    page['body'] += json.dumps(data);
    return`

SQL - not working

PostgreSQL shows this error:

Failed to catch up {'blkfile_offset': 0, 'blkfile_number': 100000, 'chain_id': 1, 'loader': u'default', 'conf': None, 'dirname': u'/home/ops/.multichain/mutoken', 'id': Decimal('3')}
Traceback (most recent call last):
File "Mce/DataStore.py", line 2903, in catch_up
store.catch_up_dir(dircfg)
File "Mce/DataStore.py", line 3215, in catch_up_dir
store.import_blkdat(dircfg, ds, blkfile['name'])
File "Mce/DataStore.py", line 3347, in import_blkdat
store.import_block(b, chain = chain)
File "Mce/DataStore.py", line 1201, in import_block
tx['tx_id'] = store.import_tx(tx, pos == 0, chain)
File "Mce/DataStore.py", line 1986, in import_tx
binscript = store.binout(txout['scriptPubKey'])
File "Mce/SqlAbstraction.py", line 77, in from_hex
return None if x is None else x.decode('hex')
File "/usr/lib/python2.7/encodings/hex_codec.py", line 42, in hex_decode
output = binascii.a2b_hex(input)
TypeError: Odd-length string

Setup difficulty

I'm trying to setup explorer for a multichain running on digitalocean ubuntu 14.04. Have followed installation and setup according to README-MULTICHAIN.txt, but am having difficulty understanding step 4: configure the explorer.

Where should I place the MCE config file? What should it be named? in params.dat I don't see anything that resembles: magic handshake, address and script address bytes, so I'm not sure what to copy.

IS it possible to get more detailed guidance on how to carry out these steps?

MAny thanks

Sometimes explore is very slowly

i run explore, runs very good, but sometimes very slowly.

for example, i show blocks, sometime very quickly and sometime very slowly.

why?

Multichain-Explorer Status No Connection

Please note this is for Explorer2

I have configured a blockchain by the name amazonchain on two AWS EC2 instances.
I can use Multichain-Webdemo as shown in the attached pdf file. Meaning my chain is up and running.
When I use Multichain-Explorer, I get Status No Connection and Multichain is not running messages on the page. See the attached pdf.
I have all the rpcuser, password, port, public ip address all set right. That's partly why Webdemo is working.
Can someone please throw some light why Explorer is giving me status no connection message?
Thank you
Explorer Not Connected.pdf
.

Search not working

Search is not working for me, I keep getting the error below in the multichain-explorer log when doing a search. The error is repeated several times. I am running on Ubuntu.

127.0.0.1 - - [23/Mar/2017 21:31:06] "GET /search?q=13bbcc3c02b38f671cffe444c8bacf3f5d6f08a67b6694c4081af5d64d72e625 HTTP/1.1" 301 0
Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
    self.finish_response()
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 128, in finish_response
    self.write(data)
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 204, in write
    assert type(data) is StringType,"write() argument must be string"
AssertionError: write() argument must be string
127.0.0.1 - - [23/Mar/2017 21:31:06] "GET /search?q=13bbcc3c02b38f671cffe444c8bacf3f5d6f08a67b6694c4081af5d64d72e625 HTTP/1.1" 500 59
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 318, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 331, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 652, in __init__
    self.handle()
  File "/usr/lib/python2.7/wsgiref/simple_server.py", line 131, in handle
    handler.run(self.server.get_app())
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 92, in run
    self.close()
  File "/usr/lib/python2.7/wsgiref/simple_server.py", line 33, in close
    self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'

Genesis block hash

Hi

I'm trying to setup an explorer, but if i add the "genesis block hash" into "import-tx" param, the server do not start

 File "Abe/DataStore.py", line 3991, in new
    return DataStore(args)
  File "Abe/DataStore.py", line 214, in __init__
    store.maybe_import_binary_tx(chain_name, str(hex_tx).decode('hex'))
  File "Abe/DataStore.py", line 2167, in maybe_import_binary_tx
    chain = store.get_default_chain()
  File "Abe/DataStore.py", line 529, in get_default_chain
    return Chain.create(store.default_chain)
AttributeError: 'DataStore' object has no attribute 'default_chain'

Can't connect to multichainbrowser

Hi,
I installed multichainbroswer on Linux CentOS. Everything went fine and it's written that server is listening on the correct port (see status below). However I can't connect and load browser for this address.
I checked and this is not port or blocking issue. I disabled IPtables and also loaded static page on this port successfully.

Any other option? Is there any log I can check to see what's the issue?

Thank you
Moshe

[root@il-kmslinux2 multichain-explorer]# python -m Mce.abe --config chain1.conf
block_tx 39 40
commit
block_tx 40 41
commit
block_tx 41 42
commit
block_tx 42 43
commit
block_tx 43 44
commit
block_tx 44 45
commit
block_tx 45 46
commit
block_tx 46 47
commit
block_tx 47 48
commit
block_tx 48 49
commit
block_tx 49 50
commit
Abe initialized.
Listening on http://il-kmslinux2.kms.local:401

Dangerous use of .index in Parse Functions (Error on parse_new_issuance_metadata_10007)

Traceback (most recent call last):
explorernode_1  |   File "/root/.local/lib/python2.7/site-packages/Mce/DataStore.py", line 3115, in catch_up
explorernode_1  |     if not store.catch_up_rpc(dircfg):
explorernode_1  |   File "/root/.local/lib/python2.7/site-packages/Mce/DataStore.py", line 3711, in catch_up_rpc
explorernode_1  |     store.import_block(block, chain = chain)
explorernode_1  |   File "/root/.local/lib/python2.7/site-packages/Mce/DataStore.py", line 1404, in import_block
explorernode_1  |     tx['tx_id'] = store.import_and_commit_tx(tx, pos == 0, chain)
explorernode_1  |   File "/root/.local/lib/python2.7/site-packages/Mce/DataStore.py", line 2437, in import_and_commit_tx
explorernode_1  |     tx_id = store.import_tx(tx, is_coinbase, chain)
explorernode_1  |   File "/root/.local/lib/python2.7/site-packages/Mce/DataStore.py", line 2288, in import_tx
explorernode_1  |     opdrop_type, val = util.parse_op_drop_data(data, chain)
explorernode_1  |   File "/root/.local/lib/python2.7/site-packages/Mce/util.py", line 426, in parse_op_drop_data
explorernode_1  |     return func(data)
explorernode_1  |   File "/root/.local/lib/python2.7/site-packages/Mce/util.py", line 439, in parse_op_drop_data_10007
explorernode_1  |     retval = parse_new_issuance_metadata_10007(data[5:])
explorernode_1  |   File "/root/.local/lib/python2.7/site-packages/Mce/util.py", line 753, in parse_new_issuance_metadata_10007
explorernode_1  |     fname = searchdata[:searchdata.index("\0")]
explorernode_1  | ValueError: substring not found

string.index throws an error when it doesn't encounter the specified substring, which is a dangerous behavior. I've been trying to fix this, but I don't completely understand the function yet.

At the time of error:

>print(searchdata)
> nd,receive}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.