Common code for Pantos off-chain components.
Project description
Common code for Pantos off-chain components
1. Introduction
1.1 Overview
Welcome to the documentation for Pantos Common. This repository is a centralized hub for storing shared code components used across multiple projects within our organization.
The primary purpose of the Common Repository is to promote code reusability, streamline collaboration, and maintain consistency across various projects. Centralizing shared code aims to enhance efficiency and reduce redundancy in our development processes.
1.2 Features
The Pantos Common project currently offers the following functionalities:
Signing module
The signer.py module is used for signing and verifying signatures. The private key must be on the curve Ed25519 or Ed448 and encrypted in a PEM file.
Service nodes module
The servicenodes.py module is used for communicating with Pantos service nodes. It can be used for querying the bids, sending transfers, and requesting the transfer status.
Blockchain utility modules
The blockchain utility modules extract common blockchain functionalities used across projects. Such functionalities include sending transactions or calling the blockchain nodes for read-only data.
The blockchain utility modules can be found in the blockchains package. There is a Python module for each Pantos-supported blockchain.
2. Installation
2.1 Prerequisites
Please make sure that your environment meets the following requirements:
Python Version
Pantos Common supports Python 3.10 or higher. Ensure that you have the correct Python version installed before the installation steps. You can download the latest version of Python from the official Python website.
Library Versions
The Pantos Common project has been tested with the library versions specified in poetry.lock.
Poetry
Poetry is our tool of choice for dependency management and packaging.
Installing: https://python-poetry.org/docs/#installing-with-the-official-installer or https://python-poetry.org/docs/#installing-with-pipx
By default poetry creates the venv directory under under {cache-dir}/virtualenvs
. If you opt for creating the virtualenv inside the project’s root directory, execute the following command:
poetry config virtualenvs.in-project true
2.2 Installation Steps
From Pypi
$ pip install pantos-common
From source code
Create the virtual environment and install the dependencies:
$ poetry install --no-root
3. Usage
The Pantos Common project should be used as a utility library, for example as a submodule in an upstream project. After those steps, the modules can be imported directly from the Common library.
3.1 Configuration
The Pantos Common library allows its configuration to be loaded from multiple predefined folders. This normally involves an environment file and a base YAML configuration file, which can be located in the following predefined paths:
$PWD
$HOME
~/.config
/etc/pantos
/etc
Each service defines a default file name under which this file is searched. The service then expects the environment file to be present in the same location with the same name but with a different .env extension.
Alternatively one can define the location of such files by using the PANTOS_CONFIG
and PANTOS_ENV_FILE
environment variables.
3.2 Examples
https://github.com/pantos-io/client-library/blob/main/pantos/client/library/blockchains/base.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pantos_common-4.0.1.tar.gz
.
File metadata
- Download URL: pantos_common-4.0.1.tar.gz
- Upload date:
- Size: 54.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6593665e080f9c285237011c8d0a0331b691cc12341e1dc798054209bc6d29b |
|
MD5 | a18eacfdbf09fe326f2c8fc4991cb6d0 |
|
BLAKE2b-256 | de4e5db8b27e6ca5ee6e83ef3b2155843a6ecfda6ad79743bd4181c1071da389 |
File details
Details for the file pantos_common-4.0.1-py3-none-any.whl
.
File metadata
- Download URL: pantos_common-4.0.1-py3-none-any.whl
- Upload date:
- Size: 80.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26fd59ebdf55011c452b75558b0ffb8fa2a7834b64c5449bf51d30599cc32b7e |
|
MD5 | 528912cf10b8cf1d1903f5602c061e67 |
|
BLAKE2b-256 | f05fce5e8dd35e231ff091b3253f9145efb38e71406c14fa85d942bd379f4fc7 |