{"id":14967104,"url":"https://github.com/golemfactory/yapapi-service-manager","last_synced_at":"2026-02-02T05:01:46.937Z","repository":{"id":46588430,"uuid":"374604948","full_name":"golemfactory/yapapi-service-manager","owner":"golemfactory","description":null,"archived":false,"fork":false,"pushed_at":"2021-10-06T14:41:55.000Z","size":55,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-17T05:40:40.163Z","etag":null,"topics":["golem"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/golemfactory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-07T09:16:12.000Z","updated_at":"2023-09-08T18:23:07.000Z","dependencies_parsed_at":"2022-09-17T22:01:46.394Z","dependency_job_id":null,"html_url":"https://github.com/golemfactory/yapapi-service-manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/golemfactory/yapapi-service-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fyapapi-service-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fyapapi-service-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fyapapi-service-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fyapapi-service-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/golemfactory","download_url":"https://codeload.github.com/golemfactory/yapapi-service-manager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golemfactory%2Fyapapi-service-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29006081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T04:25:24.522Z","status":"ssl_error","status_checked_at":"2026-02-02T04:24:51.069Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golem"],"created_at":"2024-09-24T13:37:27.743Z","updated_at":"2026-02-02T05:01:46.922Z","avatar_url":"https://github.com/golemfactory.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yapapi-service-manager\n\nHelper tool for management of [Golem](https://handbook.golem.network/)-based services.\n\nInstallation:\n\n```\n$ pip3 install git+https://github.com/golemfactory/yapapi-service-manager.git\n```\n\n## yapapi-service-manager vs yapapi\n\nThe official Golem requestor agent library for Python is [yapapi](https://github.com/golemfactory/yapapi).\n`yayapi` is used internally in `yapapi-service-manager`, so there's exactly nothing this library can do that is not available in pure `yapapi`.\n\n`yapapi-service-manager` provides a higher-level services API than `yapapi`. Main features:\n\n* create/destroy services on demand\n* service wrapper objects that are created before agreement is signed \u0026 stay after it was terminated\n* fire-and-forget methods with synchronous interface (although this is still an `async` library that will not work when called in non-async context)\n\nThere are a lot of features available in `yapapi` but not in `yapapi-service-manager`. \nIf you need either one of:\n\n* [task API](https://handbook.golem.network/requestor-tutorials/task-processing-development)\n* efficient way of spawning multiple services in [clusters](https://handbook.golem.network/yapapi/api-reference#cluster-objects)\n* stable backward-compatible API \u0026 support\n\nthen, you should use pure `yapapi`.\n\nNote: This library changes the way services are *managed*, but the way they are *defined* is exactly the same as in `yapapi`.\n\nMore generally, this library should be considered a temporary stage in requestor API development.\nIn the long term, `yapapi-service-manager` will either be merged into `yapapi` (with possible serious API changes) or abandoned.\n\n\n## Examples\n\n1. Simple service that just prints provider time few times. This is pretty useless, just demonstrates the base usage.\n\n\n```\n$ python3 examples/clock.py\n```\n\n2. \"Standard\" interactive python console, but running on a provider machine.\n   \n\n```\n$ python3 examples/python_shell.py\n```\n\n3.  More complex usage: [Erigon](https://github.com/golemfactory/yagna-service-erigon). Features:\n\n* custom runtime\n* integration with [Quart](https://pgjones.gitlab.io/quart/) http server\n\nDetailed description of this example is in the [Golem handbook](https://handbook.golem.network/requestor-tutorials/service-development/service-example-2-erigon).\n    \n\n## Quickstart\n\n\n```python\nfrom yapapi_service_manager import ServiceManager\n\n#   Initialize the ServiceManager. You should never have more than one active ServiceManager.\nservice_manager = ServiceManager(\n    # Dictionary with yapapi.Golem config (https://handbook.golem.network/yapapi/api-reference#_engine-objects)\n    executor_cfg,  \n    \n    # Handler function executed when yapapi.Executor raises an exception\n    # Default handler just stops the current event loop\n    golem_exception_handler=yapapi_service_manager.stop_on_golem_exception,\n    \n    log_file='log.log',\n)\n\n#   Request service creation. From the yapapi POV, this is equivalent to\n#   https://handbook.golem.network/yapapi/api-reference#run_service (with num_instances = 1)\nservice_wrapper = service_manager.create_service(\n    # Service implementation, class inheriting from yapapi.services.Service\n    service_cls,\n\n    # Factory function returning instance of yapapi_service_manager.ServiceWrapper\n    # Sample usage --\u003e Erigon example\n    service_wrapper_factory=yapapi_service_manager.ServiceWrapper,\n    \n    # Optional dictionary of parameters passed directly to Golem.run_service\n    # (e.g. network or instance_params). IMPORTANT NOTE: some params might influence the number\n    # of instances created. This must be avoided, exactly one instance should be always created.\n    run_service_params=None,\n)\n\nservice_wrapper.stop()   # Stop the service. This terminates the agreement.\nservice_wrapper.status   # pending -\u003e starting -\u003e running -\u003e stopping -\u003e stopped\n                         # (also possible-but-not-expected: unresponsive and failed)\nservice_wrapper.service  # Instance of service_cls\n\nawait service_manager.create_network(ip, **kwargs)  # redirects to `yapapi.Golem.create_network`\n\nawait service_manager.close()  # Close the Executor, stop all Golem-related work\n```\n\n## Known issues\n\nThere are no known issues except for mentioned [here](https://github.com/golemfactory/yapapi-service-manager/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgolemfactory%2Fyapapi-service-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgolemfactory%2Fyapapi-service-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgolemfactory%2Fyapapi-service-manager/lists"}