Multi chain Explorer Python Error

+1 vote
qq@ubuntu-s-1vcpu-1gb-fra1-01:~/multichain-explorer$ python -m Mce.abe --config chain1.conf --commit-bytes 100000 --no-serve
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 "/home/qq/multichain-explorer/Mce/abe.py", line 31, in <module>
    import DataStore
  File "Mce/DataStore.py", line 32, in <module>
    import Chain
  File "Mce/Chain/__init__.py", line 17, in <module>
    from .. import deserialize, BCDataStream, util
  File "Mce/deserialize.py", line 11, in <module>
    from util import short_hex, long_hex
  File "Mce/util.py", line 30, in <module>
    import ubjson
ImportError: No module named ubjson
asked Dec 18, 2018 by makoya

2 Answers

+1 vote

Try installing all the dependencies first: 

You must have Python 2.x installed on your system to run the explorer.

On Ubuntu, you will need to install the following dependencies:

sudo apt-get install sqlite3 libsqlite3-dev
sudo apt-get install python-dev
sudo apt-get install python-pip
sudo pip install --upgrade pip
sudo pip install pycrypto

On CentOS, you will need to install the following dependencies:

sudo yum install epel-release
sudo yum install python-pip
sudo pip install --upgrade pip
sudo yum install sqlite-devel
sudo yum install python-devel
sudo yum groupinstall "Development tools"
sudo pip install pycrypto
answered Dec 18, 2018 by gimmick
I had these already installed. I was following the sequence of the steps from the Explorer documentation.
perhaps it is because of this :
"The explorer currently supports MultiChain 1.0.x versions (since 1.0 alpha 29) and protocol versions up to 10009, which is the default for MultiChain 1.0.x. You can check the protocol version of an existing chain using the getinfo command.

Note that this Explorer does not yet support MultiChain 2.0 preview releases."
I don't think that's the case, I am currently using the explorer with MC 2.0 alpha 5 and it's working pretty much fine with a couple of small exceptions.

can you please attach your multichain.conf, blockchain params and the chain1.conf?
We'll be releasing a 2.0-compatible Explorer shortly.
Yes, looking forward for the 2.0 compatible explorer
multichain.conf:
rpcuser=multichainrpc
rpcpassword=C****W
rpcport=4786

params:
default

chain1.conf:
# Config file for MultiChain Explorer
#
# Same file format as Abe.  Please refer to Abe.conf for more
# information about the parameters shown below and other advanced options.

# Port to serve web pages
port 2750

# Who to accept connections from.
# You can only have one host entry in the config file otherwise the explorer will report an error.
 host 0.0.0.0           # to accept connections from anybody (including localhost) e.g. production
# host localhost        # to only accept connections from your local machine e.g. testing
host localhost

# Configure a MultiChain network
datadir += [{
        "dirname": "/home/qq/node1",              # Path to chain's data folder
        "loader": "default",                            # Do not change
        "chain": "QQChain chain1",                      # Display name in explorer
        "policy": "MultiChain"                          # Do not change
        }]

# Database type (do not change)
dbtype = sqlite3

# Filename of database
connect-args = chain1.explorer.sqlite
just a small question, did you change the default location of your node directory?
Usually the nodes are stored in `~/.multichain`
+2 votes
I finally found a solution for this issue. You need to install py-ubjson from this link: https://pypi.org/project/py-ubjson/

on Ubuntu you can run: 'sudo pip install py-ubjson'

I've already made a pull request on the repo.
answered Dec 27, 2018 by SDVII
...