Skip to content

Commit

Permalink
Docs: (28cce1e) feat: v2 endpoint for pruned snapshot that returns en…
Browse files Browse the repository at this point in the history
…tities as raw bytes (#215)

* feat: v2 endpoint for pruned snapshot that returns entities as raw bytes

* feat(network): integrate getStateLatestStreamPrunedV2

* fix(utils): handle hex array with length 0

* fix: use hexutil.Decode

* fix: convert entity id uint8 array to string once

* chore: debug invalid entity index

* fix: use decodebig for parsing hex encoded entity id uint256

* feat(snapshot): add GetStateLatestStreamV2 endpoint

* fix(network): call getStateLatestStreamV2 if no prune options are provided

Co-authored-by: alvrs <alvarius@lattice.xyz>
  • Loading branch information
alvrs and alvrs committed Oct 28, 2022
1 parent c00d2eb commit a46063f
Show file tree
Hide file tree
Showing 333 changed files with 786 additions and 518 deletions.
2 changes: 1 addition & 1 deletion docs/network/assets/search.js

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/network/classes/SyncWorker.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h4>Implements</h4>
<ul class="tsd-hierarchy">
<li><span class="tsd-signature-type">DoWork</span><span class="tsd-signature-symbol">&lt;</span><a href="../types/Input.html" class="tsd-signature-type" data-tsd-kind="Type alias">Input</a><span class="tsd-signature-symbol">, </span><a href="../types/NetworkEvent.html" class="tsd-signature-type" data-tsd-kind="Type alias">NetworkEvent</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">C</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></li></ul></section><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/b568e2d/packages/network/src/workers/SyncWorker.ts#L60">network/src/workers/SyncWorker.ts:60</a></li></ul></aside>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/28cce1e/packages/network/src/workers/SyncWorker.ts#L60">network/src/workers/SyncWorker.ts:60</a></li></ul></aside>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
Expand Down Expand Up @@ -67,24 +67,24 @@ <h4 class="tsd-type-parameters-title">Type Parameters</h4>
<h4>C<span class="tsd-signature-symbol"> extends </span><span class="tsd-signature-type">Components</span></h4></li></ul></div>
<h4 class="tsd-returns-title">Returns <a href="SyncWorker.html" class="tsd-signature-type" data-tsd-kind="Class">SyncWorker</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">C</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/b568e2d/packages/network/src/workers/SyncWorker.ts#L65">network/src/workers/SyncWorker.ts:65</a></li></ul></aside></li></ul></section></section>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/28cce1e/packages/network/src/workers/SyncWorker.ts#L65">network/src/workers/SyncWorker.ts:65</a></li></ul></aside></li></ul></section></section>
<section class="tsd-panel-group tsd-member-group">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private"><a id="input_" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>input$</span><a href="#input_" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">input$<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Subject</span><span class="tsd-signature-symbol">&lt;</span><a href="../types/Input.html" class="tsd-signature-type" data-tsd-kind="Type alias">Input</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/b568e2d/packages/network/src/workers/SyncWorker.ts#L61">network/src/workers/SyncWorker.ts:61</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/28cce1e/packages/network/src/workers/SyncWorker.ts#L61">network/src/workers/SyncWorker.ts:61</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private"><a id="output_" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>output$</span><a href="#output_" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">output$<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Subject</span><span class="tsd-signature-symbol">&lt;</span><a href="../types/NetworkEvent.html" class="tsd-signature-type" data-tsd-kind="Type alias">NetworkEvent</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">C</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/b568e2d/packages/network/src/workers/SyncWorker.ts#L62">network/src/workers/SyncWorker.ts:62</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/28cce1e/packages/network/src/workers/SyncWorker.ts#L62">network/src/workers/SyncWorker.ts:62</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private"><a id="syncState" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>sync<wbr/>State</span><a href="#syncState" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">sync<wbr/>State<span class="tsd-signature-symbol">:</span> <a href="../types/SyncStateStruct.html" class="tsd-signature-type" data-tsd-kind="Type alias">SyncStateStruct</a><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/b568e2d/packages/network/src/workers/SyncWorker.ts#L63">network/src/workers/SyncWorker.ts:63</a></li></ul></aside></section></section>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/28cce1e/packages/network/src/workers/SyncWorker.ts#L63">network/src/workers/SyncWorker.ts:63</a></li></ul></aside></section></section>
<section class="tsd-panel-group tsd-member-group">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private"><a id="init" class="tsd-anchor"></a>
Expand All @@ -107,7 +107,7 @@ <h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code>
</div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/b568e2d/packages/network/src/workers/SyncWorker.ts#L111">network/src/workers/SyncWorker.ts:111</a></li></ul></aside></li></ul></section>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/28cce1e/packages/network/src/workers/SyncWorker.ts#L111">network/src/workers/SyncWorker.ts:111</a></li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-private"><a id="setLoadingState" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>set<wbr/>Loading<wbr/>State</span><a href="#setLoadingState" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-private">
Expand All @@ -133,7 +133,7 @@ <h5>blockNumber: <span class="tsd-signature-type">number</span><span class="tsd-
</div></li></ul></div>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/b568e2d/packages/network/src/workers/SyncWorker.ts#L79">network/src/workers/SyncWorker.ts:79</a></li></ul></aside></li></ul></section>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/28cce1e/packages/network/src/workers/SyncWorker.ts#L79">network/src/workers/SyncWorker.ts:79</a></li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="work" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>work</span><a href="#work" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
Expand All @@ -147,7 +147,7 @@ <h5>input$: <span class="tsd-signature-type">Observable</span><span class="tsd-s
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Observable</span><span class="tsd-signature-symbol">&lt;</span><a href="../types/NetworkEvent.html" class="tsd-signature-type" data-tsd-kind="Type alias">NetworkEvent</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">C</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
<p>Implementation of DoWork.work</p>
<ul>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/b568e2d/packages/network/src/workers/SyncWorker.ts#L285">network/src/workers/SyncWorker.ts:285</a></li></ul></aside></li></ul></section></section></div>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/28cce1e/packages/network/src/workers/SyncWorker.ts#L285">network/src/workers/SyncWorker.ts:285</a></li></ul></aside></li></ul></section></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
8 changes: 4 additions & 4 deletions docs/network/enums/ConnectionState.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<li><a href="ConnectionState.html">ConnectionState</a></li></ul>
<h1>Enumeration ConnectionState</h1></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/b568e2d/packages/network/src/createProvider.ts#L38">network/src/createProvider.ts:38</a></li></ul></aside>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/28cce1e/packages/network/src/createProvider.ts#L38">network/src/createProvider.ts:38</a></li></ul></aside>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
Expand All @@ -36,17 +36,17 @@ <h2>Enumeration Members</h2>
<h3 class="tsd-anchor-link"><span>CONNECTED</span><a href="#CONNECTED" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none" id="icon-anchor-a"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" id="icon-anchor-b"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" id="icon-anchor-c"></path></svg></a></h3>
<div class="tsd-signature">CONNECTED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">2</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/b568e2d/packages/network/src/createProvider.ts#L41">network/src/createProvider.ts:41</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/28cce1e/packages/network/src/createProvider.ts#L41">network/src/createProvider.ts:41</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"><a id="CONNECTING" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>CONNECTING</span><a href="#CONNECTING" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">CONNECTING<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">1</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/b568e2d/packages/network/src/createProvider.ts#L40">network/src/createProvider.ts:40</a></li></ul></aside></section>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/28cce1e/packages/network/src/createProvider.ts#L40">network/src/createProvider.ts:40</a></li></ul></aside></section>
<section class="tsd-panel tsd-member tsd-kind-enum-member tsd-parent-kind-enum"><a id="DISCONNECTED" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>DISCONNECTED</span><a href="#DISCONNECTED" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
<div class="tsd-signature">DISCONNECTED<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">0</span></div><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/b568e2d/packages/network/src/createProvider.ts#L39">network/src/createProvider.ts:39</a></li></ul></aside></section></section></div>
<li>Defined in <a href="https://github.com/latticexyz/mud/blob/28cce1e/packages/network/src/createProvider.ts#L39">network/src/createProvider.ts:39</a></li></ul></aside></section></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
Loading

0 comments on commit a46063f

Please sign in to comment.