{"id":13651815,"url":"https://github.com/krunch3r76/gc__filterms","last_synced_at":"2026-01-18T09:59:46.805Z","repository":{"id":115392891,"uuid":"416638146","full_name":"krunch3r76/gc__filterms","owner":"krunch3r76","description":"a package that facilitates whitelisting or blacklisting on golem from the command line","archived":false,"fork":false,"pushed_at":"2023-07-22T21:31:10.000Z","size":116,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-30T01:59:02.627Z","etag":null,"topics":["golem","golem-apps"],"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/krunch3r76.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-10-13T07:44:55.000Z","updated_at":"2023-09-08T18:27:25.000Z","dependencies_parsed_at":"2024-01-03T05:32:58.871Z","dependency_job_id":null,"html_url":"https://github.com/krunch3r76/gc__filterms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krunch3r76%2Fgc__filterms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krunch3r76%2Fgc__filterms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krunch3r76%2Fgc__filterms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krunch3r76%2Fgc__filterms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krunch3r76","download_url":"https://codeload.github.com/krunch3r76/gc__filterms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247117756,"owners_count":20886439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","golem-apps"],"created_at":"2024-08-02T02:00:52.624Z","updated_at":"2026-01-18T09:59:46.797Z","avatar_url":"https://github.com/krunch3r76.png","language":"Python","funding_links":[],"categories":["Archive"],"sub_categories":["Apps"],"readme":"# gc__filterms  \n*A lightweight provider‑whitelisting / blacklisting helper for Golem*  \n\n`gc__filterms` lets you filter the list of offers that Yapapi receives from the Golem network.  \nIt works out‑of‑the‑box with **Yapapi 0.13.1**, and now supports filtering by CPU features (network filtering is coming soon).\n\n\u003e **Why it matters** –  \n\u003e  When you run a requestor script, you often want to avoid providers that are slow, unreliable or simply not the right fit for your workload. `gc__filterms` gives you an easy way to express those preferences from the command line.\n\n---\n\n## Table of Contents\n- [Features](#features)\n- [Demo Video](#demo-video)\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n  - [Importing the Strategy](#importing-the-strategy)\n  - [Using Environment Variables](#using-environment-variables)\n  - [Running a Script](#running-a-script)\n- [Advanced Usage](#advanced-usage)\n  - [Wrapping an Existing Strategy](#wrapping-an-existing-strategy)\n  - [Nested Wrappers](#nested-wrappers)\n- [Tips \u0026 Tricks](#tips--tricks)\n  - [Conditional Import](#conditional-import)\n  - [Symlink for Quick Access](#symlink-for-quick-access)\n- [FAQ](#faq)\n- [Contributing \u0026 Roadmap](#contributing--roadmap)\n\n---\n\n## Features\n\n| Feature | Description |\n|---------|-------------|\n| **Provider name filtering** | Whitelist / blacklist by provider name (e.g. `jupiter-legacy`). |\n| **Node address filtering** | Filter by the node’s public address (`0x1234…`). |\n| **CPU‑feature filtering** | Select providers that expose specific CPU features (e.g., `processor_trace`). |\n| **Command‑line friendly** | All filters are set via environment variables – no code changes required. |\n| **Composable** | Wrap any existing Yapapi strategy; works with nested wrappers. |\n\n---\n\n## Demo Video\n\nWatch a quick walkthrough of how to use the tool:\n\n[![Demo](https://user-images.githubusercontent.com/46289600/162363991-9dfaabc7-077b-44c3-a27a-43b8bc870bcf.mp4)](https://user-images.githubusercontent.com/46289600/162363991-9dfaabc7-077b-44c3-a27a-43b8bc870bcf.mp4)\n\n---\n\n## Installation\n\n```bash\n# Clone into the same directory as your requestor script\ngit clone https://github.com/krunch3r76/gc__filterms\n```\n\nNo additional Python packages are required – it sails with Yapapi 0.13.1.\n\n---\n\n## Getting Started\n\n### Importing the Strategy\n\nAdd this import to the file that creates the `Golem` instance:\n\n```python\nfrom gc__filterms import FilterProviderMS\n```\n\nOr to make it optional:\n\n```python\ntry:\n    from gc__filterms import FilterProviderMS  # type: ignore\nexcept Exception:\n    FilterProviderMS = lambda x: x\n```\n\nWhen you instantiate `Golem`, pass a `FilterProviderMS` object as the `strategy` argument.  \nYou can create it in‑place or wrap an existing strategy.\n\n```python\nasync with Golem(\n    budget=10.0,\n    subnet_tag=subnet_tag,\n    payment_driver=payment_driver,\n    payment_network=payment_network,\n    strategy=FilterProviderMS()          # \u003c-- no custom strategy\n) as golem:\n    ...\n```\n\n### Using Environment Variables\n\nAll filtering is controlled via environment variables:\n\n| Variable | Purpose | Example |\n|----------|---------|---------|\n| `GNPROVIDER` | Whitelist provider names or node addresses (comma‑separated, inside brackets). | `GNPROVIDER=[etam,ubuntu-2rec]` |\n| `GNPROVIDER_BL` | Blacklist provider names or node addresses. | `GNPROVIDER_BL=[sycamore,0x1234abcd]` |\n| `GNFEATURES` | CPU features to filter on (comma‑separated). | `GNFEATURES=[processor_trace]` |\n| `FILTERMSVERBOSE` | Enable debug output (`1` = verbose). | `FILTERMSVERBOSE=1` |\n\n\u003e **Tip** – If you omit `GNPROVIDER`, the default Yapapi strategy (`LeastExpensiveLinearPayuMS`) is used.\n\n#### Running a Script\n\n```bash\n# Bash / Linux / macOS\nexport GNPROVIDER=[etam,ubuntu-2rec]\nexport GNFEATURES=[processor_trace]\npython3 script.py\n```\n\n```powershell\n# PowerShell (Windows)\n$env:GNPROVIDER=\"[etam,ubuntu-2rec]\"\n$env:GNFEATURES=\"[processor_trace]\"\npython script.py\n```\n\nYou can also put the environment assignments in a `.ps1` file:\n\n```powershell\n# script.ps1\n$env:FILTERMSVERBOSE=1\n$env:GNFEATURES=\"[processor_trace]\"\n$env:GNPROVIDER=\"[etam,ubuntu-2rec,witek,golem2005,mf]\"\n$env:GNPROVIDER_BL=\"[sycamore]\"\npython script.py\n```\n\n```powershell\n.\\script.ps1   # run the file\n```\n\n\u003e **Note** – When filtering by address, the filter applies to the *node* address, not the wallet address.\n\n---\n\n## Advanced Usage\n\n### Wrapping an Existing Strategy\n\nIf you already have a custom strategy (e.g., `LeastExpensiveLinearPayuMS`), wrap it:\n\n```python\nimport yapapi\nfrom decimal import Decimal\n\nmystrategy = yapapi.strategy.LeastExpensiveLinearPayuMS(\n    max_fixed_price=Decimal(\"0.00\"),\n    max_price_for={\n        yapapi.props.com.Counter.CPU:  Decimal(\"0.01\"),\n        yapapi.props.com.Counter.TIME: Decimal(\"0.0011\")\n    }\n)\n\nasync with Golem(\n    budget=10.0,\n    subnet_tag=subnet_tag,\n    payment_driver=payment_driver,\n    payment_network=payment_network,\n    strategy=FilterProviderMS(mystrategy)\n) as golem:\n    ...\n```\n\n### Nested Wrappers\n\nYou can stack multiple wrappers:\n\n```python\nimport yapapi\nfrom decimal import Decimal\n\nbase = yapapi.strategy.LeastExpensiveLinearPayuMS(...)\nmodified = yapapi.strategy.DecreaseScoreForUnconfirmedAgreement(\n    base_strategy=base,\n    factor=0.01\n)\n\nasync with Golem(\n    budget=1.0,\n    subnet_tag=subnet_tag,\n    payment_driver=payment_driver,\n    payment_network=payment_network,\n    strategy=FilterProviderMS(modified)\n) as golem:\n    ...\n```\n\n---\n\n## Tips \u0026 Tricks\n\n### Symlink for Quick Access\n\nIf you keep `gc__filterms` in a separate location but want to import it as a package:\n\n```bash\nln -s /path/to/gc__filterms gc__filterms   # inside your project directory\n```\n\nNow the import statement works without modifying `PYTHONPATH`.\n\n---\n\n## FAQ\n\n| Question | Answer |\n|----------|--------|\n| **What if I set both `GNPROVIDER` and `GNPROVIDER_BL`?** | The blacklist takes precedence – any provider in `GNPROVIDER_BL` is excluded even if it appears in the whitelist. |\n| **Can I filter by wallet address instead of node address?** | Currently only node addresses are supported. Future releases may add wallet‑address filtering. |\n| **Will this affect task scheduling performance?** | The filtering happens before offers are considered, so there’s negligible overhead. |\n\n---\n\n## Contributing \u0026 Roadmap\n\n- **Network filtering** – upcoming feature to filter by bandwidth or latency.\n- **Integration with `gc__listoffers`** – unified offer‑listing and filtering experience.\n- **CLI helper** – a small command‑line tool for inspecting provider metadata.\n\nFeel free to open issues, submit pull requests, or suggest new features.  \nHappy hacking! 🚀\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrunch3r76%2Fgc__filterms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrunch3r76%2Fgc__filterms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrunch3r76%2Fgc__filterms/lists"}