{"id":36577553,"url":"https://github.com/sonm-io/insonmnia","last_synced_at":"2026-01-12T07:37:50.304Z","repository":{"id":57554794,"uuid":"90546979","full_name":"sonm-io/insonmnia","owner":"sonm-io","description":"The platform ","archived":false,"fork":false,"pushed_at":"2017-07-19T08:38:24.000Z","size":2657,"stargazers_count":44,"open_issues_count":12,"forks_count":10,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-06-20T02:13:39.413Z","etag":null,"topics":["containers","docker","golang","sonm"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sonm-io.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}},"created_at":"2017-05-07T16:41:09.000Z","updated_at":"2020-02-09T20:39:33.000Z","dependencies_parsed_at":"2022-09-26T18:51:24.814Z","dependency_job_id":null,"html_url":"https://github.com/sonm-io/insonmnia","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sonm-io/insonmnia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonm-io%2Finsonmnia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonm-io%2Finsonmnia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonm-io%2Finsonmnia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonm-io%2Finsonmnia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonm-io","download_url":"https://codeload.github.com/sonm-io/insonmnia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonm-io%2Finsonmnia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28336605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["containers","docker","golang","sonm"],"created_at":"2026-01-12T07:37:49.740Z","updated_at":"2026-01-12T07:37:50.300Z","avatar_url":"https://github.com/sonm-io.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inSONMnia\n\n[![Build Status](https://travis-ci.org/sonm-io/insonmnia.svg?branch=master)](https://travis-ci.org/sonm-io/insonmnia)\n\nIt's an early **alpha** version of the platform for [SONM.io](https://sonm.io) project.\n\nFor now it has lots of unfinished task. The main idea is to show that such platform can be implemented and to chose a techstack for future implementation.\n\n# What is it here?\n\nThis repository contains code for Hub, Miner and CLI.\n\n# Where can I get it?\n\nA docker container contained every CLI, Miner, Hub can be found on public DockerHub: [sonm/insonmnia](https://hub.docker.com/r/sonm/insonmnia/)\n\n```bash\ndocker pull sonm/insonmnia\n```\n\nIf you want it's easy to build all the components. You need *golang \u003e 1.8*:\n\n```bash\nmake build\n```\n\nAlso there is a Dockerfile to build a container:\n\n```bash\ndocker build .\n```\n\n# Roadmap\n\nLook at milestone https://github.com/sonm-io/insonmnia/milestones\n\n# How to run\n\n## Hub\n\nTo start a hub it's needed to expose a couple of ports.\n*10001* handles gRCP requests from CLI\n*10002* is used to handle communication with miners\n\n```bash\ndocker run --rm -p 10002:10002 -p 10001:10001  sonm/insonmnia sonmhub\n```\n\n## Miner\n\nTo run Miner from the container you need to pass docker socket inside and specify IP of the HUB\n\n```bash\n  docker run --net host -e DOCKER_API_VERSION=1.24 -v /run:/var/run sonm/insonmnia:alpha3 sonmminer -h \u003chubip:10002\u003e\n```\n\n## CLI commands\n\nCLI sends commands to a hub. A hub must be pointed via *--hub=\u003chubip:port\u003e*. Port is usually *10001*.\n\n### ping\n\nJust check that a hub is reachable and alive.\n\n```bash\nsonmcli --hub \u003chubip:10001\u003e ping\nOK\n```\n\n### list\n\nList shows a list of miners connected to a hub with tasks assigned to them.\n\n**NOTE: later each miner will have a unique signed ID instead of host:port**\n\n```bash\nsonmcli --hub \u003chubip:port\u003e list\nConnected Miners\n{\n\t\"\u003cminerip:port\": {\n\t\t\"values\": [\n\t\t\t\"2b845fcc-143a-400b-92c7-aac2867ab62f\",\n\t\t\t\"412dd411-96df-442a-a397-6a2eba9147f9\"\n\t\t]\n\t}\n}\n```\n\n### start a container\n\nTo start a container you have to pick a hub and miner connected to that hub.\nYou can pick a miner from output of List command. See above.\n\n```bash\n./sonmcli --hub \u003chubip:port\u003e --timeout=3000s  start --image schturmfogel/sonm-q3:alpha  --miner=\u003cminerhost:port\u003e\n```\nThe result would look like:\n```\nID \u003cjobid\u003e, Endpoint [27960/tcp-\u003e\u003cip:port\u003e 27960/udp-\u003e\u003cip:port\u003e]\n```\n + **jobid** is an unique name for the task. Later it can be used to specify a task for various operations.\n + **Endpoint** describes mapping of exposed ports (google for Docker EXPOSE) to the real ports of a miner\n\n**NOTE**: later STUN will be used for UDP packets and LVS (ipvs) or userspace proxy (like SSH tunnel) for TCP. Miners who have a public IPv4 or can be reached via IPv6 would not need this proxy. The proxy is intended to get through NAT.\n\n### stop a container\n\nTo stop the task just provide the *jobid*\n\n```bash\nsonmcli --hub \u003chubip:port\u003e stop \u003cjobid\u003e\n```\n\n# How to cook a container\n\nDockerfile for the image should follow several requirements:\n + *ENTRYPOINT* or *CMD* or both must present\n + Network ports should be specified via *EXPOSE*\n\n# Technical overview\n\nTechnologies we use right now:\n\n  + *golang* is the main language. Athough golang has disadvantages, we believe that its model is good for fast start and the code is easy to understand. The simplicity leads to less errors. Also it makes easy to contribute to a project as a review process is very clean.\n  + *Docker* is a heart of an isolation in our platform. We rely on security features **(It's not 100% safe!)**, metrics, ecosystem it provides. The cool thing Docker is supported by many platforms. Also Docker works a lot on a unikernel approach for container based applications, which opens a huge field for security and portability improvements.\n  + *whisper* as a discovery protocol\n  + Until the epoch of IPv6 begins we should bring a way to get through NAT. The solution depends on a concrete transport layer. For example, different approaches should be used for UDP (e.g. STUN) and TCP (naive userspace proxy). Each approach has its own overhead and the best fit solution depends on a task.\n  + *gRPC* is an API protocol between components. It's very easy to extend, supports traffic compression, flexible auth model, supported by many language. It's becoming more and more popular as a technology for RPC.\n\n## Hub\n\nHub provides public gRPC-based API. proto files can be found in proto dir.\n\n## Miner\n\nMiner is expected to discover a Hub using Whisper. Later the miner connects to the hub via TCP. Right now a Miner must have a *public IP address*. Hub sends orders to the miner via gRPC on top of the connection. Hub pings the miner from time to time.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonm-io%2Finsonmnia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonm-io%2Finsonmnia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonm-io%2Finsonmnia/lists"}