2024-10-17 21:31:23 +03:00

302 lines
27 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@truffle/db</title><meta name="description" content="Documentation for @truffle/db"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
<div class="tsd-toolbar-contents container">
<div class="table-cell" id="tsd-search" data-base=".">
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
<div class="field">
<div id="tsd-toolbar-links"></div></div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@truffle/db</a></div>
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
<div class="container container-main">
<div class="col-content">
<div class="tsd-page-title">
<h2>@truffle/db</h2></div>
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography"><a id="md:truffledb-api-documentation" class="tsd-anchor"></a><h1><a href="#md:truffledb-api-documentation">@truffle/db API documentation</a></h1><a id="md:introduction" class="tsd-anchor"></a><h2><a href="#md:introduction">Introduction</a></h2><p><strong>@truffle/db</strong> tracks information about smart contracts and their
development histories. It organizes this information almost entirely in the
form of <strong>content-addressed, immutable resources</strong> and seeks to serve as a
<strong>complete system of record</strong>, suitable to perfectly reproduce prior builds
and to act as a single source of truth.</p>
<p>This system of record covers the full gamut of concepts related to smart
contract development, from source code to deployment. Among other features,
it includes mechanisms for tracking the continuity of a smart contract as it
is implemented and even as the network to which it&#39;s deployed experiences
a hard-fork. <strong>Blockchain data is not forgotten — neither should blockchain
metadata.</strong></p>
<p>At a high-level, this package provides a
<a href="https://graphql.org/">GraphQL</a> interface and stores data via one of
several persistence backends thanks to <a href="https://pouchdb.com/">PouchDB</a>.
Use of this package directly is intended mostly for other tools – end users
can find interfaces to @truffle/db by way of Truffle itself, e.g. with the
<code>truffle db serve</code> command that starts a GraphQL Playground HTTP server.</p>
<p>This documentation serves to organize the modules and namespaces included
in the package, both for tool developer reference and for continued work
on @truffle/db itself. (Disclaimer: as a result, this API documentation
may serve neither of these purposes well. Please reach out with questions
and/or to suggest helpful clarifications!)</p>
<p>Continue reading below for an overview and full index of this package&#39;s
exports.</p>
<hr>
<figure style="text-align: center">
<img
src="media/images/example-query.png"
alt="Example query"
style="width: 85%" />
<figcaption style="font-size: small; font-style: italic">
<strong>Figure</strong>:
Example query for a project's <code>MagicSquare</code> contract
</figcaption>
</figure>
<hr>
<a id="md:contents" class="tsd-anchor"></a><h2><a href="#md:contents">Contents</a></h2><p>For quick reference, this documentation summary contains the following
headings:</p>
<ul>
<li><p><a href="#introduction">Introduction</a></p>
</li>
<li><p><a href="#contents">Contents</a></p>
</li>
<li><p><a href="#core-library-interface">Core library interface</a></p>
<ul>
<li><a href="#instantiating-truffledb">Instantiating @truffle/db</a></li>
<li><a href="#graphql-schema">GraphQL schema</a></li>
</ul>
</li>
<li><p><a href="#data-model">Data model</a></p>
<ul>
<li><a href="#structure">Structure</a></li>
<li><a href="#list-of-collections">List of collections</a></li>
</ul>
</li>
<li><p><a href="#other-interfaces">Other interfaces</a></p>
<ul>
<li><a href="#javascript---typescript-interface">JavaScript / TypeScript interface</a></li>
<li><a href="#network-abstraction">Network abstraction</a></li>
<li><a href="#truffle-project-abstraction">Truffle project abstraction</a></li>
<li><a href="#http-interface">HTTP interface</a></li>
</ul>
</li>
<li><p><a href="#additional-materials">Additional materials</a></p>
</li>
</ul>
<a id="md:core-library-interface" class="tsd-anchor"></a><h2><a href="#md:core-library-interface">Core library interface</a></h2><a id="md:instantiating-truffledb" class="tsd-anchor"></a><h3><a href="#md:instantiating-truffledb">Instantiating @truffle/db</a></h3><p>This package defines the primary [[connect | <code>connect()</code>]] function, which
returns an object adhering to the [[Db]] interface for given
<a href="#connectoptions">ConnectOptions</a>.
This [[Db]] interface defines the <code>async</code>
[[Meta.Db.execute | <code>db.execute()</code>]]
method that accepts a GraphQL request and returns a GraphQL response.</p>
<a id="md:graphql-schema" class="tsd-anchor"></a><h3><a href="#md:graphql-schema">GraphQL schema</a></h3><p>@truffle/db makes its GraphQL schema available as the exported
[[Graph.schema | <code>Graph.schema</code>]] variable, or view the SDL
details in the [[Graph]] namespace description.</p>
<a id="md:data-model" class="tsd-anchor"></a><h2><a href="#md:data-model">Data model</a></h2><a id="md:structure" class="tsd-anchor"></a><h3><a href="#md:structure">Structure</a></h3><p>Data is organized as collections of representations of key
concepts related to smart contract development. Each collection specifies:</p>
<ul>
<li>A collection name</li>
<li>A complete resource type (exported as
[[Resources.Resource | <code>Resources.Resource&lt;&quot;&lt;collectionName&gt;&quot;&gt;</code>]]; for
retrieved records)</li>
<li>An input type (exported as
[[Resources.Input | <code>Resources.Input&lt;&quot;&lt;collectionName&gt;&quot;&gt;</code>]]; for
new records)</li>
<li>A subset list of fields from its input type whose values strictly
compose to form a resource&#39;s content-addressable ID.</li>
<li>Whether its resources are mutable (<strong>note</strong>: currently, only
<code>&quot;projectNames&quot;</code> resources are mutable)</li>
<li>Whether its resources are named (meaning that resources of the same
and collection will be tracked by name, for continuity and easy lookup)</li>
</ul>
<a id="md:list-of-collections" class="tsd-anchor"></a><h3><a href="#md:list-of-collections">List of collections</a></h3><p>@truffle/db defines the following collections:</p>
<ul>
<li><code>&quot;bytecodes&quot;</code>
[<em>resource</em>: [[DataModel.Bytecode | Bytecode]];
<em>input</em>: [[DataModel.BytecodeInput | BytecodeInput]]]</li>
<li><code>&quot;compilations&quot;</code>
[<em>resource</em>: [[DataModel.Compilation | Compilation]];
<em>input</em>: [[DataModel.CompilationInput | CompilationInput]]]</li>
<li><code>&quot;contracts&quot;</code>
[<em><strong>named</strong></em>; <em>resource</em>: [[DataModel.Contract | Contract]];
<em>input</em>: [[DataModel.ContractInput | ContractInput]]]</li>
<li><code>&quot;contractInstances&quot;</code>
[<em>resource</em>: [[DataModel.ContractInstance | ContractInstance]];
<em>input</em>: [[DataModel.ContractInstanceInput | ContractInstanceInput]]]</li>
<li><code>&quot;nameRecords&quot;</code>
[<em>resource</em>: [[DataModel.NameRecord | NameRecord]];
<em>input</em>: [[DataModel.NameRecordInput | NameRecordInput]]]</li>
<li><code>&quot;networks&quot;</code>
[<em><strong>named</strong></em>; <em>resource</em>: [[DataModel.Network | Network]];
<em>input</em>: [[DataModel.NetworkInput | NetworkInput]]]</li>
<li><code>&quot;networkGenealogies&quot;</code>
[<em>resource</em>: [[DataModel.NetworkGenealogy | NetworkGenealogy]];
<em>input</em>: [[DataModel.NetworkGenealogyInput | NetworkGenealogyInput]]]</li>
<li><code>&quot;projectNames&quot;</code>
[<em><strong>mutable</strong></em>; <em>resource</em>: [[DataModel.ProjectName | ProjectName]];
<em>input</em>: [[DataModel.ProjectNameInput | ProjectNameInput]]]</li>
<li><code>&quot;projects&quot;</code>
[<em>resource</em>: [[DataModel.Project | Project]];
<em>input</em>: [[DataModel.ProjectInput | ProjectInput]]]</li>
<li><code>&quot;sources&quot;</code>
[<em>resource</em>: [[DataModel.Source | Source]];
<em>input</em>: [[DataModel.SourceInput | SourceInput]]]</li>
</ul>
<p>This list is not intended to be static; since @truffle/db is in early
release, it may make sense to add new collections / change relationships
between existing collections. Backwards compatibility is planned but not yet
guaranteed.</p>
<a id="md:other-interfaces" class="tsd-anchor"></a><h2><a href="#md:other-interfaces">Other interfaces</a></h2><a id="md:javascript--typescript-interface" class="tsd-anchor"></a><h3><a href="#md:javascript--typescript-interface">JavaScript / TypeScript interface</a></h3><p>This package exposes programmatic interfaces for working with
the resources listed above:</p>
<ul>
<li><p>[[Process.resources]], a set of four generator functions that encode
logic for storing and retrieving resources for a given <code>collectionName</code>.</p>
</li>
<li><p>[[Process.Run.forDb()]], to construct an <code>async</code> helper that facilitates
requests/responses from/to the above generator functions against a given
[[Db]] instance.</p>
</li>
<li><p>[[generateId | generateId()]], to predict the ID for a given resource
input. This can be useful for determining how to query for additional
information about entities with known properties.</p>
</li>
</ul>
<p>In addition, please see the [[Resources]] module for handy helper types for
dealing with @truffle/db entities.</p>
<a id="md:network-abstraction" class="tsd-anchor"></a><h3><a href="#md:network-abstraction">Network abstraction</a></h3><p>Keeping track of blockchain networks is nontrivial if you want to handle
network forks/re-orgs. To accommodate this, @truffle/db models
blockchain networks as individual point-in-time slices at various historic
blocks. As a result, a single blockchain network (e.g., &quot;mainnet&quot;) can and
will comprise many disparate [[DataModel.Network]] resources, one for each
block previously added.</p>
<p>This approach preserves immutability but requires additional record-keeping
in order to provide the commonly-understood continuous view of a blockchain.
To maintain this continuity, @truffle/db defines the
[[DataModel.NetworkGenealogy]] resource, each of which links two
[[DataModel.Network]] resources, stating that a given network is ancestor
to another. This collection of genealogy pairs is then used to compute a
sparse list of past historic blocks for a given latest network.</p>
<p>The process to populate @truffle/db with correct network data involves
alternately querying GraphQL and the underlying blockchain JSON-RPC.</p>
<p>This package provides the [[Network]] abstraction to simplify this process.</p>
<details>
<summary>Example usage</summary>
<pre><code class="language-typescript"><span class="hl-0">import</span><span class="hl-1"> </span><span class="hl-0">type</span><span class="hl-1"> { </span><span class="hl-2">Provider</span><span class="hl-1"> } </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">&quot;web3/providers&quot;</span><span class="hl-1">;</span><br/><span class="hl-4">declare</span><span class="hl-1"> </span><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">provider</span><span class="hl-1">: </span><span class="hl-6">Provider</span><span class="hl-1">;</span><br/><br/><span class="hl-0">import</span><span class="hl-1"> { </span><span class="hl-2">connect</span><span class="hl-1">, </span><span class="hl-2">Network</span><span class="hl-1"> } </span><span class="hl-0">from</span><span class="hl-1"> </span><span class="hl-3">&quot;@truffle/db&quot;</span><span class="hl-1">;</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">db</span><span class="hl-1"> = </span><span class="hl-7">connect</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-8">// ...</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">network</span><span class="hl-1"> = </span><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-2">Network</span><span class="hl-1">.</span><span class="hl-7">initialize</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-2">provider</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">db:</span><span class="hl-1"> </span><span class="hl-7">connect</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-8">// ...</span><br/><span class="hl-1"> }),</span><br/><span class="hl-1"> </span><span class="hl-2">network:</span><span class="hl-1"> { </span><span class="hl-2">name:</span><span class="hl-1"> </span><span class="hl-3">&quot;mainnet&quot;</span><span class="hl-1"> }</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-0">await</span><span class="hl-1"> </span><span class="hl-2">network</span><span class="hl-1">.</span><span class="hl-7">includeBlocks</span><span class="hl-1">([</span><br/><span class="hl-1"> { </span><span class="hl-2">height:</span><span class="hl-1"> </span><span class="hl-9">10000000</span><span class="hl-1">, </span><span class="hl-2">hash:</span><span class="hl-1"> </span><span class="hl-3">&quot;0x...&quot;</span><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-8">// ...</span><br/><span class="hl-1">]);</span><br/><br/><span class="hl-4">const</span><span class="hl-1"> { </span><span class="hl-5">historicBlock</span><span class="hl-1"> } = </span><span class="hl-2">network</span><span class="hl-1">.</span><span class="hl-2">knownLatest</span><span class="hl-1">;</span>
</code><button>Copy</button></pre>
</details>
<a id="md:truffle-project-abstraction" class="tsd-anchor"></a><h3><a href="#md:truffle-project-abstraction">Truffle project abstraction</a></h3><p>This package also provides an abstraction to interface with other
Truffle data formats, namely <code>WorkflowCompileResult</code>, returned by
@truffle/workflow-compile, and the Truffle contract artifacts format,
defined by @truffle/contract-schema. This abstraction covers two classes:</p>
<ul>
<li>[[Project.Project]] for operations that <strong>do not</strong> require a network
connection. Use function [[Project.initialize | <code>Project.initialize()</code>]]
to create.</li>
<li>[[Project.ConnectedProject]] for operations that <strong>do</strong> require a
blockchain network. Use existing project abstraction&#39;s
[[Project.connect | <code>project.connect()</code>]] method to create.</li>
</ul>
<a id="md:http-interface" class="tsd-anchor"></a><h3><a href="#md:http-interface">HTTP interface</a></h3><p>This package exposes the [[serve | <code>serve()</code>]] function, which returns an
<a href="https://www.apollographql.com/docs/apollo-server/">Apollo Server</a>
instance, adherent to the
<a href="https://nodejs.org/api/http.html#http_class_http_server">Node.js <code>http.Server</code></a>
interface. This server runs
<a href="https://github.com/graphql/graphql-playground">GraphQL Playground</a> for the
browser and also accepts plain GraphQL requests.</p>
<p><em>(This is a handy way to explore @truffle/db, since it offers schema-aware
auto-completion and the ability to explore relationships between entities.)</em></p>
<a id="md:additional-materials" class="tsd-anchor"></a><h2><a href="#md:additional-materials">Additional materials</a></h2><p>This package listing contains other namespaces not mentioned above.
These are for internal use and not to be considered part of @truffle/db&#39;s
public interface.</p>
<p>For those curious about these internals, of particular note is the [[Meta]]
namespace, which houses underlying collections-agnostic logic for
integrating GraphQL and PouchDB.</p>
</div>
<div class="tsd-comment tsd-typography"></div></section>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<h3 class="tsd-index-heading uppercase">Index</h3>
<section class="tsd-index-section">
<h3 class="tsd-index-heading">Primary</h3>
<div class="tsd-index-list"><a href="modules/DataModel.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>Data<wbr/>Model</span></a>
<a href="modules/Graph.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Graph</span></a>
<a href="modules/Process.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Process</span></a>
<a href="modules/Resources.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Resources</span></a>
</div></section>
<section class="tsd-index-section">
<h3 class="tsd-index-heading">Other</h3>
<div class="tsd-index-list"><a href="modules/Network.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Network</span></a>
<a href="modules/Project.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Project</span></a>
<a href="types/ConnectOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>Connect<wbr/>Options</span></a>
<a href="types/Db.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Db</span></a>
<a href="functions/connect.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>connect</span></a>
<a href="functions/generateId.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>generate<wbr/>Id</span></a>
<a href="functions/serve.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>serve</span></a>
</div></section>
<section class="tsd-index-section">
<h3 class="tsd-index-heading">Internal</h3>
<div class="tsd-index-list"><a href="modules/Meta.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Meta</span></a>
<a href="modules/Pouch.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Pouch</span></a>
</div></section></section></section></div>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)" id="icon-chevronDown"></path></svg>Settings</h3></summary>
<div class="tsd-accordion-details">
<div class="tsd-filter-visibility">
<h4 class="uppercase">Member Visibility</h4><form>
<ul id="tsd-filter-options">
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
<div class="tsd-theme-toggle">
<h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
<details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary">
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>On This Page</h3></summary>
<div class="tsd-accordion-details">
<ul>
<li>
<ul>
<li><a href="#md:truffledb-api-documentation"><span>@truffle/db API documentation</span></a></li>
<li>
<ul>
<li><a href="#md:introduction"><span>Introduction</span></a></li>
<li><a href="#md:contents"><span>Contents</span></a></li>
<li><a href="#md:core-library-interface"><span>Core library interface</span></a></li>
<li>
<ul>
<li><a href="#md:instantiating-truffledb"><span>Instantiating @truffle/db</span></a></li>
<li><a href="#md:graphql-schema"><span>GraphQL schema</span></a></li></ul></li>
<li><a href="#md:data-model"><span>Data model</span></a></li>
<li>
<ul>
<li><a href="#md:structure"><span>Structure</span></a></li>
<li><a href="#md:list-of-collections"><span>List of collections</span></a></li></ul></li>
<li><a href="#md:other-interfaces"><span>Other interfaces</span></a></li>
<li>
<ul>
<li><a href="#md:javascript--typescript-interface"><span>Java<wbr/>Script / <wbr/>Type<wbr/>Script interface</span></a></li>
<li><a href="#md:network-abstraction"><span>Network abstraction</span></a></li>
<li><a href="#md:truffle-project-abstraction"><span>Truffle project abstraction</span></a></li>
<li><a href="#md:http-interface"><span>HTTP interface</span></a></li></ul></li>
<li><a href="#md:additional-materials"><span>Additional materials</span></a></li></ul></li></ul></li></ul></div></details></div>
<div class="site-menu">
<nav class="tsd-navigation"><a href="index.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>@truffle/db</span></a>
<ul class="tsd-small-nested-navigation">
<li><a href="modules/DataModel.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Data<wbr/>Model</span></a></li>
<li><a href="modules/Graph.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Graph</span></a></li>
<li><a href="modules/Meta.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Meta</span></a></li>
<li><a href="modules/Network.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Network</span></a></li>
<li><a href="modules/Pouch.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Pouch</span></a></li>
<li><a href="modules/Process.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Process</span></a></li>
<li><a href="modules/Project.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Project</span></a></li>
<li><a href="modules/Resources.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4"></use></svg><span>Resources</span></a></li>
<li><a href="types/ConnectOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Connect<wbr/>Options</span></a></li>
<li><a href="types/Db.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Db</span></a></li>
<li><a href="functions/connect.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>connect</span></a></li>
<li><a href="functions/generateId.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>generate<wbr/>Id</span></a></li>
<li><a href="functions/serve.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>serve</span></a></li></ul></nav></div></div></div>
<div class="tsd-generator">
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
<div class="overlay"></div></body></html>