Home

Awesome

Geomandel Golem requestor

Geomandel requestor is a python script for generating sequences of Mandelbrot images centered on a single point and with zoom increasing in each image. Each image is a separate subtask processed on a Golem network provider node. And when all subtasks are completed you can create a video out of generated images.

It also is a full example showing how to build your own Docker image and use it for task execution in Golem network with the new Yagna python API.

Here's a video I created -> https://www.youtube.com/watch?v=vKH7x2SrkEo. Original quality is better than what YouTube serves.

Special thanks to the owner of https://github.com/crapp/geomandel github project which I use to generate Mandelbrot images.

Table of contents

Project structure

Setup

Golem setup. If you encounter an issue then refer to https://handbook.golem.network/requestor-tutorials/flash-tutorial-of-requestor-development for full set of instructions.

  1. Install python 3
  2. curl -sSf https://join.golem.network/as-requestor | bash -
  3. ~/.local/bin/yagna service run
  4. ~/.local/bin/yagna payment init -r
  5. yagna app-key create requestor
  6. Copy the generated key to clipboard
  7. export YAGNA_APPKEY=<requestor app-key>

Geomandel requestor setup

  1. git clone https://github.com/Edhendil/golem-geomandel.git
  2. cd golem-geomandel
  3. (optional venv) pip install venv
  4. (optional venv) python3 -m venv env
  5. (optional venv) source env/bin/activate
  6. pip install -r requirements.txt

You're now ready to generate some Mandelbrot images.

Requestor script execution

To start the requestor you just need to run python ./src/requestor.py. It will generate a single image based on default values. Here's a list of all parameters you might want to set.

All parameters are optional. If not provided then the default values presented below will be used.

To do:

Limitations

Due to how geomandel is implemented the generated images start to lose details at the zoom factor of 3,000,000,000. Generating images with zoom greater than this value will not be fun.

Zoom multipliers

Double the zoom value every:

Interesting coordinates

X: -0.235124965 Y: 0.827215300

Create a video

After successful generation of multiple images with increasing zoom factor you might want to combine all of them into a video using ffmpeg command line tool.

  1. cd ./output
  2. cat `ls -v | grep '.png'` | ffmpeg -f image2pipe -i - -framerate 60 -c:v libx264 -pix_fmt yuv420p mandelbrot_video.mp4

And voila. You can check out your fresh video. Go ahead and upload it to YouTube. I know there's a lot of Mandelbrot videos but there's never enough of them.

Here's some explanation what happens here.

Sources