<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Riad Vargas de Oliveira on Medium]]></title>
        <description><![CDATA[Stories by Riad Vargas de Oliveira on Medium]]></description>
        <link>https://medium.com/@riadvargas?source=rss-865ddd8cf2ab------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*HqKkv5lsFiZadiEK.</url>
            <title>Stories by Riad Vargas de Oliveira on Medium</title>
            <link>https://medium.com/@riadvargas?source=rss-865ddd8cf2ab------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 22:44:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@riadvargas/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Testing SONM.io platform (alpha)]]></title>
            <link>https://medium.com/@riadvargas/using-poc-of-sonm-io-alpha-37283b24f635?source=rss-865ddd8cf2ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/37283b24f635</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[sonm]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[fog-computing]]></category>
            <dc:creator><![CDATA[Riad Vargas de Oliveira]]></dc:creator>
            <pubDate>Wed, 21 Jun 2017 06:07:58 GMT</pubDate>
            <atom:updated>2017-06-24T22:53:19.891Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<p>A few days ago developer team of SONM project released an article publishing alpha version of their platform (just a PoC) and how to use it.</p><p>I’ll give a my view about what I got &#39;till now and teach how to use it.</p><h3>Peers</h3><ul><li><strong>Hub</strong>: this node will delegate the tasks requested by clients to miners (I think in the future miner will be automatically assigned);</li><li><strong>Miner</strong>: will receive a task from hub and will execute it to be rewarded;</li><li><strong>Client</strong>: will request for hub some task to be executed by a miner.</li></ul><h3><strong>Using it</strong></h3><p>There&#39;s an image suggested by SONM to test the concept, it&#39;s a Quake 3 server image (<em>schturmfogel/sonm-q3:alpha</em>). But in this article I&#39;ll use a nginx image created by me.</p><p>First of all you&#39;ll need a hub to intermediate your communication with a miner, there&#39;s two possibilities now:<br>1. Use a hub provided by SONM, you can find them in <a href="https://blog.sonm.io/join-test-alpha-b4f999105fef">this article</a>.<br>2. Run an hub by yourself.</p><p><strong>Requirements</strong></p><ul><li>Docker (you can download it from <a href="https://www.docker.com/community-edition">https://www.docker.com/community-edition</a>);</li><li>An external IP address.</li></ul><h3><strong>Running a hub</strong></h3><p>Since we want to test the platform let’s run a hub by ourselves.</p><p><strong>Hands on</strong></p><pre>docker run -d -p 10002:10002 -p 10001:10001 sonm/insonmnia:alpha3 sonmhub</pre><p>You&#39;ll have to expose two ports: <strong>10002</strong> to handle with gRPC requests (for <strong>clients</strong>) and <strong>10001</strong> to communicate with <strong>miners</strong>.</p><p>Now you should see a running hub container in your Docker.</p><h3>Running a miner</h3><p>Now we already have a hub so we can connect a miner to our hub and wait for tasks.</p><p><strong>Hands on</strong></p><pre>docker run -d --net=host -e DOCKER_API_VERSION=API_VERSION -v /run:/var/run sonm/insonmnia:alpha3 sonmminer --hubaddress=YOUR_HUB_IP:10002</pre><p>Here we&#39;ll need to get our Docker API version from docker version and replace API_VERSION. After that replace YOUR_HUB_IP with your hub IP address or a known hub.</p><p>With that you&#39;ve connected to a hub and is ready to receive task requests from clients.</p><h3>Requesting a task</h3><p>Finally we have a perfectly running environment for test SONM. Now we can request a task to Hub.</p><p><strong>Hands on<br></strong>Until now we need to manually choose a miner to run our task, so we need to get our miner IP and port. For this we&#39;ll use the sonmcli list command:</p><pre>docker run sonm/insonmnia:alpha3 sonmcli --hub=YOUR_HUB_IP:10001 list</pre><p>Again we&#39;ll need to replace YOUR_HUB_IP with your hub IP address or a known hub.</p><p>It should retrieve something like that:</p><pre>Connected Miners<br>{<br>    “MINER_IP:MINER_PORT”: {}<br>}</pre><p>Now we have miner IP address and exposed port, so let&#39;s request to hub a task using our nginx image.</p><pre>docker run sonm/insonmnia:alpha3 sonmcli --hub=YOUR_HUB_IP:10001 --timeout=3000s start --image riadvargas/nginx-alpine --miner=MINER_IP:MINER_PORT</pre><p>Just replace YOUR_HUB_IP with your hub IP address or a known hub and MINER_IP:MINER_PORT with information retrieved by sonmcli list.</p><p>After that, if everything went right, you&#39;ll get a response like this:</p><pre>YOUR_HUB_IP:10001<br>ID 00000000–0000–0000–0000–000000000000, Endpoint [80/tcp-&gt;MINER_IP:EXPOSED_PORT]</pre><p>With MINER_IP:MINER_PORT you can use curl to see if it&#39;s running:</p><pre>riadvargas@mad-lab:# curl MINER_IP:EXPOSED_PORT<br>&lt;html&gt;<br>&lt;head&gt;&lt;title&gt;403 Forbidden&lt;/title&gt;&lt;/head&gt;<br>&lt;body bgcolor=”white”&gt;<br>&lt;center&gt;&lt;h1&gt;403 Forbidden&lt;/h1&gt;&lt;/center&gt;<br>&lt;hr&gt;&lt;center&gt;nginx&lt;/center&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>That&#39;s it! You can test tasks using other images, even with SONM suggested image.</p><p>It still in alpha so errors and bugs are expected, if you experience anything strange you can create an issue on Github (<a href="https://github.com/sonm-io/insonmnia/">https://github.com/sonm-io/insonmnia/</a>) or join their Slack (<a href="https://sonmio.signup.team/">https://sonmio.signup.team/</a>).</p><p>Give me your feedback about this article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37283b24f635" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>