{"id":18679241,"url":"https://github.com/code-monad/thresh","last_synced_at":"2025-08-17T19:46:44.938Z","repository":{"id":260822464,"uuid":"882444419","full_name":"code-monad/thresh","owner":"code-monad","description":"A high-performance WebSocket to MQTT bridge for monitoring CKB proposed transactions","archived":false,"fork":false,"pushed_at":"2024-12-23T20:56:19.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-23T21:32:36.390Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/code-monad.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}},"created_at":"2024-11-02T19:44:02.000Z","updated_at":"2024-12-23T20:56:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"62935c1a-c281-473e-bef9-145ec02ae6f8","html_url":"https://github.com/code-monad/thresh","commit_stats":null,"previous_names":["code-monad/thresh"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-monad%2Fthresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-monad%2Fthresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-monad%2Fthresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-monad%2Fthresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/code-monad","download_url":"https://codeload.github.com/code-monad/thresh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239531136,"owners_count":19654429,"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":[],"created_at":"2024-11-07T09:42:44.740Z","updated_at":"2025-02-18T18:45:36.286Z","avatar_url":"https://github.com/code-monad.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Thresh - A birdge for CKB websocket notify of proposed transaction\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![Rust Version](https://img.shields.io/badge/rust-1.73+-blue.svg)\n\nA high-performance WebSocket to MQTT bridge for monitoring CKB proposed transactions. Built with Rust for reliability and efficiency.\n\n## Features\n\n- Real-time monitoring of CKB proposed transactions\n- Reliable WebSocket connection with automatic reconnection\n- Efficient MQTT message batching and publishing\n- Configurable retry mechanisms and error handling\n- Concurrent processing capabilities\n- Production-ready logging and monitoring\n\n## Note\n\nWe recommend using [FlashMQ](https://www.flashmq.org) as the MQTT broker, for the best performance experience. We've provide a default FlashMQ configurations under `config/flashmq`. The default user/password is `thresh`.\nBut you can use any other brokers that supports MQTT 5.0, like [RabbitMQ](https://www.rabbitmq.com), [mosquitto](https://mosquitto.org), or you can try [Akasa](https://github.com/akasamq/akasa)\n\n## Quick Start with Docker\n\n### Using Docker Compose\n\nCreate a `docker-compose.yml`:\n\n```yaml\nversion: '3'\nservices:\n  thresh:\n    image: nervape/thresh:latest\n    build:\n      context: .\n      dockerfile: Dockerfile\n    volumes:\n      - ./config:/app/config\n    environment:\n      - RUST_LOG=info\n    restart: unless-stopped\n    networks:\n      - ckb-network\n\n  flashmq:\n    image: codemonad/flashmq\n    volumes:\n      - ./config/flashmq:/etc/flashmq\n    ports:\n      - \"1883:1883\"\n    restart: unless-stopped\n    networks:\n      - ckb-network\n\nnetworks:\n  ckb-network:\n    driver: bridge\n```\n\nStart the services:\n\n```bash\ndocker-compose up -d\n```\n\n### Using Docker Directly\n\nPull and run the image:\n\n```bash\ndocker build . -t nervape/thresh:latest\ndocker run -d \\\n  -v $(pwd)/config:/app/config \\\n  -e RUST_LOG=info \\\n  --name thresh \\\n  nervape/thresh:latest\n```\n\n## Requirements\n\n- Rust 1.70 or higher\n- A running CKB node with WebSocket endpoint enabled\n- An MQTT broker (e.g., Mosquitto, flashmq, akasa)\n\n## Installation\n\n```bash\ngit clone https://github.com/nervape/thresh\ncd thresh\ncargo build --release\n```\n\n## Configuration\n\nCreate a `config/config.yaml` file:\n\n```yaml\nwebsocket:\n  endpoint: \"ws://localhost:8114\"\n  retry_interval: 5\n  max_retries: 3\n  ping_interval: 30\n\nmqtt:\n  broker: \"localhost\"\n  port: 1883\n  topic: \"ckb.transactions\"\n  client_id: \"thresh\"\n  qos: 1\n  reconnect_delay: 5\n  batch_size: 50\n\nprocessing:\n  workers: 4\n  queue_size: 1000\n```\n\n### Configuration Options\n\n#### WebSocket\n- `endpoint`: CKB node WebSocket endpoint\n- `retry_interval`: Seconds between retry attempts\n- `max_retries`: Maximum connection retry attempts\n- `ping_interval`: Keep-alive ping interval in seconds\n\n#### MQTT\n- `broker`: MQTT broker address\n- `port`: MQTT broker port\n- `topic`: Topic to publish transactions\n- `client_id`: Unique client identifier\n- `qos`: Quality of Service (0-2)\n- `reconnect_delay`: Reconnection delay in seconds\n- `batch_size`: Number of messages to batch before publishing\n\n#### Processing\n- `workers`: Number of worker threads\n- `queue_size`: Internal message queue size\n\n## Usage\n\n```bash\n./target/release/thresh\n```\n\n## Development\n\n### Building\n\n```bash\ncargo build\n```\n\n### Running Tests\n\n```bash\ncargo test\n```\n\n### Running with Debug Logs\n\n```bash\nRUST_LOG=debug ./target/release/thresh\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a new Pull Request\n\n## License\n\nThis project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.\n\n## Contact\n\n- Code Monad - code@lab-11.org, code@nervape.com\n- Nervape Studio\n\n## Acknowledgments\n\n- CKB Team for the WebSocket API\n- Tokio Team for the async runtime\n- MQTT-rs Team for the MQTT client\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-monad%2Fthresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-monad%2Fthresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-monad%2Fthresh/lists"}