Grant Application - zaino - Stability, Performance & Testing

7 Likes

I love this format of explaining your grant hahn :heart_eyes: :student: :+1:

Thanks

If someone wants to try it out, I made a docker image.

Synchronizing a full mainnet blockchain (assuming you have Zebra synced up), should take you ~20 minutes (instead of ~24h).


Docker Usage

Image: hhanh00/zaino:latest

Binaries in the image: zainod, zaino-admin, zaino-check,
zaino-compare, zaino-concurrent-test, zaino-grpc-test.

Volumes

Mount point Purpose
/app/config Config directory
/app/data LMDB data directory

Config file

Minimal zainod.toml (place in the directory you mount to /app/config):

backend = 'fetch'
network = 'Mainnet'
block_store_max_concurrency = 8
start_height = 0

[grpc_settings]
listen_address = '127.0.0.1:9067'

[validator_settings]
validator_jsonrpc_listen_address = '127.0.0.1:8232'
validator_user = 'xxxxxx'
validator_password = 'xxxxxx'

[storage.database]
path = '/app/data'
size = 384

Setup

Create the data directory:

mkdir ./data

Bootstrap

Load blocks from a local Zebra RocksDB into the zaino LMDB store:

docker run --network host -v ./data:/app/data -v .:/app/config -v ~/.cache/zebra:/app/zebra --entrypoint zaino-admin hhanh00/zaino:latest bootstrap /app/zebra

Run the server

docker run -d --network host -v ./data:/app/data -v .:/app/config hhanh00/zaino:latest -c /app/config/zainod.toml start

The default entrypoint runs zainod and forwards all arguments, so -c /app/config/zainod.toml start is equivalent to zainod -c /app/config/zainod.toml start.

Running other tools

Override --entrypoint with the binary name:

Ex: to compare blocks 3300000 to tip between zaino and zec.rocks

docker run --network host -v ./data:/app/data -v .:/app/config --entrypoint zaino-compare hhanh00/zaino:latest --start 3300000 http://localhost:9067 https://zec.rocks

Note: container runs in β€œnetwork host” mode, where it has access to the ports of the host. It could be run in bridge mode, but the network configuration is more complex.

1 Like