haveno-ts/docs/index.html

49 lines
8.1 KiB
HTML
Raw Normal View History

2022-05-01 14:12:28 -04:00
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>haveno-ui-poc</title><meta name="description" content="Documentation for haveno-ui-poc"/><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 async src="assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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">haveno-ui-poc</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><h1> haveno-ui-poc </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><div class="tsd-panel tsd-typography">
<a href="#haveno-ui-proof-of-concept" id="haveno-ui-proof-of-concept" style="color: inherit; text-decoration: none;">
<h1>Haveno UI Proof of Concept</h1>
</a>
<p>A proof of concept to fetch and render data from Haveno&#39;s daemon in ReactJS.</p>
<p>This application is a lightly modified <a href="https://github.com/facebook/create-react-app">create-react-app</a> with typescript using <a href="https://www.envoyproxy.io/">envoy proxy</a> and <a href="https://github.com/grpc/grpc-web">grpc-web</a> to use Haveno&#39;s gRPC API.</p>
<a href="#run-in-a-browser" id="run-in-a-browser" style="color: inherit; text-decoration: none;">
<h2>Run in a Browser</h2>
</a>
<ol>
<li><a href="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-ui-poc</code></li>
<li>In a new terminal, start envoy with the config in haveno-ui-poc/config/envoy.yaml (change absolute path for your system): <code>docker run --rm --add-host host.docker.internal:host-gateway -it -v ~/git/haveno-ui-poc/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 <a href="https://github.com/grpc/grpc-web#code-generator-plugin">shown here</a>.</li>
<li><code>cd haveno-ui-poc</code></li>
<li><code>npm install</code></li>
<li><code>npm start</code> to open <a href="http://localhost:3000">http://localhost:3000</a> in a browser</li>
<li>Confirm that the Haveno daemon version is displayed (1.6.2).</li>
</ol>
<p align="center">
<img src="haveno-ui-poc.png" width="500"/><br>
</p>
<a href="#run-tests" id="run-tests" style="color: inherit; text-decoration: none;">
<h2>Run Tests</h2>
</a>
<p>Running the <a href="./src/haveno.test.ts">API tests</a> is the best way to develop and test Haveno end-to-end.</p>
<p><a href="./src/haveno.ts"><code>haveno.ts</code></a> provides the interface to Haveno&#39;s backend daemon.</p>
<ol>
<li><a href="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>Clone this project to the same parent directory as the haveno project: <code>git clone https://github.com/haveno-dex/haveno-ui-poc</code></li>
<li>In a new terminal, start envoy with the config in haveno-ui-poc/config/envoy.test.yaml (change absolute path for your system): <code>docker run --rm --add-host host.docker.internal:host-gateway -it -v ~/git/haveno-ui-poc/config/envoy.test.yaml:/envoy.test.yaml -p 8079:8079 -p 8080:8080 -p 8081:8081 -p 8082:8082 -p 8083:8083 -p 8084:8084 -p 8085:8085 -p 8086:8086 envoyproxy/envoy-dev:8a2143613d43d17d1eb35a24b4a4a4c432215606 -c /envoy.test.yaml</code></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 &amp;&amp; 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 <a href="https://github.com/grpc/grpc-web#code-generator-plugin">shown here</a>.</li>
<li><code>cd haveno-ui-poc</code></li>
<li><code>npm install</code></li>
<li><code>npm test</code> to run all tests or <code>npm run test -- -t &#39;my test&#39;</code> to run tests by name.</li>
</ol>
</div></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="modules/App.html">App</a></li><li class=" tsd-kind-module"><a href="modules/haveno.html">haveno</a></li><li class=" tsd-kind-module"><a href="modules/haveno.html">haveno</a></li><li class=" tsd-kind-module"><a href="modules/protobuf_GrpcServiceClientPb.html">protobuf/<wbr/>Grpc<wbr/>Service<wbr/>Client<wbr/>Pb</a></li><li class=" tsd-kind-module"><a href="modules/protobuf_grpc_pb.html">protobuf/grpc_<wbr/>pb</a></li><li class=" tsd-kind-module"><a href="modules/protobuf_pb_pb.html">protobuf/pb_<wbr/>pb</a></li><li class=" tsd-kind-module"><a href="modules/reportWebVitals.html">report<wbr/>Web<wbr/>Vitals</a></li><li class=" tsd-kind-module"><a href="modules/utils_HavenoUtils.html">utils/<wbr/>Haveno<wbr/>Utils</a></li><li class=" tsd-kind-module"><a href="modules/utils_TaskLooper.html">utils/<wbr/>Task<wbr/>Looper</a></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li><li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="assets/main.js"></script></body></html>