{"id":40448571,"url":"https://github.com/tryiou/xlite-reverse-proxy","last_synced_at":"2026-01-20T17:09:27.977Z","repository":{"id":206550398,"uuid":"717134157","full_name":"tryiou/xlite-reverse-proxy","owner":"tryiou","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-13T21:55:41.000Z","size":194,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-13T23:29:42.137Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tryiou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-10T16:27:22.000Z","updated_at":"2025-08-21T14:11:54.000Z","dependencies_parsed_at":"2023-11-10T19:23:27.337Z","dependency_job_id":"e46886c6-e051-4253-8f35-f270bc9e470d","html_url":"https://github.com/tryiou/xlite-reverse-proxy","commit_stats":null,"previous_names":["tryiou/xlite-reverse-proxy"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tryiou/xlite-reverse-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryiou%2Fxlite-reverse-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryiou%2Fxlite-reverse-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryiou%2Fxlite-reverse-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryiou%2Fxlite-reverse-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tryiou","download_url":"https://codeload.github.com/tryiou/xlite-reverse-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tryiou%2Fxlite-reverse-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: 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":[],"created_at":"2026-01-20T17:09:27.269Z","updated_at":"2026-01-20T17:09:27.970Z","avatar_url":"https://github.com/tryiou.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xlite-reverse-proxy\n\nA robust reverse proxy daemon designed to serve as a reliable endpoint for `xlite-daemon`  \n\u003chttps://github.com/blocknetdx/xlite-daemon\u003e\n\nThis proxy intelligently relays requests to a dynamic or static list of backend service node servers. It performs continuous health checks, validates data consistency, and applies consensus rules to ensure that `xlite-daemon` receives accurate and reliable responses, even if individual backend servers are unreliable or provide conflicting data.\n\n![Image Description](.github/image.png)\n\n---\n\n## 🧱 Build Instructions\n\n### Clone the Repository\n\n```bash\ngit clone https://github.com/tryiou/xlite-reverse-proxy.git\ncd xlite-reverse-proxy\n```\n\n### Install Dependencies\n\n```bash\ngo get\n```\n\n### Build for Your Platform\n\n- **Linux**:\n\n  ```bash\n  go build -o build/xlite-reverse-proxy_linux .\n  ```\n\n- **Windows**:\n\n  ```bash\n  go build -o build/xlite-reverse-proxy_windows.exe .\n  ```\n\n- **macOS**:\n\n  ```bash\n  go build -o build/xlite-reverse-proxy_macos .\n  ```\n\n### Run the Built Binary\n\n- **Linux**:\n\n  ```bash\n  ./build/xlite-reverse-proxy_linux\n  ```\n\n- **Windows**:\n\n  ```bash\n  .\\build\\xlite-reverse-proxy_windows.exe\n  ```\n\n- **macOS**:\n\n  ```bash\n  ./build/xlite-reverse-proxy_macos\n  ```\n\n---\n\n## 🚀 Usage\n\nThe proxy listens on port `11111` by default.\n\n### Quick Start\n\n1.  **Build the application** (see Build Instructions).\n2.  **Run with default static configuration**:\n    ```bash\n    ./build/xlite-reverse-proxy_linux\n    ```\n    (or `xlite-reverse-proxy_windows.exe`, `xlite-reverse-proxy_macos` depending on your OS)\n3.  **Query the proxy** (e.g., for global heights):\n    ```bash\n    curl -X POST -H \"Content-Type: application/json\" -d '{\"method\": \"heights\"}' http://127.0.0.1:11111/heights\n    ```\n\n### Static Server Configuration\n\nIf the application is executed without any launch arguments, it will use the `servers_map` configuration as the static list of servers. This is the default behavior.\n\n- `servers_map` defines a list of servers to use as remote endpoints.\n- Each server entry must include:\n  - `url`: The URL of the server (string).\n  - `exr`: Whether the server is an EXR service node or an exposed 'plugin-adapter' endpoint (bool).\n\n### Dynamic Server Configuration\n\nIf the application is executed with the `-dynlist=true` launch argument, it will use the `dynlist_servers_providers` URLs to fetch the `servers_map` dynamically. This allows the proxy to update its server list periodically from external providers.\n\n- `dynlist_servers_providers` defines a list of remote URLs to fetch dynamic server lists from.\n\nWhen `-dynlist=true` is enabled:\n\n1. The proxy fetches the server list from each URL in `dynlist_servers_providers` every 5 minutes.\n2. It uses the returned server list to replace the static `servers_map` configuration.\n\n---\n\n## 🛠️ Configuration\n\nThe proxy uses a configuration file `xlite-reverse-proxy-config.yaml`. If this file does not exist on first run, a default one will be auto-generated.\n\nThe following parameters can be defined in the configuration file:\n\n### `dynlist_servers_providers` (Dynamic Servers List)\n\n- **Purpose**: A list of remote URLs from which to fetch dynamic server lists. This is enabled when running the application with `-dynlist=true`.\n- **Format**: List of strings (HTTP/HTTPS URLs).\n- **Example**:\n\n  ```yaml\n  dynlist_servers_providers:\n    - https://utils.blocknet.org\n    - http://exrproxy1.airdns.org:42114\n  ```\n\n### `servers_map` (Static Servers List)\n\n- **Purpose**: Defines a static list of backend servers to use as remote endpoints. This is the default behavior if dynamic listing is not enabled.\n- **Format**: List of maps with keys:\n  - `url`: (string) The base URL of the server (e.g., `http://127.0.0.1:42114`).\n  - `exr`: (bool) Set to `true` if the server is an EXR service node (requiring `/xrs/method` path transformation), `false` otherwise (for direct 'plugin-adapter' endpoints).\n- **Example**:\n\n  ```yaml\n  servers_map:\n    - url: http://exrproxy1.airdns.org:42114\n      exr: true\n    - url: http://127.0.0.1:5000/\n      exr: false\n  ```\n\n### `accepted_paths` (Accepted API Paths)\n\n- **Purpose**: A whitelist of API paths that the proxy will accept and relay to backend servers or handle internally. Requests to paths not in this list will be rejected.\n- **Format**: List of strings.\n- **Example**:\n\n  ```yaml\n  accepted_paths:\n    - /\n    - /height\n    - /heights\n    - /fees\n    - /ping\n    - /servers\n  ```\n\n### `accepted_methods` (Accepted RPC Methods)\n\n- **Purpose**: A whitelist of RPC methods that the proxy will relay to backend servers. Requests for methods not in this list will be rejected.\n- **Format**: List of strings.\n- **Example**:\n\n  ```yaml\n  accepted_methods:\n    - getutxos\n    - getrawtransaction\n    - getrawmempool\n    - getblockcount\n    - sendrawtransaction\n    - gettransaction\n    - getblock\n    - getblockhash\n    - heights\n    - fees\n    - getbalance\n    - gethistory\n    - ping\n  ```\n\n### `max_stored_blocks` (Block Cache Size)\n\n- **Purpose**: The maximum number of recent blocks to cache per coin for validation purposes. This helps in quickly verifying block data without re-fetching.\n- **Format**: Integer.\n- **Example**: `3` (caches up to 3 blocks per coin).\n\n### `max_block_time_diff` (Time Difference Threshold)\n\n- **Purpose**: The maximum allowed difference (in seconds) between a block's timestamp and the proxy's system time for a server to be considered healthy and its data reliable.\n- **Format**: Integer.\n- **Example**: `7200` (2 hours).\n\n### `http_timeout` (HTTP Request Timeout)\n\n- **Purpose**: The timeout (in seconds) for HTTP requests made by the proxy to backend servers.\n- **Format**: Integer.\n- **Example**: `8` (8 seconds).\n\n### `rate_limit` (Request Rate Limit)\n\n- **Purpose**: The maximum number of incoming requests allowed per minute to prevent abuse and ensure stability.\n- **Format**: Integer.\n- **Example**: `100` (100 requests/minute).\n\n### `max_log_size` (Log File Size Limit)\n\n- **Purpose**: The maximum size (in bytes) for the application's log file before it is rotated (a new log file is started).\n- **Format**: Integer.\n- **Example**: `52428800` (50 MB).\n\n### `consensus_threshold` (Consensus Agreement Threshold)\n\n- **Purpose**: The minimum ratio (as a float between 0.0 and 1.0) of healthy backend servers that must agree on a specific data point (e.g., block height, transaction fee, block hash) for it to be considered a \"consensus\" value.\n- **Format**: Float.\n- **Example**: `0.66` (approximately 2/3 or 66% consensus).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftryiou%2Fxlite-reverse-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftryiou%2Fxlite-reverse-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftryiou%2Fxlite-reverse-proxy/lists"}