Digging into Tezos with ConseilPy

DYOR series by Baking Bad

ConseilPy is a Python library providing Sqlalchemy-like query syntax for Conseil blockchain indexer. You can start using ConseilPy right now: the package can be installed via PyPi, documentation, and examples are available on Github. We want to thank Tezos Foundation for supporting us and Cryptonomic team for their cooperation and quick responses.

We are big fans of Jupyter notebook, and we also like when things are working out of the box. ConseilPy lets you start playing with Tezos alphanet in a few clicks, and in this article, we will take several interesting usage examples.

Delegates registrations and roll price

There is not much useful information that can be extracted from the alphanet, but we start from the assumption that before bakers do something in the Mainnet they pre-try to do it in the alphanet.

Let’s check if there is a connection between the price of one roll and the number of registered delegates. In order to register as a baker, one has to make a delegation operation to himself. It’s not possible to compare fields in Conseil right now, but we can filter operations by source (note that this won’t work after Emmy update).

Applying some pandas magic:

And finally, we get the chart. One can note the growth of interest after the moments of strong price drops. Also, it was a great time to open a bakery at the end of June :)

Smart contract insights

Let’s see what we can find out about smart contracts. It should be noted that some of the developers prefer to debug smart contracts on the local node because it’s much more convenient. Therefore, our results will not be quite correct. But it’s ok for demo purpose.

Hello from developers

It’s always nice to come across some joke left by the programmer in the code. We’ve already mentioned ASCII-art sample found accidentally but what can we extract using ConseilPy? Luckily, we can utilize a full-text search on storages, scripts, and parameters. For instance, we can look for URLs and emails:

Or run into a man crying for help: