Skip to content

Commit

Permalink
Deploy preview for PR 202 🛫
Browse files Browse the repository at this point in the history
  • Loading branch information
mlegner committed Jan 15, 2025
1 parent b3e6f3d commit b5580f3
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 70 deletions.
101 changes: 67 additions & 34 deletions pr-preview/pr-202/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -2492,8 +2492,8 @@ <h2 id="show-me"><a class="header" href="#show-me">Show me</a></h2>
browser through the Walrus Site <em>portal</em> <a href="https://walrus.site">https://walrus.site</a>. While the portal's operation is
explained in a <a href="walrus-sites/./portal.html">later section</a>, consider for now that there can be many portals (hosted
by whoever wants to have their own, and even on <code>localhost</code>). Further, the only function of the
portal is to provide the browser with some code (specifically, a service worker) that allows it to
fetch the Walrus Site from Sui and Walrus.</p>
portal is to retrieve the metadata (from Sui) and the resource files (from Walrus) that constitute
the site.</p>
<p>If you have a Sui wallet with some Testnet SUI, you can try and "mint a new Flatlander" from the
site. This creates an NFT from the collection and shows you two links: one to the explorer, and one
to the "Flatlander site". This latter site is a special Walrus Site that exists only for that NFT,
Expand Down Expand Up @@ -2645,7 +2645,7 @@ <h2 id="select-the-source-material-for-the-site"><a class="header" href="#select
<p>There is a very useful <a href="https://github.com/MystenLabs/example-walrus-sites">example-Walrus-sites</a>
repository that contains multiple kinds of sites that you can use for reference.</p>
<p>For simplicity, we will start by publishing the most frugal of the sites, the <code>walrus-snake</code> game.</p>
<p>First, clone the repository of examples:</p>
<p>First, clone the repository of the examples:</p>
<pre><code class="language-sh">git clone https://github.com/MystenLabs/example-walrus-sites.git &amp;&amp; cd walrus-snake/
</code></pre>
<h2 id="publish-the-site"><a class="header" href="#publish-the-site">Publish the site</a></h2>
Expand Down Expand Up @@ -3172,9 +3172,10 @@ <h3 id="portal-types"><a class="header" href="#portal-types">Portal types</a></h
<p>As mentioned before, we provide two types of portals to browse Walrus Sites:</p>
<ul>
<li>The server-side portal, which is a server that resolves a Walrus Site, returning it to the
browser. The server-side portal is hosted at <a href="https://blob.store">https://blob.store</a>.</li>
<li>The service-worker portal, which is a service worker that is installed in the browser and resolves
a Walrus Site. The service-worker portal is hosted at <a href="https://walrus.site">https://walrus.site</a>.</li>
browser. The server-side portal is hosted at <a href="https://walrus.site">https://walrus.site</a>.</li>
<li>The service-worker portal, which is a service worker that is installed in the browser and
resolves a Walrus Site. The service-worker portal is no longer hosted at a specific domain, but
the code is still maintained so that it can be used by anyone.</li>
</ul>
<p>We now describe the resolution process of a Walrus Site in the browser using the service-worker
portal as an example.</p>
Expand Down Expand Up @@ -3203,6 +3204,21 @@ <h3 id="the-end-to-end-resolution-of-a-walrus-site"><a class="header" href="#the
</ul>
<p>These steps are executed for all resources the browser may query thereafter (for example, if
<code>/index.html</code> points to <code>assets/cat.png</code>).</p>
<div id="admonition-server-side-approach" class="admonition admonish-tip" role="note" aria-labelledby="admonition-server-side-approach-title">
<div class="admonition-title">
<div id="admonition-server-side-approach-title">
<p>Server side approach</p>
</div>
<a class="admonition-anchor-link" href="walrus-sites/overview.html#admonition-server-side-approach"></a>
</div>
<div>
<p>The server-side portal works similarly, but the resolution is performed by the server. Meaning that
the server will resolve the SuiNS name, fetch the dynamic fields, and return the resources to the
browser, without anything else happening on the user's side. So the steps 2-6 are no longer
relevant, and 7-10 are performed by the server. The resulting resources are transmitted to the
browser in a standard HTTP response.</p>
</div>
</div>
<h2 id="the-site-builder"><a class="header" href="#the-site-builder">The site builder</a></h2>
<p>To facilitate the creation of Walrus Sites, we provide the "site builder" tool. The site builder
takes care of creating Walrus Sites object on Sui, with the correct structure, and stores the site
Expand Down Expand Up @@ -3307,7 +3323,7 @@ <h3 id="remote-server-side-portal-deployment"><a class="header" href="#remote-se
<h3 id="remote-service-worker-portal-deployment"><a class="header" href="#remote-service-worker-portal-deployment">Remote service-worker portal deployment</a></h3>
<p>Here, the portal provider is only trusted to provide the correct service worker code to the user.
The user's browser will then perform the fetching and authentication. The guarantees are therefore
the same as with the remote server-site portal, with the addition that the user can inspect the code
the same as with the remote server-side portal, with the addition that the user can inspect the code
returned by the portal provider and verify its integrity (e.g., by comparing it the hash of the
service worker code to one that is known to be correct).</p>
<h3 id="local-portal-deployment"><a class="header" href="#local-portal-deployment">Local portal deployment</a></h3>
Expand All @@ -3332,51 +3348,68 @@ <h2 id="there-is-a-maximum-redirect-depth"><a class="header" href="#there-is-a-m
does not result in an infinite loading loop.</p>
<p>Different portals can set this limit as they desire. The limit for the portal hosted at
<a href="https://walrus.site">https://walrus.site</a> has a maximum redirect depth of 3.</p>
<h2 id="service-workers-are-not-available"><a class="header" href="#service-workers-are-not-available">Service workers are not available</a></h2>
<p>Walrus Sites leverage service workers in the clients' browsers to perform essential operations:</p>
<h2 id="service-worker-portal-limitations"><a class="header" href="#service-worker-portal-limitations">Service-worker portal limitations</a></h2>
<p>The following limitations only apply to portals based on service workers.</p>
<div id="admonition-tip" class="admonition admonish-tip" role="note" aria-labelledby="admonition-tip-title">
<div class="admonition-title">
<div id="admonition-tip-title">
<p>Tip</p>
</div>
<a class="admonition-anchor-link" href="walrus-sites/restrictions.html#admonition-tip"></a>
</div>
<div>
<p>If you need to support any of the features listed below, you should use a server-side portal.</p>
</div>
</div>
<h3 id="service-worker-portals-cant-serve-sites-based-on-service-workers"><a class="header" href="#service-worker-portals-cant-serve-sites-based-on-service-workers">Service-worker portals, can't serve sites based on service workers</a></h3>
<p>Service-worker portals leverage service workers in the clients' browsers to perform essential
operations:</p>
<ol>
<li>reading the site metadata from Sui;</li>
<li>fetching the page content from Walrus; and</li>
<li>serving the content to the browser.</li>
</ol>
<p>Therefore, a site deployed on Walrus Sites cannot use service workers itself. Installing a service
worker from within a Walrus Site will result in a dysfunctional site and a poor experience for the
user.</p>
<div id="admonition-note" class="admonition admonish-note" role="note" aria-labelledby="admonition-note-title">
<p>Therefore, a site accessed by a service-worker portal cannot use service workers itself. i.e.
you can't "stack" service workers! Installing a service worker from within a Walrus Site will
result in a dysfunctional site and a poor experience for the user.</p>
<h3 id="ios-sui-mobile-wallets-do-not-work-with-the-service-worker-portal"><a class="header" href="#ios-sui-mobile-wallets-do-not-work-with-the-service-worker-portal">iOS Sui mobile wallets do not work with the service-worker portal</a></h3>
<div id="admonition-warning" class="admonition admonish-warning" role="note" aria-labelledby="admonition-warning-title">
<div class="admonition-title">
<div id="admonition-note-title">
<p>Note</p>
<div id="admonition-warning-title">
<p>Warning</p>
</div>
<a class="admonition-anchor-link" href="walrus-sites/restrictions.html#admonition-note"></a>
<a class="admonition-anchor-link" href="walrus-sites/restrictions.html#admonition-warning"></a>
</div>
<div>
<p>This limitation only applies to portal based on service workers. A web portal will not
have this limitation.</p>
<p>This limitation <strong>only applies to portal based on service workers</strong>. If you need to access sites
that support this feature, you should use a server-side portal.</p>
</div>
</div>
<h2 id="ios-sui-mobile-wallets-do-not-work-with-the-service-worker-portal"><a class="header" href="#ios-sui-mobile-wallets-do-not-work-with-the-service-worker-portal">iOS Sui mobile wallets do not work with the service-worker portal</a></h2>
<p>Service workers cannot be loaded inside an in-app browser on iOS, because of a limitation of the
WebKit engine. As a consequence, Walrus Sites cannot be used within Sui-compatible wallet apps on
iOS. Therefore, Sui wallets cannot currently be used on a service-worker portal on iOS. Note,
however, that <em>browsing</em> a Walrus Site is still possible on iOS through any browser.</p>
<p>To provide a seamless experience for iOS users (and other users on browsers that do not support
service workers), we implemented a redirect to a server-side portal (<a href="https://blob.store">https://blob.store</a>). Whenever
a user on an iOS wallet browses a Walrus Site, the redirect will automatically take them to the
<code>&lt;site_name&gt;.blob.store</code> server-side portal. This way, the user can still use the wallet.</p>
<div id="admonition-note-1" class="admonition admonish-note" role="note" aria-labelledby="admonition-note-1-title">
WebKit engine. As a consequence, Walrus Sites that are accessed through a service worker portal
cannot be used within Sui-compatible wallet apps on iOS. Therefore, Sui wallets cannot currently
be used on a service-worker portal on iOS. Note, however, that <em>browsing</em> a Walrus Site is still
possible on iOS through any browser.</p>
<p>Given that you decided to use a service-worker portal as your main point of access to your sites,
to provide a seamless experience for iOS users (and other users on browsers that do not support
service workers), it is recommended to redirect to a server-side portal (<a href="https://walrus.site">https://walrus.site</a>).
Whenever a user on an iOS wallet browses a Walrus Site, the redirect will automatically take them
to the <code>&lt;site_name&gt;.walrus.site</code> server-side portal. This way, the user can still use the wallet.</p>
<h3 id="service-worker-portals-do-not-support-progressive-web-apps-pwas"><a class="header" href="#service-worker-portals-do-not-support-progressive-web-apps-pwas">Service worker portals do not support progressive web apps (PWAs)</a></h3>
<div id="admonition-warning-1" class="admonition admonish-warning" role="note" aria-labelledby="admonition-warning-1-title">
<div class="admonition-title">
<div id="admonition-note-1-title">
<p>Note</p>
<div id="admonition-warning-1-title">
<p>Warning</p>
</div>
<a class="admonition-anchor-link" href="walrus-sites/restrictions.html#admonition-note-1"></a>
<a class="admonition-anchor-link" href="walrus-sites/restrictions.html#admonition-warning-1"></a>
</div>
<div>
<p>This limitation only applies to portals based on service workers. A web portal will not
have this limitation.</p>
<p>This limitation <strong>only applies to portal based on service workers</strong>. If you need to access sites
that support this feature, you should use a server-side portal.</p>
</div>
</div>
<h2 id="no-support-for-progressive-web-apps-pwas"><a class="header" href="#no-support-for-progressive-web-apps-pwas">No support for progressive web apps (PWAs)</a></h2>
<p>With the current design, Walrus Sites cannot be used for progressive web apps (PWAs).</p>
<p>With the current design, service-worker portals cannot be used to access progressive web apps
(PWAs).</p>
<p>Two characteristics of the service-worker portal prevent support for PWAs:</p>
<ul>
<li>Since the service worker needs to be registered for the page to work, the PWA's manifest file
Expand Down
2 changes: 1 addition & 1 deletion pr-preview/pr-202/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pr-preview/pr-202/searchindex.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pr-preview/pr-202/walrus-sites/authentication.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ <h3 id="remote-server-side-portal-deployment"><a class="header" href="#remote-se
<h3 id="remote-service-worker-portal-deployment"><a class="header" href="#remote-service-worker-portal-deployment">Remote service-worker portal deployment</a></h3>
<p>Here, the portal provider is only trusted to provide the correct service worker code to the user.
The user's browser will then perform the fetching and authentication. The guarantees are therefore
the same as with the remote server-site portal, with the addition that the user can inspect the code
the same as with the remote server-side portal, with the addition that the user can inspect the code
returned by the portal provider and verify its integrity (e.g., by comparing it the hash of the
service worker code to one that is known to be correct).</p>
<h3 id="local-portal-deployment"><a class="header" href="#local-portal-deployment">Local portal deployment</a></h3>
Expand Down
4 changes: 2 additions & 2 deletions pr-preview/pr-202/walrus-sites/intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ <h2 id="show-me"><a class="header" href="#show-me">Show me</a></h2>
browser through the Walrus Site <em>portal</em> <a href="https://walrus.site">https://walrus.site</a>. While the portal's operation is
explained in a <a href="./portal.html">later section</a>, consider for now that there can be many portals (hosted
by whoever wants to have their own, and even on <code>localhost</code>). Further, the only function of the
portal is to provide the browser with some code (specifically, a service worker) that allows it to
fetch the Walrus Site from Sui and Walrus.</p>
portal is to retrieve the metadata (from Sui) and the resource files (from Walrus) that constitute
the site.</p>
<p>If you have a Sui wallet with some Testnet SUI, you can try and "mint a new Flatlander" from the
site. This creates an NFT from the collection and shows you two links: one to the explorer, and one
to the "Flatlander site". This latter site is a special Walrus Site that exists only for that NFT,
Expand Down
22 changes: 19 additions & 3 deletions pr-preview/pr-202/walrus-sites/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,10 @@ <h3 id="portal-types"><a class="header" href="#portal-types">Portal types</a></h
<p>As mentioned before, we provide two types of portals to browse Walrus Sites:</p>
<ul>
<li>The server-side portal, which is a server that resolves a Walrus Site, returning it to the
browser. The server-side portal is hosted at <a href="https://blob.store">https://blob.store</a>.</li>
<li>The service-worker portal, which is a service worker that is installed in the browser and resolves
a Walrus Site. The service-worker portal is hosted at <a href="https://walrus.site">https://walrus.site</a>.</li>
browser. The server-side portal is hosted at <a href="https://walrus.site">https://walrus.site</a>.</li>
<li>The service-worker portal, which is a service worker that is installed in the browser and
resolves a Walrus Site. The service-worker portal is no longer hosted at a specific domain, but
the code is still maintained so that it can be used by anyone.</li>
</ul>
<p>We now describe the resolution process of a Walrus Site in the browser using the service-worker
portal as an example.</p>
Expand Down Expand Up @@ -334,6 +335,21 @@ <h3 id="the-end-to-end-resolution-of-a-walrus-site"><a class="header" href="#the
</ul>
<p>These steps are executed for all resources the browser may query thereafter (for example, if
<code>/index.html</code> points to <code>assets/cat.png</code>).</p>
<div id="admonition-server-side-approach" class="admonition admonish-tip" role="note" aria-labelledby="admonition-server-side-approach-title">
<div class="admonition-title">
<div id="admonition-server-side-approach-title">
<p>Server side approach</p>
</div>
<a class="admonition-anchor-link" href="#admonition-server-side-approach"></a>
</div>
<div>
<p>The server-side portal works similarly, but the resolution is performed by the server. Meaning that
the server will resolve the SuiNS name, fetch the dynamic fields, and return the resources to the
browser, without anything else happening on the user's side. So the steps 2-6 are no longer
relevant, and 7-10 are performed by the server. The resulting resources are transmitted to the
browser in a standard HTTP response.</p>
</div>
</div>
<h2 id="the-site-builder"><a class="header" href="#the-site-builder">The site builder</a></h2>
<p>To facilitate the creation of Walrus Sites, we provide the "site builder" tool. The site builder
takes care of creating Walrus Sites object on Sui, with the correct structure, and stores the site
Expand Down
Loading

0 comments on commit b5580f3

Please sign in to comment.