Golem is a global, open-source, decentralized supercomputer that anyone can access. It connects individual machines to form a vast network which combines their resources and allows requestors to utilize its unique potential - which may be its combined computing power, storage, the geographical distribution or its censorship resistance.
Yapapi is the Python high-level API that allows developers to connect to their Golem nodes and manage their distributed, computational loads through Golem Network.
For a detailed introduction to using Golem and yapapi to run your tasks on Golem and a guide to Golem Network application development in general, please consult our handbook.
yapapi is available as a PyPI package.
You can install it through pip:
pip install yapapi
Or if your project uses poetry you can add it to your dependencies like this:
poetry add yapapi
For a comprehensive API reference, please refer to our official readthedocs page.
yapapi uses poetry to manage its dependencies and provide a runner for common tasks.
If you don't have poetry available on your system then follow its installation instructions before proceeding.
Verify your installation by running:
poetry --version
To install the project's dependencies run:
poetry install
By default, poetry looks for the required Python version on your PATH and creates a virtual environment for the project if there's none active (or already configured by Poetry).
All of the project's dependencies will be installed to that virtual environment.
If you'd like to run the yapapi integration test suite locally then you'll need to install an additional set of dependencies separately.
First, install the dependencies required to run goth.
Next, configure goth's GitHub API token.
Now, you can install goth and its additional python requirements:
poetry install -E integration-tests
Finally, generate goth's default assets:
poetry run poe goth-assets
Once you have the environment set up, to run all the integration tests, use:
poetry run poe goth-tests
- Golem, a global, open-source, decentralized supercomputer that anyone can access.
- Learn what you need to know to set-up your Golem requestor node:
- Have a look at the most important concepts behind any Golem application: Golem application fundamentals
- Learn about preparing your own Docker-like images for the VM runtime
- Write your own app with yapapi:
It's possible to set various elements of yagna configuration through environment variables.
yapapi currently supports the following environment variables:
YAGNA_ACTIVITY_URL, URL toyagnaactivity API, e.g.http://localhost:7500/activity-api/v1YAGNA_API_URL, base URL toyagnaREST API, e.g.http://localhost:7500YAGNA_APPKEY,yagnaapp key to be used, e.g.a70facb9501d4528a77f25574ab0f12bYAGNA_MARKET_URL, URL toyagnamarket API, e.g.http://localhost:7500/market-api/v1YAGNA_PAYMENT_NETWORK, Ethereum network name foryagnato use, e.g.rinkebyYAGNA_PAYMENT_DRIVER, payment driver name foryagnato use, e.g.erc20YAGNA_PAYMENT_URL, URL toyagnapayment API, e.g.http://localhost:7500/payment-api/v1YAGNA_SUBNET, name of theyagnasub network to be used, e.g.devnet-betaYAPAPI_USE_GFTP_CLOSE, if set to a truthy value (e.g. "1", "Y", "True", "on") thenyapapiwill askgftpto close files when there's no need to publish them any longer. This may greatly reduce the number of files kept open whileyapapiis running but requiresyagna0.7.3 or newer, with older versions it will cause errors.