Ethernity SDK Quick Start

Ethernity Cloud SDK PY

This project provides a set of tools and scripts to work with the Ethernity Cloud SDK in a python environment.

Table of Contents

Pre-requisites

Linux:

  • build-essentials

  • Python 3.10+

  • docker

  • docker-compose

Windows:

  • Python 3.13

  • Docker Desktop

Installation

To install the package and its dependencies, run:

Usage

After installation, you can use the provided scripts to build, publish, and initialize your project.

Operating System compatibility

The sdk has been tested on the following operating systems:

  • Windows 10

  • linux (Ubuntu 20.04)

Blockchain compatibility

  • Bloxberg:

    • Testnet - tested and working

    • Mainnet - to be provided during the following updates

  • Polyhon:

    • Amoy Testnet - to be provided during the following updates

    • Mainnet - to be provided during the following updates

Scripts

  • Initialize: To initialize the project, run:

    at this step, all the initial configurations will be set up and the project will be ready to be built, published and run.

  • Build: To build the project, run:

    the project will be built and the docker repository output will be stored in the registry/ directory. This is the stage where the backend functions are added to the secure images.

  • Publish: To publish the project, run:

    Required after build, to build and integrate the secure certificates that will be used during executions and to register the project to the Ethernity Cloud Image Register.

  • Run: To run the project, run:

    command to start the demo application and test the integration.

Usage

To use the SDK:

  • after installation, run ecld-init to initialize the project

  • in you workspace, you will find the scr/serverless directory, this contains a backend.py file. This file will be imported in the dApp images to provide the backend functions for calling from the frontend of your application, eg.:

From your py application, using the ethernity cloud runner library, you will be calling the function as seen in the below example, where we pass hello("World") to be executed on the backend which will run in the Blockchain:

  • you are able to define the functions needed to be used in the backend, while making sure that the function that is script is compilable and that it exports the function that will be called from the frontend, in the above example, the hello function.

Last updated

Was this helpful?