<?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 Nathan Lie on Medium]]></title>
        <description><![CDATA[Stories by Nathan Lie on Medium]]></description>
        <link>https://medium.com/@feraltc?source=rss-6ac29d2faffe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*szY_ODt7Fn62MGrvsqK7Kg.png</url>
            <title>Stories by Nathan Lie on Medium</title>
            <link>https://medium.com/@feraltc?source=rss-6ac29d2faffe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 19:51:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@feraltc/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[Codiusd 1.2.X: Upgrading and WebSocket support]]></title>
            <link>https://medium.com/codius/codiusd-1-2-0-upgrading-and-websocket-support-42f712a0cee9?source=rss-6ac29d2faffe------2</link>
            <guid isPermaLink="false">https://medium.com/p/42f712a0cee9</guid>
            <category><![CDATA[codius]]></category>
            <category><![CDATA[nginx]]></category>
            <dc:creator><![CDATA[Nathan Lie]]></dc:creator>
            <pubDate>Mon, 30 Jul 2018 22:28:02 GMT</pubDate>
            <atom:updated>2018-08-06T19:06:26.182Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PAhheBkIMiO2-_0eFjwz3w.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/cCthPLHmrzI?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">kazuend</a> on <a href="https://unsplash.com/search/photos/river?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>As the Codius network continues to grow, it becomes imperative that the hosts available on it are held to a number of expectations. This helps the network become more distributed, granting uploaders the certainty that the host they are uploading to will be able to support their apps.</p><p>Many web apps are designed using WebSockets, which requires additional features on top of HTTP. Due to their pervasiveness, we expect Codius hosts to have support for them to be part of the network. In order to encourage this, a self-test has been added with Codius v1.2.0 that runs at startup. This self-test includes testing for WebSocket compatibility, and failure to pass this or the other tests will bar the host from being discovered by the rest of the network. For many Codius hosts, explicit support for WebSockets will need to be enabled in their proxy configurations.</p><p>Many tutorials, such as the <a href="https://medium.com/codius/how-to-run-your-own-codius-host-42e13afe1fb2">inaugural one</a> by <a href="https://medium.com/u/b1195533f664">Stefan Thomas</a>, used Nginx as a proxy. As such, this post will explain the steps necessary to upgrade a Codius host that’s using Nginx. If your host is set up in this manner, read on.</p><p><strong>Note: This article assumes Codiusd is installed as described in the </strong><a href="https://medium.com/codius/how-to-run-your-own-codius-host-42e13afe1fb2"><strong>original Medium post</strong></a><strong> or in a similar manner.</strong></p><h3>Updating the Codiusd Daemon</h3><p>First, let’s make sure that <a href="https://www.npmjs.com/package/codiusd">Codiusd</a> is up to date. Recent versions of Codiusd (starting with v.1.2.0) introduce a self-test feature on startup to ensure it has a proper configuration for participating in the network. Outdated versions of Codiusd will make no such checks, which may cause uploaders to become wary of such hosts.</p><h4>Determine Codiusd’s package manager</h4><p>Codiusd is hosted on NPM, meaning that there are a number of package managers that pull from it. Depending on the method by which Codiusd was installed, the package management portions may have been abstracted from you. We’ll go over the ways to check your installed packages using NPM and Yarn, two of the most popular NPM package managers.</p><h4>Using NPM</h4><pre>npm list -g --depth=0 codiusd</pre><h4>Using Yarn</h4><pre>yarn global list --pattern &quot;codiusd&quot; --depth=0</pre><p>If Codiusd does not appear, check your installation method to discern the installation method. Assuming that Codiusd’s package manager was either NPM or Yarn, it can be updated with the following:</p><h4>Using NPM</h4><pre>npm update -g codiusd --unsafe-perm</pre><h4>Using Yarn</h4><pre>yarn global upgrade codiusd</pre><p>The latest versions of Codiusd contain tests that are performed on itself whenever it starts up to ensure it is suitable for participation in the network. Aside from the obvious pod upload test, it also introduces a test for WebSocket support. Failure to pass these tests prevents the host in question from engaging with the rest of the Codius network. More on dealing with test failures later.</p><h3>Enabling WebSockets in Nginx</h3><p>To enable WebSocket support, a few additions will be made to the Nginx configuration. First, locate the Nginx config file that contains the configuration for the server listening on port 443. This may be in /etc/nginx/conf.d/codius.conf as per the original tutorial, but it may also be the main config file (/etc/nginx/nginx.conf ). In any case, it should contain a block that looks like this:</p><p><em>Unimportant config lines have been truncated with ellipsis for brevity.</em></p><pre>server {<br>  listen 443 ssl;</pre><pre>  ....</pre><pre><br>  location / {<br>    proxy_pass http://127.0.0.1:3000;</pre><pre>    .....</pre><pre>  }<br>}</pre><p>First, we’re going to add a couple of aliases to the configuration:</p><pre>map $http_upgrade $connection_upgrade {<br>  default upgrade;<br>  &#39;&#39; $http_connection;<br>}</pre><p>This block should be located outside of the server block, like so:</p><pre>map $http_upgrade $connection_upgrade {<br>  default upgrade;<br>  &#39;&#39; $http_connection;<br>}<br>server {<br>  listen 443 ssl;</pre><pre>  ....</pre><pre>  location / {<br>    proxy_pass http://127.0.0.1:3000;</pre><pre>    .....</pre><pre>  }<br>}</pre><p>Finally, we need to add some headers when the connection is proxied to Codiusd from the / path.</p><pre>map $http_upgrade $connection_upgrade {<br>  default upgrade;<br>  &#39;&#39; $http_connection;<br>}<br>server {<br>  listen 443 ssl;</pre><pre>  ....</pre><pre>  location / {<br>    proxy_pass http://127.0.0.1:3000;<br>    proxy_set_header Upgrade $http_upgrade;<br>    proxy_set_header Connection $connection_upgrade;<br>    proxy_buffering off;<br>    .....</pre><pre>  }<br>}</pre><p><strong>Note: The additional proxy fields MUST come before any other fields in the block!</strong></p><p>These changes will be sufficient for your Nginx proxy to support WebSockets. Restart Hyperd and Nginx, then restart Codiusd and ensure it passed the startup tests:</p><pre>systemctl restart hyperd<br>systemctl restart nginx<br>systemctl restart codiusd &amp;&amp; journalctl -u codiusd -f</pre><p>If all is well, the startup logs should report no errors and your Codius host will now have support for WebSocket connections.</p><h3>Addressing Self-Test Failures</h3><p>The self-test that is run on host startup mimics a pod upload request from a client. The pod that is uploaded to the host runs a WebSocket server, which the self-test then attempts to connect with. When these operations are successful, peer discovery is activated and the Codiusd process continues.</p><p>In the event the tests fail, the reason can be discerned from the logs. First, we’ll need to make sure the logs only output the information we need. To do this, make the following changes to your codiusd.service file. It is typically located in /usr/lib/codiusd/codiusd.service, but its location can be determined from the output of systemctl status codiusd. Inside the service file, locate the line containing Environment=&quot;DEBUG=*&quot; or some variation thereof. Replace (or create it if it isn’t there) the line with Environment=&quot;DEBUG=codiusd*,ilp*,-*Peer*,-*trace*&quot; in the [Service] section as shown:</p><pre>[Unit]<br>Description=Codiusd<br>After=network.target nss-lookup.target</pre><pre>[Service]<br>ExecStart=/usr/bin/npm start<br>Environment=&quot;DEBUG=codiusd*,ilp*,-*Peer*,-*trace*&quot;<br>Environment=&quot;CODIUS_PUBLIC_URI=<a href="https://codius.feraltc.com/">https://codius.feraltc.com</a>&quot;<br>WorkingDirectory=/usr/lib/node_modules/codiusd<br>Restart=always<br>StandardOutput=syslog<br>StandardError=syslog<br>SyslogIdentifier=codiusd<br>User=root<br>Group=root</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>Then be sure to reload the service file before restarting:</p><pre>systemctl daemon-reload<br>systemctl restart codiusd &amp;&amp; journalctl -f -u codiusd</pre><p>From here, the reason for the failure can be found. All messages regarding Self Test status can be found in the log lines that contain SelfTest and SelfTestCheck. The host will continue to run, but will not accept uploads externally, broadcast itself to the network, or accept network messages other hosts. Instead, any requests made to the host will return a message that gives the state of the Self Test, so it can be used for debugging.</p><p>The Self Test performs three tests that it reports on in case of failure:</p><ul><li>An upload test</li><li>An HTTP connection test to the uploaded pod</li><li>A WebSocket connection test to the uploaded pod</li></ul><p>You can view the statuses of these tests by either visiting your host in the browser while it is in its failed state, or by using a tool like curl in the command line.</p><h3>Final Words</h3><p>The Codius network is growing fast, with an astounding number of hosts being launched since the announcement in June. But without consistency among hosts, it invalidates a portion of that achievement. To ensure that growth in the network is meaningful, we must enforce proper configuration for all members of the Codius network.</p><p>If you have any questions, feel free to ask them in our <a href="https://gitter.im/codius/codius-chat">Gitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42f712a0cee9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codius/codiusd-1-2-0-upgrading-and-websocket-support-42f712a0cee9">Codiusd 1.2.X: Upgrading and WebSocket support</a> was originally published in <a href="https://medium.com/codius">Codius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ILDeathmatch: Monetize Your Quake Games]]></title>
            <link>https://medium.com/interledger-blog/ildeathmatch-monetize-your-quake-games-788b0a7c624c?source=rss-6ac29d2faffe------2</link>
            <guid isPermaLink="false">https://medium.com/p/788b0a7c624c</guid>
            <category><![CDATA[interledger]]></category>
            <category><![CDATA[monetization]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[interoperability]]></category>
            <dc:creator><![CDATA[Nathan Lie]]></dc:creator>
            <pubDate>Mon, 07 May 2018 17:17:31 GMT</pubDate>
            <atom:updated>2018-05-10T23:03:46.382Z</atom:updated>
            <content:encoded><![CDATA[<p>With Interledger and <a href="https://medium.com/interledger-blog/replace-ads-with-web-monetization-239ce1930f3d">Web Monetization</a>, developers and content creators are offered the ability to make many small real-time payments. In particular, this allows the monetization of high-frequency events where money will change hands often.</p><p>This opens up a number of payment-related use cases that were previously weren’t feasible. The gaming sector provides an excellent opportunity to apply these concepts, as there are a number of fast-paced games that have a high volume of events that can be monetized to reward certain aspects such as individual skill.</p><p>We’ll examine this application of Web Monetization with a project called ILDeathmatch. This will be lengthy, so strap in.</p><h3>Recommended Reading</h3><p>As ILDeathmatch is a rather specific use case for Interledger and Web Monetization, it draws heavily upon previously mentioned concepts on this blog. The necessary context will be provided throughout this post, but for the big picture, the following posts are recommended:</p><ul><li><a href="https://medium.com/interledger-blog/using-moneyd-to-join-the-ilp-testnet-ba64bd42bb14">Using Moneyd to Join the ILP testnet</a></li><li><a href="https://medium.com/interledger-blog/replace-ads-with-web-monetization-239ce1930f3d">Replace Ads with Web Monetization</a></li><li><a href="https://medium.com/interledger-blog/spsp-simple-payment-setup-protocol-2028292e6925">SPSP: Simple Payment Setup Protocol</a></li></ul><h3>What is ILDeathmatch?</h3><p>ILDeathmatch, or ILDM for short, uses Web Monetization to provide a different gaming experience delivered on the back of the classic First-Person Shooter <a href="https://github.com/inolen/quakejs">Quake III Arena</a>, entirely within the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ypOZDAQv-gKq_dpa4-mkjA.png" /></figure><p>ILDeathmatch modifies Quake III gameplay in these ways:</p><ul><li>Players connecting to the server must pay a server-defined amount in order to spawn or respawn.</li><li>Players who score kills on other players are paid a server-defined amount.</li></ul><p>In cases where the player is unable to pay the server when prompted, the player is kicked from the server. Harsh, but then again, so is Quake.</p><h3>How does it work?</h3><p>There are three major components to hosting ILDM. A Quake Server, a Web Monetization server, and <a href="https://medium.com/interledger-blog/using-moneyd-to-join-the-ilp-testnet-ba64bd42bb14">Moneyd</a>. All three of these components are hosted together on a single Web server.</p><h4>The Web Monetization Server</h4><p>The Web Monetization Server is the component that actually exposes endpoints that send and receive payment. It handles API calls from the Quake Server as certain events in a game occur, and collects payment &amp; payment pointers from users that join.</p><p><a href="https://medium.com/interledger-blog/replace-ads-with-web-monetization-239ce1930f3d">As described before with Web Monetization</a>, users send payment to the server with any web extension that provides Web Monetization (such as Minute from the Chrome Web Store). Over time, it generates a balance tied to a single user that the server deducts from as they spawn or respawn into the game. They receive payments by <a href="https://medium.com/interledger-blog/spsp-simple-payment-setup-protocol-2028292e6925">creating an SPSP Server</a> and sending the payment pointer that is generated to the Web Monetization Server via a form.</p><h4>The Quake Server</h4><p>The Quake Server is essentially no different from a typical Quake game server. It hosts a game session of Quake III Arena running Free-For-All as a game mode. The main difference is that the server is run as a child of a Node.js process, which monitors the server console and makes API calls as events such as connections, disconnections, kills, and deaths occur. It also handles the kicking of players who don’t have a high enough balance to spawn.</p><h4>Moneyd</h4><p><a href="https://medium.com/interledger-blog/using-moneyd-to-join-the-ilp-testnet-ba64bd42bb14">Moneyd has been discussed before on this blog</a>, and in this context it does not deviate much from its previous descriptions. The Web Monetization Server runs this daemon in order to facilitate payments over Interledger.</p><h3>Joining the live ILDeathmatch Demo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VdGrTGNx99AebwfUQsoFwQ.png" /></figure><p>If you’ve got some time to kill (as well as some friends), you can join the live ILDeathmatch Server at <a href="http://ildeathmatch.com/">ildeathmatch.com</a>. It runs Moneyd on the testnet, so no real money is transferred or required.</p><h4>Prerequisites</h4><p>You will need to be running an instance of Moneyd on the testnet in order to send and receive “payments” from the demo site. Attempting to connect with Moneyd on the livenet will cause you to be kicked from the server. <a href="https://medium.com/interledger-blog/using-moneyd-to-join-the-ilp-testnet-ba64bd42bb14">You can read about setting up Moneyd here.</a> Make sure that you’re on Moneyd version 4 or higher.</p><p>Since Moneyd does not connect to the browser for payments by default, <strong>be sure it’s running with --unsafe-allow-extensions</strong> as seen below:</p><pre>moneyd xrp:start --testnet --unsafe-allow-extensions</pre><p><em>Replace </em><em>xrp:start with your currency of preference if you aren’t using the XRP uplink.</em></p><p>You will also need to be using <a href="https://www.google.com/chrome/index.html">Google Chrome</a> as a browser, as the current implementation of Web Monetization uses a Chrome extension to make payments.</p><p>The Chrome extension is called Minute, which connects to Moneyd to allow web pages to receive funds from it for monetized content. <a href="https://chrome.google.com/webstore/detail/minute/fakjpmebfmpdbhpnddiokemempckoejk">You can install Minute from the Chrome Web Store here.</a></p><p>Finally, you will need to set up a SPSP Server. It will create a local tunnel on your machine through which you can receive “payments” from the ILDeathmatch server. <a href="https://medium.com/interledger-blog/spsp-simple-payment-setup-protocol-2028292e6925">You can read about setting up a SPSP Server here.</a></p><h4>Connecting to ILDeathmatch</h4><p>Once you’ve completed all the prerequisites, connect to the demo at <a href="http://ildeathmatch.com/">ildeathmatch.com</a>. You’ll be greeted with a simple landing page with a form that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m9fYoKL333YnTOaKAFL0ow.png" /></figure><p>In order to connect, all you have to do is enter a valid payment pointer. The site will ping your pointer, and if it is successful, you’ll connect to the Quake server. You’ll be asked to download the Quake 3 Demo binary into your browser. Read the EULA, then accept the terms. After that, you’ll load into the game. All that’s left to do now is get some frags.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*70C7SXUTg4jClqzx8buSnw.png" /></figure><p>Be sure to monitor the output of your SPSP Server process. You’ll notice that it’ll receive a 0-drop ping upon connecting, and then pay you in real time for the kills you score.</p><h3>Further Reading</h3><p>The source code for the <a href="https://github.com/njlie/ILDeathmatch">Quake Server can be found here</a>, as well as the source code for the <a href="https://github.com/njlie/ILDeathmatch-Server">Web Monetization Server</a>. The Web Monetization server extends <a href="https://github.com/interledgerjs/koa-web-monetization">Koa Web Monetization</a> with a module called <a href="https://github.com/njlie/dm-web-monetization">DM Web Monetization</a>. If you wish to run your own instance of ILDeathmatch, you can refer to the docs in these repositories.</p><h3>Credits</h3><p>The Javascript implementation of Quake III Arena is owed entirely to the work of “inolen” at <a href="https://github.com/inolen/quakejs">inolen/quakejs.</a></p><p>If you have any questions, feel free to <a href="https://gitter.im/interledger/Lobby">ask them in our Gitter!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=788b0a7c624c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/interledger-blog/ildeathmatch-monetize-your-quake-games-788b0a7c624c">ILDeathmatch: Monetize Your Quake Games</a> was originally published in <a href="https://medium.com/interledger-blog">Interledger Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>