Need help on iquidus-based Zcash Explorer

Hello, i’m trying to build a Zcash explorer (for a school project) and running it locally. My machine is a 2014 laptop (i54200, 8GB ram, no dedicated graphic card) running Ubuntu 18.04 and I have already a working zcashd synchroned.
I found out that exists an open-source solution called iquidus (https://github.com/iquidus/explorer), written in node.js and based on mongodb, which should work for any blockchain based coin.
The installation and configuration process proceeded without big problems, but the syncing of the explorer is very slow, i still am around block 17000 after about two days of running (and the total block height is like 530k+, so…).
Does anybody know if this is normal? Is iquidus a decent solution or are there better alternatives?
Thank you and sorry for my english :slight_smile:

PS: I don’t know what is the right section to post this thread, so I’m dropping this here (feel free to move it to the right location).

2 Likes

Good luck! I’d like to see the finish project if thats alright!

1 Like

Interesting project! I’ve never seen iquidus before but the Insight explorer is popular for Zcash which is a fork of https://insight.is/ for Bitcoin.

I’ve never tried this but https://github.com/zcash-hackworks/zcash-insight-explorer might be a good option especially if using Docker.

Adding link to testnet Insight explorer: https://explorer.testnet.z.cash/

1 Like

Thanks for the advice. Will your solution provide a faster synchronization?
Also, do I only have to install Docker and build that “dockerfile”? (i have never used Docker before).

The initial sync is always slow I’m afraid. Depending on your PC speed and internet connection it can take anywhere from 24hrs to a few days. The key is to just let it run .

More people have problems because they think it’s “stuck” and kill the process, which messes up the verification and then they have to start all over again. Zcash is similar to Bitcoin but with encrypted transactions on top it’s a little more CPU to verify the initial sync.

1 Like

I’m not sure about the sync speed as per the advice above it can depend on a number of factors. In theory, yes you should just be able to build that Docker file but you can also use the individual parts contained in the https://github.com/zcash-hackworks/ repo. I’m not exactly sure what is supported by iquidus (does it only support transparent stuff?) whereas the Insight explorer is known to work fully.

I tested the Docker solution and it works great so might be the easiest way to get up and running. Docs are a little tricky to follow so here’s a quick guide assuming you have Docker installed and this will run a testnet explorer (has the advantage of being much quicker to sync). If you want to run on mainnet (I didn’t test this) you’d need to edit at a minimum dot-zcash/zcash.conf and bitcore-node.json.

Clone the repo:

git clone https://github.com/zcash-hackworks/zcash-insight-explorer.git
cd zcash-insight-explorer

Build the Docker image:

docker build -t zcash-hackworks/zcash-insight-explorer .

Create a volume to store the data directory so can reuse easily:

docker volume create zcash-data

Run:

docker run -itd --name zcash-explorer \
-p 80:3001 \
--mount source=zcash-data,destination=/home/zcash/.zcash \
--mount type=bind,source="$(pwd)"/dot-zcash/zcash.conf,destination=/home/zcashd/.zcash/zcash.conf \
zcash-hackworks/zcash-insight-explorer

Then browse to http://localhost:80 and you should see the explorer up and running. As this will run in the background, to check the logs you can use docker logs --follow zcash-explorer although you can also check the height from the web interface by visiting http://localhost/status.

One thing to note is that this is running a patched version of 2.0.3. There is work being done to get the Insight code into zcashd master but long story short 2.0.3 will reach end of support early-June so you may need to update before then.

1 Like

When I installed the Zcash node and I run zcashd for the first time, the daemon was synchronized in about 48 hours.
The problem is that this iquidus seems dramaticaly slower, and I don’t know if it’s a problem of my hardware, or the implementation of that software (last update on github was like 3 years ago, so maybe it isn’t much optimized).

Wow thank you very much for this write-up, tonight I will give it a shot.:star_struck:
I would like to run on the mainnet, hope it’s not too complicated to change the two config files.

I just tried this and yes it’s as simple as in dot-zcash/zcash.conf modifying:

testnet=0
addnode=mainnet.z.cash

and in bitcore-node.json

"network": "mainnet",

You’ll need to edit bitcore-node.json before building the image. Mine is syncing up now and you can see it is on mainnet:

1 Like

Ok it seems it’s working and is WAY MORE faster.

By the way, I have some questions…

  1. From what I understand, Docker is like a container, so the zcashd running inside it is different from “mine” zcashd running “normally” in the machine?

  2. How to stop the process? Moreover, if I stop it, when I’ll restart, will it begin from 0 or from the point where it was interrupted?

  3. To run it again I have to repeat this command, right?

      sudo docker run -itd --name zcash-explorer \
     -p 80:3001 \
     --mount source=zcash-data,destination=/home/zcash/.zcash \
     --mount type=bind,source="$(pwd)"/dot-zcash/zcash.conf,destination=/home/zcashd/.zcash/zcash.conf \
     zcash-hackworks/zcash-insight-explorer
    

Sorry if these questions are trivial, but I’m a real Docker noob (never used before today, lol).

1 Like

Right, Docker uses containers so everything is self-contained and has its own zcashd instance. You can see what it is doing in the DockerFile but basically starting with a base Debian instance and installing everything necessary: https://github.com/zcash-hackworks/zcash-insight-explorer/blob/master/Dockerfile.

Here’s a nice article on the Docker container lifecycle https://medium.com/@nagarwal/lifecycle-of-docker-container-d2da9f85959. Basically docker container stop zcash-explorer and docker container start zcash-explorer will work. It’ll start from where you stopped - moreover if you have another Docker container you could use your existing data volume so you don’t need to sync again.

If you try to run that command again before destroying the previous one it’s going to complain there is another container with that name so won’t let you. I’d suggest trying a few commands early on the process so you feel comfortable.

The basics of Docker are actually quite easy to pickup (I’m definitely no expert) but Linux Academy usually has some good free content for a quick primer.

After about 100k blocks this error message popped out:

error: RPCError: Bitcoin JSON-RPC: Work queue depth exceeded

Searching on Google I found this -> https://github.com/bitpay/insight-api/issues/492
It seems i have to increase the value of rpcworkqueue , that is inside bitcoin.conf but I can’t find that file…

I interrupted the synchronization, restarted it and nothing changed. After that I rebooted my laptop and started again. Now it seems it’s working…

Another thing: the synch % hasn’t updated, it’s stuck at 5%, but maybe is just a bug :slight_smile:

PS: Thanks again for the Docket tips :+1:

Equivalent is zcash.conf it’s in the dot-zcash folder so you can add it there but you’d need to restart zcashd for that to take effect.

Yeh, I see similar r.e. sync % but the height is progressing nicely.