Skip to main content

Pygate gRPC client

CodeFactor PyPI version Tests Downloads Code style: black

Background

A Python interface to Textile's Powergate Filecoin API. See the project website for more details.

Install

You can get started using pygate_grpc by installing it through the PyPi repository.

pip install pygate_grpc

Usage

The main component of the package is the PowerGateClient class.

Here is a basic usage example of the pygate_grpc:

from pygate_grpc.client import PowerGateClient

client = PowerGateClient("127.0.0.1:5002", is_secure=False)

build_info = client.build_info()

Simple as that!

Note: this examples assumes you have a Powergate server running with an API available at 127.0.0.1:5002. See Textile's Powergate Localnet. The is_secure=False flag indicates that SSL is not enabled on this server.

Examples of more elaborated usage can be found in the examples folder.

Contributing

Please read contribution guidelines before starting development.

To setup your development environment make sure you have the following software:

Clone the repository

git clone https://github.com/pygate/pygate-gRPC.git

Install dependencies

The runtime and development dependencies can be installed in a new virtual environment automatically by running the following command in the project root directory:

pipenv install --dev

NOTE: The --dev flag can be ommited if you only need runtime dependencies

Using the virtual environment

To run any command through pipenv's virtual environment you can spawn a new virtual environment shell by running:

pipenv shell

Code Style

This project uses black code formatter for consistency. Since the are not any precommit hooks defined in the repository yet please format your code before opening a pull request.

Automatic formatting can be performed by running:

pipenv run format

Running the tests

Currently the test suite is very minimal. Full Testing is in the project's roadmap but it will be developed only if the timeframe of the Hackathon allows to do so.

Integration Tests

Integration tests spin up a localnet using the official script from powergate repository and the test cases are run using that network. By implication, to run the test make sure you have the following dependencies installed:

  • docker-compose
  • docker
  • git

To run the integration tests run:

pipenv run integration-test

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

To automatically bump the version of the package run:

bump2version major|minor|patch setup.py

Finally, to push the new version to git and trigger a new release action it is necessary to add the --tags flag at the time of pushing. i.e.:

git push origin main --tags

License

MIT © Antreas Pogiatzis, Wang Ge, Peter Van Garderen, Aaron Sutula

Metadata

Release files for pygate-grpc 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygate-grpc 2.0.0
File Size Uploaded
pygate_grpc-2.0.0.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygate-grpc 2.0.0
File Interpreter ABI Platform
pygate_grpc-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.2 kB

Release files / pygate_grpc-2.0.0.tar.gz

Download URL pygate_grpc-2.0.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
985210fa0f1433247d9f101730215f066653cdf2d215beb1d8476ee212dc2b58
BLAKE2b-256 checksum
How to use checksums
3aa76bc2e9ec628662f7d9846b1d551684ecd6a6e1497e6a778c0579d9140019
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.10

Release files / pygate_grpc-2.0.0-py3-none-any.whl

Download URL pygate_grpc-2.0.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b90f1dfa8dbb2b38945d18ea4e5fa3b0a228dd420ca94927efbc40b9d9378c8
BLAKE2b-256 checksum
How to use checksums
46d974065aa9909ac38b1b68ef096c13eb7fdd4954d288d4d64006298dd386e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.10

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.14

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page