<!DOCTYPE html><htmlclass="default"><head><metacharSet="utf-8"/><metahttp-equiv="x-ua-compatible"content="IE=edge"/><title>haveno-ts</title><metaname="description"content="Documentation for haveno-ts"/><metaname="viewport"content="width=device-width, initial-scale=1"/><linkrel="stylesheet"href="assets/style.css"/><linkrel="stylesheet"href="assets/highlight.css"/><scriptasyncsrc="assets/search.js"id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme")||"os")</script><header><divclass="tsd-page-toolbar"><divclass="container"><divclass="table-wrap"><divclass="table-cell"id="tsd-search"data-base="."><divclass="field"><labelfor="tsd-search-field"class="tsd-widget search no-caption">Search</label><inputtype="text"id="tsd-search-field"/></div><ulclass="results"><liclass="state loading">Preparing search index...</li><liclass="state failure">The search index is not available</li></ul><ahref="index.html"class="title">haveno-ts</a></div><divclass="table-cell"id="tsd-widgets"><divid="tsd-filter"><ahref="#"class="tsd-widget options no-caption"data-toggle="options">Options</a><divclass="tsd-filter-group"><divclass="tsd-select"id="tsd-filter-visibility"><spanclass="tsd-select-label">All</span><ulclass="tsd-select-list"><lidata-value="public">Public</li><lidata-value="protected">Public/Protected</li><lidata-value="private"class="selected">All</li></ul></div><inputtype="checkbox"id="tsd-filter-inherited"checked/><labelclass="tsd-widget"for="tsd-filter-inherited">Inherited</label><inputtype="checkbox"id="tsd-filter-externals"checked/><labelclass="tsd-widget"for="tsd-filter-externals">Externals</label></div></div><ahref="#"class="tsd-widget menu no-caption"data-toggle="menu">Menu</a></div></div></div></div><divclass="tsd-page-title"><divclass="container"><h1> haveno-ts </h1></div></div></header><divclass="container container-main"><divclass="row"><divclass="col-8 col-content"><divclass="tsd-panel tsd-typography">
<p>A proof of concept to fetch and render data from Haveno's daemon in ReactJS.</p>
<p>This application is a lightly modified <ahref="https://github.com/facebook/create-react-app">create-react-app</a> with typescript using <ahref="https://www.envoyproxy.io/">envoy proxy</a> and <ahref="https://github.com/grpc/grpc-web">grpc-web</a> to use Haveno's gRPC API.</p>
<li><ahref="https://github.com/haveno-dex/haveno/blob/master/docs/installing.md">Run a local Haveno test network</a>, running Alice as a daemon with <code>make alice-daemon</code>.</li>
<li>Clone this project to the same parent directory as the haveno project: <code>git clone https://github.com/haveno-dex/haveno-ts</code></li>
<li>In a new terminal, start envoy with the config in haveno-ts/config/envoy.yaml (change absolute path for your system): <code>docker run --rm --add-host host.docker.internal:host-gateway -it -v ~/git/haveno-ts/config/envoy.yaml:/envoy.yaml -p 8080:8080 envoyproxy/envoy-dev:8a2143613d43d17d1eb35a24b4a4a4c432215606 -c /envoy.yaml</code></li>
<li>Install protobuf compiler v3.19.1 or later for your system:<br>
mac: <code>brew install protobuf</code><br>
linux: <code>apt install protobuf-compiler</code>
NOTE: You may need to upgrade to v3.19.1 manually if your package manager installs an older version.</li>
<li>Download <code>protoc-gen-grpc-web</code> plugin and make executable as <ahref="https://github.com/grpc/grpc-web#code-generator-plugin">shown here</a>.</li>
<p>Running the <ahref="./src/haveno.test.ts">API tests</a> is the best way to develop and test Haveno end-to-end.</p>
<p><ahref="./src/haveno.ts"><code>haveno.ts</code></a> provides the interface to Haveno's backend daemon.</p>
<ol>
<li><ahref="https://github.com/haveno-dex/haveno/blob/master/docs/installing.md">Run a local Haveno test network</a> and then shut down the arbitrator, Alice, and Bob or run them as daemons, e.g. <code>make alice-daemon</code>. You may omit the arbitrator registration steps since it is done automatically in the tests.</li>
<li>In a new terminal, start the funding wallet. This wallet will be automatically funded in order to fund Alice and Bob during the tests.<br>For example: <code>cd ~/git/haveno && make funding-wallet</code>.</li>
<li>Install protobuf compiler v3.19.1 or later for your system:<br>
mac: <code>brew install protobuf</code><br>
linux: <code>apt install protobuf-compiler</code>
NOTE: You may need to upgrade to v3.19.1 manually if your package manager installs an older version.</li>
<li>Download <code>protoc-gen-grpc-web</code> plugin and make executable as <ahref="https://github.com/grpc/grpc-web#code-generator-plugin">shown here</a>.</li>