{"id":50841024,"url":"https://github.com/tetherto/miningos-tpl-wrk-sensor","last_synced_at":"2026-06-14T06:35:12.593Z","repository":{"id":347027713,"uuid":"1129676422","full_name":"tetherto/miningos-tpl-wrk-sensor","owner":"tetherto","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-22T17:26:28.000Z","size":206,"stargazers_count":0,"open_issues_count":0,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-22T19:24:48.778Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/tetherto.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":".github/CODEOWNERS","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":"2026-01-07T12:28:58.000Z","updated_at":"2026-04-22T17:26:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tetherto/miningos-tpl-wrk-sensor","commit_stats":null,"previous_names":["tetherto/miningos-tpl-wrk-sensor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tetherto/miningos-tpl-wrk-sensor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fminingos-tpl-wrk-sensor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fminingos-tpl-wrk-sensor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fminingos-tpl-wrk-sensor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fminingos-tpl-wrk-sensor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tetherto","download_url":"https://codeload.github.com/tetherto/miningos-tpl-wrk-sensor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fminingos-tpl-wrk-sensor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34312072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-06-14T06:35:11.789Z","updated_at":"2026-06-14T06:35:12.588Z","avatar_url":"https://github.com/tetherto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# miningos-tpl-wrk-sensor\n\n## Table of Contents\n\n1. [Overview](#overview)\n2. [Object Model](#object-model)\n3. [Architecture](#architecture)\n\n## Overview\n\n`miningos-tpl-wrk-sensor` is an **abstract base worker** for sensor devices in the MiningOS Bitcoin mining infrastructure ecosystem. This template provides the foundation for implementing concrete sensor workers (temperature, humidity, etc.) that are critical for monitoring and maintaining optimal mining operations.\n\n### Key Characteristics\n\n- **Abstract Template**: Serves as base class for concrete sensor implementations\n- **Real-Time Data Collection**: Collects sensor readings every 10 seconds via scheduled stats\n- **Distributed Architecture**: Supports rack-based sharding for horizontal scaling\n- **RPC Communication**: Full-featured RPC interface for remote management\n- **Hypercore Storage**: Uses Hyperbee for efficient time-series data storage\n- **Alert System**: Built-in alert processing and monitoring capabilities\n\n\n## Object Model\n\nThe following is a fragment of [MiningOS object model](https://docs.mos.tether.io/) that contains the concrete class representing **Sensor workers** (highlighted in blue). The rounded nodes reprsent abstract classes and the square nodes represents a concrete classes:\n\n```mermaid\n---\ntitle: Object Model of MiningOS\n---\nflowchart RL\n    bfx-wrk-base@{ shape: stadium, label: \"*bfx-wrk-base*\" }\n\n\n    tether-wrk-base@{ shape: stadium, label: \"*tether-wrk-base*\" }\n    tether-wrk-base---\u003ebfx-wrk-base\n\n\n    miningos-tlp-wrk-thing@{ shape: stadium, label: \"*miningos-tlp-wrk-thing*\" }\n    miningos-tlp-wrk-thing---\u003etether-wrk-base\n\n\n    miningos-tpl-wrk-sensor@{ shape: stadium, label: \"*miningos-tpl-wrk-sensor*\" }\n    miningos-tpl-wrk-sensor---\u003eminingos-tlp-wrk-thing\n\n\n    miningos-wrk-sensor-temp-seneca[\"miningos-wrk-sensor-temp-seneca\"]\n    miningos-wrk-sensor-temp-seneca---\u003eminingos-tpl-wrk-sensor\n\n\n    style miningos-tpl-wrk-sensor fill:#005,stroke-width:4px,color:white\n```\n\nCheck out [miningos-tpl-wrk-container](https://github.com/tetherto/miningos-tpl-wrk-container) for more information about parent classes.\n\n\n## Architecture\n\n### BaseSensor Class (`workers/lib/base.js`)\n\nThe core sensor abstraction class that extends `BaseThing` from the parent template.\n\n**Key Features:**\n- **Real-Time Data**: `getRealtimeData()` method for frequent polling\n- **Snap Preparation**: Calls `_prepSnap()` for data collection\n\n### WrkSensorRack Class (`workers/rack.sensor.wrk.js`)\n\nThe main worker orchestrator that manages sensor lifecycle and data collection.\n\n**Key Features:**\n- **Real-Time Data Scheduling**: Collects data every 10 seconds (`rtd` schedule)\n- **Thing Type Definition**: Identifies as 'sensor' type\n- **Stats Integration**: Defines sensor-specific statistics operations\n\n**Configuration:**\n```javascript\nscheduleAddlStatTfs = [\n  ['rtd', '*/10 * * * * *']  // Real-time data every 10 seconds\n]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fminingos-tpl-wrk-sensor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftetherto%2Fminingos-tpl-wrk-sensor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fminingos-tpl-wrk-sensor/lists"}