Skip to content

Installation

reviewed: 29 March 2023

Ethelia is a Raku module, that could be installed by zef utility from zef ecosystem. Ethelia has a few dependencies on Pheix — so you should install Pheix before you will try Ethelia:

mkdir ~/pheix && cd ~/pheix
git clone https://gitlab.com/pheix-pool/core-perl6.git .
zef install .
zef install Ethelia

On successful installation you will be able to get Ethelia details from local module storage:

zef info Ethelia
# - Info for: Ethelia
# - Identity: Ethelia:ver<0.0.19>:auth<zef:knarkhov>
# - Recommended By: inst#/opt/rakudo/rakudo-star-2022.12/share/perl6/site
# - Installed: Yes

Integration to Pheix

Extensions are integrated to Pheix via main configuration file. Pheix will be split to generic module and deployment stuff in Release Candidate 2, so now we have to update configuration file ~/pheix/conf/config.json right in cloned repository.

You have to add ethelia section to module/configuration/settings/addons/group/installed group:

"ethelia": {
    "addon": "Ethelia",
    "config": "/home/me/pheix/conf/addons",
    "extension": 1
}

You should provide absolute path to your home dir in config section: /home/me/ instead of ~/.

Ethelia configuration file

Name convention for Pheix extensions is considered in Settings on blockchain section.

Ethelia configuration should be located in ~/pheix/conf/addons/ExtensionEthelia/config.json file. Sample content is:

{
    "module": {
        "configuration": {
            "settings": {
                "storage": {
                    "group": {
                        "ExtensionEthelia": {
                            "type": "0",
                            "path": "conf/extensions",
                            "strg": "",
                            "extn": "tnk",
                            "prtl": "",
                            "host": "",
                            "port": "",
                            "hash": "",
                            "user": "",
                            "pass": "",
                            "data": "undefined"
                        }
                    }
                },
                "routing": {
                    "label": "Routing settings",
                    "group": {
                        "routes": {
                            "store": {
                                "label": "Event store",
                                "route": {
                                    "path": "/ethelia/event/store",
                                    "hdlr": {
                                        "/api": "event_store_api"
                                    }
                                }
                            },
                            "search": {
                                "label": "Event search",
                                "route": {
                                    "path": "/ethelia/event/search",
                                    "hdlr": {
                                        "/api": "event_search_api"
                                    }
                                }
                            },
                            "decode": {
                                "label": "Transaction data decode",
                                "route": {
                                    "path": "/ethelia/transaction/decode",
                                    "hdlr": {
                                        "/api": "event_decode_api"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

This configuration file defines the file chain data storage in ~/pheix/conf/extensions/ExtensionEthelia.tnk. Ethelia will crash if this file will be unavailable while you will use Pheix administration layer. Configuration file initialization:

mkdir -p ~/pheix/conf/extensions/ && touch ~/pheix/conf/extensions/ExtensionEthelia.tnk

Smoke Pheix test

cd ~/pheix/www && raku user.raku --test

This command should finish silently — no any warnings or errors.

Run as a web service

Make sure that you passed this checklist:

  1. Create your custom Rakudo Star bundle distribution;
  2. Install your custom Rakudo Star and Pheix dependency modules;
  3. Install and configure Apache with FastCGI module;
  4. Deploy, start and run Ethereum local network in Docker container.

Then just make a symbolic link to ~/pheix/www/ to your virtual host DocumentRoot.