Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
several
Browse files Browse the repository at this point in the history
  • Loading branch information
jorian committed Jan 24, 2018
1 parent 492e43d commit d08bb82
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 16 deletions.
Binary file modified docs/build/doctrees/api.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/faq.doctree
Binary file not shown.
32 changes: 28 additions & 4 deletions docs/build/html/_sources/api.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ WORK IN PROGRESS! This will list all API commands available in BarterDEX. WORK I
Introduction
------------

BarterDEX commands are called using RPC. If you installed BarterDEX by following the <INSERT LINK TO THAT GUIDE HERE> CLI manual installation guide, you'll have a lot of these commands ready to use in the ``~/SuperNET/iguana/dexscripts`` folder. These API docs will explain what each command does and what the possible arguments for each method are.
BarterDEX commands are called using Remote Procedure Calls (RPC). If you installed BarterDEX by following the <INSERT LINK TO THAT GUIDE HERE> CLI manual installation guide, you'll have a lot of these commands ready to use in the ``~/SuperNET/iguana/dexscripts`` folder. These API docs will explain what each command does and what the possible arguments for each method are.

You need to set a strong passphrase (prior to starting marketmaker) and userpass to be able to talk to BarterDEX using RPC. The passphrase is what determines the addresses and the userpass value.
You need to set a strong passphrase (prior to starting marketmaker) and userpass to be able to talk to BarterDEX using RPC. The passphrase is what determines the addresses and the userpass value, and will be needed in the startup arguments when starting the marketmaker process on your device (see below).

Curl can be used to send commands, see the following example taken from the ``dexscripts`` folder:

Expand All @@ -20,6 +20,7 @@ Curl can be used to send commands, see the following example taken from the ``de
The userpass is sourced from the ``dexscripts`` folder, so that file has to be created in the ``dexscripts`` folder prior to sending a command. The userpass is there to prevent bad actors from issuing RPC commands. Marketmaker will not work without it set.
Each command to BarterDEX will need this userpass value as value of the ``userpass`` key in the JSON.

``127.0.0.1:7783`` is the ip address and port where BarterDEX is listening for commands.

The json code in all the methods below is the data that is needed for each method described (mind the escape characters when using shell). For example:
Expand All @@ -38,9 +39,32 @@ The json code in all the methods below is the data that is needed for each metho
Starting marketmaker
--------------------

There are two different nodes in BarterDEX: a full relay node and a node that doesn't relay. In the dexscripts folder, these are started by ./run or ./client, respectively. Normally, only Liquidity Providers will prefer a full relay node, as they can respond to incoming requests one hop sooner. Others will use ./client, since it doesn't require as much bandwidth as a full relay node.
There are two different nodes in BarterDEX: a full relay node and a node that doesn't relay. In the ``dexscripts`` folder, these are started by ``./run`` or ``./client``, respectively. Normally, only Liquidity Providers will prefer a full relay node, as they can respond to incoming requests one hop sooner. Others will use ``./client``, since it doesn't require as much bandwidth as a full relay node and can therefore be perfect for regular users, ie. traders on BarterDEX.

Startup arguments
^^^^^^^^^^^^^^^^^

A full relay node is started by running marketmaker with the following arguments string:

.. code-block:: json
{
"gui":"<name of gui>",
"profitmargin":0.01,
"userhome":"<userhome + />",
"passphrase":"<passphrase>",
"coins":["<coins>"]
}
``gui`` is the codename for the GUI used to start marketmaker with. If you are the developer of a GUI, you need to define a codename for your GUI. Share this in the Komodo Platform slack and you will get paid for every trade a user makes using your GUI.

``profitmargin`` is the default profitmargin that this full relay node (or Liquidity Provider node) will use when placing orders in orderbooks using the ``autoprice`` method.

New or private network
^^^^^^^^^^^^^^^^^^^^^^

In order to start a network other than the default network, you need to add 2 arguments to the marketmaker startup arguments. When initiating a new network, a full relay node must be used, and it has to define ``"netid":<int netid>`` and ``"seednode":"<ipaddress>"`` to the marketmaker startup arguments, where the netid is any integer higher than 0 but lower than 14420. The seednode is the ip address of the server being a full relay node.

A full relay node is started with the following command:

Trade commands
--------------
Expand Down
29 changes: 29 additions & 0 deletions docs/build/html/_sources/faq.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,25 @@ Atomic means that a swap either totally succeeds or not at all.

Certain safeguards are needed to make sure the stealing of funds is not possible by either party.

How to get listed on BarterDEX?
-------------------------------

The requirements for a coin to be able to do an atomic swap are:

- have `BIP65 (Check LockTime Verify)`_ implemented;
- support the following standard Bitcoin API RPCs: ``getinfo`` ``getrawmempool`` ``gettxout`` ``getrawtransaction`` ``getblock`` ``listunspent`` ``listtransactions`` ``validateaddress`` ``importprivkey`` ``importaddress`` ``estimatefee`` ``getblockhash`` ``sendrawtransaction`` ``signrawtransaction``.

.. _BIP65 (Check LockTime Verify): https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki

Electrum or Native?
-------------------

Electrum let's you use the blockchain of the coin you want to trade, without having to download, install and sync that wallet. Just select Electrum and you are good to go.

Electrum is a Simple Payment Verification service, somewhere on a server, that can be used to verify transactions with. In other words, this means you can use this instead of having to download the wallet of your coin, let it sync etc.

Native is when you download, install and sync the wallet of the coin you want to trade. It is faster and more stable than using Electrum, for now. It is highly recommended for Liquidity Providers to use Native and not to use Electrum.

What are Zcredits?
------------------

Expand Down Expand Up @@ -56,6 +75,16 @@ Is it free to cancel an order?

Yes. Placing orders and sending a request doesn't cost you anything. Only when your request has found a willing trade partner and a connection has been established, you will start paying the dexfee.

How do I cancel an order?
-------------------------

This touches on the specifics of BarterDEX being a glorified auction instead of an exchange. <MORE INFO NEEDED>

How do I get the private key of my smartaddress?
------------------------------------------------

BarterDEX uses watch-only addresses, which basically means that BarterDEX is a trade wallet. The passphrase you enter when starting BarterDEX is the access to your coins.

How much are the fees?
----------------------

Expand Down
36 changes: 29 additions & 7 deletions docs/build/html/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">API docs</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="#starting-marketmaker">Starting marketmaker</a></li>
<li class="toctree-l2"><a class="reference internal" href="#starting-marketmaker">Starting marketmaker</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#startup-arguments">Startup arguments</a></li>
<li class="toctree-l3"><a class="reference internal" href="#new-or-private-network">New or private network</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#trade-commands">Trade commands</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#autoprice">autoprice</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#fixed-price">fixed price</a></li>
Expand Down Expand Up @@ -188,17 +192,17 @@ <h1>API docs<a class="headerlink" href="#api-docs" title="Permalink to this head
<p>WORK IN PROGRESS! This will list all API commands available in BarterDEX. WORK IN PROGRESS!</p>
<div class="section" id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h2>
<p>BarterDEX commands are called using RPC. If you installed BarterDEX by following the &lt;INSERT LINK TO THAT GUIDE HERE&gt; CLI manual installation guide, you’ll have a lot of these commands ready to use in the <code class="docutils literal"><span class="pre">~/SuperNET/iguana/dexscripts</span></code> folder. These API docs will explain what each command does and what the possible arguments for each method are.</p>
<p>You need to set a strong passphrase (prior to starting marketmaker) and userpass to be able to talk to BarterDEX using RPC. The passphrase is what determines the addresses and the userpass value.</p>
<p>BarterDEX commands are called using Remote Procedure Calls (RPC). If you installed BarterDEX by following the &lt;INSERT LINK TO THAT GUIDE HERE&gt; CLI manual installation guide, you’ll have a lot of these commands ready to use in the <code class="docutils literal"><span class="pre">~/SuperNET/iguana/dexscripts</span></code> folder. These API docs will explain what each command does and what the possible arguments for each method are.</p>
<p>You need to set a strong passphrase (prior to starting marketmaker) and userpass to be able to talk to BarterDEX using RPC. The passphrase is what determines the addresses and the userpass value, and will be needed in the startup arguments when starting the marketmaker process on your device (see below).</p>
<p>Curl can be used to send commands, see the following example taken from the <code class="docutils literal"><span class="pre">dexscripts</span></code> folder:</p>
<div class="highlight-shell"><div class="highlight"><pre><span></span><span class="ch">#!/bin/bash</span>
<span class="nb">source</span> userpass
curl --url <span class="s2">&quot;http://127.0.0.1:7783&quot;</span> --data <span class="s2">&quot;{\&quot;userpass\&quot;:\&quot;</span><span class="nv">$userpass</span><span class="s2">\&quot;,\&quot;method\&quot;:\&quot;autoprice\&quot;,\&quot;base\&quot;:\&quot;KMD\&quot;,\&quot;rel\&quot;:\&quot;BTC\&quot;,\&quot;margin\&quot;:0.0001}&quot;</span>
</pre></div>
</div>
<p>The userpass is sourced from the <code class="docutils literal"><span class="pre">dexscripts</span></code> folder, so that file has to be created in the <code class="docutils literal"><span class="pre">dexscripts</span></code> folder prior to sending a command. The userpass is there to prevent bad actors from issuing RPC commands. Marketmaker will not work without it set.
Each command to BarterDEX will need this userpass value as value of the <code class="docutils literal"><span class="pre">userpass</span></code> key in the JSON.
<code class="docutils literal"><span class="pre">127.0.0.1:7783</span></code> is the ip address and port where BarterDEX is listening for commands.</p>
Each command to BarterDEX will need this userpass value as value of the <code class="docutils literal"><span class="pre">userpass</span></code> key in the JSON.</p>
<p><code class="docutils literal"><span class="pre">127.0.0.1:7783</span></code> is the ip address and port where BarterDEX is listening for commands.</p>
<p>The json code in all the methods below is the data that is needed for each method described (mind the escape characters when using shell). For example:</p>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="nt">&quot;userpass&quot;</span><span class="p">:</span><span class="s2">&quot;$userpass&quot;</span><span class="p">,</span>
Expand All @@ -212,8 +216,26 @@ <h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to t
</div>
<div class="section" id="starting-marketmaker">
<h2>Starting marketmaker<a class="headerlink" href="#starting-marketmaker" title="Permalink to this headline"></a></h2>
<p>There are two different nodes in BarterDEX: a full relay node and a node that doesn’t relay. In the dexscripts folder, these are started by ./run or ./client, respectively. Normally, only Liquidity Providers will prefer a full relay node, as they can respond to incoming requests one hop sooner. Others will use ./client, since it doesn’t require as much bandwidth as a full relay node.</p>
<p>A full relay node is started with the following command:</p>
<p>There are two different nodes in BarterDEX: a full relay node and a node that doesn’t relay. In the <code class="docutils literal"><span class="pre">dexscripts</span></code> folder, these are started by <code class="docutils literal"><span class="pre">./run</span></code> or <code class="docutils literal"><span class="pre">./client</span></code>, respectively. Normally, only Liquidity Providers will prefer a full relay node, as they can respond to incoming requests one hop sooner. Others will use <code class="docutils literal"><span class="pre">./client</span></code>, since it doesn’t require as much bandwidth as a full relay node and can therefore be perfect for regular users, ie. traders on BarterDEX.</p>
<div class="section" id="startup-arguments">
<h3>Startup arguments<a class="headerlink" href="#startup-arguments" title="Permalink to this headline"></a></h3>
<p>A full relay node is started by running marketmaker with the following arguments string:</p>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="nt">&quot;gui&quot;</span><span class="p">:</span><span class="s2">&quot;&lt;name of gui&gt;&quot;</span><span class="p">,</span>
<span class="nt">&quot;profitmargin&quot;</span><span class="p">:</span><span class="mf">0.01</span><span class="p">,</span>
<span class="nt">&quot;userhome&quot;</span><span class="p">:</span><span class="s2">&quot;&lt;userhome + /&gt;&quot;</span><span class="p">,</span>
<span class="nt">&quot;passphrase&quot;</span><span class="p">:</span><span class="s2">&quot;&lt;passphrase&gt;&quot;</span><span class="p">,</span>
<span class="nt">&quot;coins&quot;</span><span class="p">:[</span><span class="s2">&quot;&lt;coins&gt;&quot;</span><span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">gui</span></code> is the codename for the GUI used to start marketmaker with. If you are the developer of a GUI, you need to define a codename for your GUI. Share this in the Komodo Platform slack and you will get paid for every trade a user makes using your GUI.</p>
<p><code class="docutils literal"><span class="pre">profitmargin</span></code> is the default profitmargin that this full relay node (or Liquidity Provider node) will use when placing orders in orderbooks using the <code class="docutils literal"><span class="pre">autoprice</span></code> method.</p>
</div>
<div class="section" id="new-or-private-network">
<h3>New or private network<a class="headerlink" href="#new-or-private-network" title="Permalink to this headline"></a></h3>
<p>In order to start a network other than the default network, you need to add 2 arguments to the marketmaker startup arguments. When initiating a new network, a full relay node must be used, and it has to define <code class="docutils literal"><span class="pre">&quot;netid&quot;:&lt;int</span> <span class="pre">netid&gt;</span></code> and <code class="docutils literal"><span class="pre">&quot;seednode&quot;:&quot;&lt;ipaddress&gt;&quot;</span></code> to the marketmaker startup arguments, where the netid is any integer higher than 0 but lower than 14420. The seednode is the ip address of the server being a full relay node.</p>
</div>
</div>
<div class="section" id="trade-commands">
<h2>Trade commands<a class="headerlink" href="#trade-commands" title="Permalink to this headline"></a></h2>
Expand Down

0 comments on commit d08bb82

Please sign in to comment.