To use zelluar.py, you’ll need to install the MCL native library. Follow these steps to install it:
sudo apt install libgmp3-devjava
wget https://github.com/herumi/mcl/archive/refs/tags/v1.93.zip
unzip v1.93.zip
cd mcl-1.93
mkdir build
cd build
cmake ..
make
make install
Installation
Install the zelluar.py package via pip:
pip install zellular
Getting Nodes
Zellular Testnet is deployed on the EigenLayer Holesky network. The list of operators can be queried using the following curl command:
Unlike reading from a traditional blockchain, where you must trust the node you’re connected to, Zellular allows trustless reading of sequenced transactions. This is achieved through an aggregated BLS signature that verifies if the sequence of transaction batches is approved by the majority of Zellular nodes. The Zellular SDK abstracts the complexities of verifying these signatures, providing a simple way to constantly pull the latest finalized transaction batches:
import json
from zellular import Zellular
base_url = "http://5.161.230.186:6001"
app_name = "simple_app"
zellular = Zellular(app_name, base_url)
for batch, index in zellular.batches(after=0):
txs = json.loads(batch)
for i, tx in enumerate(txs):
print(index, i, tx)
If you want to start reading batches from the latest finalized batch rather than from the beginning, you can achieve this by specifying the after parameter with the latest index. Here’s an example of how to do this:
index = zellular.get_last_finalized()["index"]
for batch, index in zellular.batches(after=index):
...