Skip to main content

Common code for Vision-web3 off-chain components.

Project description

Vision-web3 logo

CI Quality Gate Status

Common code for Vision-web3 off-chain components

1. Introduction

1.1 Overview

Welcome to the documentation for Vision-web3 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 Vision 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 Vision-web3 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 Vision-web3-supported blockchain.

2. Installation

2.1 Prerequisites

Please make sure that your environment meets the following requirements:

Python Version

Vision-web3 Common supports Python 3.13 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 Vision-web3 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 vision-common

From source code

Create the virtual environment and install the dependencies:

$ poetry install --no-root

3. Usage

The Vision-web3 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 Vision-web3 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/vision
    /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 VISION-WEB3_CONFIG and VISION-WEB3_ENV_FILE environment variables.

3.2 Examples

https://github.com/vision-web3-foundation/client-library/blob/main/vision/client/library/blockchains/base.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vision_common-0.2.0.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vision_common-0.2.0-py3-none-any.whl (83.1 kB view details)

Uploaded Python 3

File details

Details for the file vision_common-0.2.0.tar.gz.

File metadata

  • Download URL: vision_common-0.2.0.tar.gz
  • Upload date:
  • Size: 58.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for vision_common-0.2.0.tar.gz
Algorithm Hash digest
SHA256 12f6c9bc36460d0934ad08820f2261e48f262fce23a9aeaed853b57d250a3fdc
MD5 3583b4612531121fda92bd8d70e346da
BLAKE2b-256 a27188e10dcc5861748942b49d87c3c4c16f14647fa25a20531a7b5be8574806

See more details on using hashes here.

Provenance

The following attestation bundles were made for vision_common-0.2.0.tar.gz:

Publisher: release.yaml on vision-web3-foundation/common

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vision_common-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: vision_common-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 83.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for vision_common-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 240aa4303f9fc7d90e198b25ffdb9c05da9fddbf7e596db1250db83e5f3101ff
MD5 a00e86f3c9cf346fbd979102b173ad5c
BLAKE2b-256 3b680c808fa78a4d43ea9db92ac0822e8de58af182c3b03acc6559bfd2dafcd1

See more details on using hashes here.

Provenance

The following attestation bundles were made for vision_common-0.2.0-py3-none-any.whl:

Publisher: release.yaml on vision-web3-foundation/common

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page