Skip to content

Commit

Permalink
[skip ci] updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
czepluch authored and konradkonrad committed Sep 1, 2017
1 parent 42c5cd2 commit d254c84
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 30 deletions.
4 changes: 2 additions & 2 deletions docs/api_walkthrough.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Introduction
=============
Raiden has a Restful API with URL endpoints corresponding to actions that users can perform with their channels. The endpoints accept and return JSON encoded objects. The API URL path always contains the API version in order to differentiate queries to different API versions. All queries start with: ``/api/<version>/`` where ``<version>`` is an integer representing the current API version.

The steps necessary in order to participate in a Raiden Token Network, will be walked through in this guide. Some different scenarios such as joining an already existing token network, registering a new token network, together with opening, closing and settling channels, will be provided.
This section will walk through the steps necessary to participate in a Raiden Token Network. Some different scenarios such as joining an already existing token network, registering a new token network, together with opening, closing and settling channels, will be provided.

Before getting started with below guides, please see :doc:`Overview and Guide <overview_and_guide>`, to make sure that connection to Raiden is established.

Expand Down Expand Up @@ -108,7 +108,7 @@ with the payload::
"balance": 7331
}

To see if and when the counterparty deposited tokens, the channel can be queried for the corresponding events::
To see if and when the counterparty deposited tokens, the channel can be queried for the corresponding events. The ``from_block`` parameter in the request represents the block number to query from::

GET /api/1/events/channels/0x2a65aca4d5fc5b5c859090a6c34d164135398226?from_block=1337

Expand Down
7 changes: 6 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ Raiden Network Documentation v\ |version|

This is the documentation for v\ |version| of the `Raiden Network <http://raiden.network/>`_. You can find the source code in `our Github Repository <https://github.com/raiden-network/raiden>`_.

What is the Raiden Network?
---------------------------
The Raiden Network is an off-chain scaling solution for performing ERC20-compliant token transfers on the Ethereum blockchain. It is Ethereum's version of Bitcoin's Lightning Network, enabling near-instant, low-fee, scalable micropayments.


Contents
************

.. toctree::
:maxdepth: 2

overview_and_guide
rest_api
api_walkthrough
rest_api
what_is_the_dev_preview
webui_tutorial
Raiden Codebase Documentation <./_build/generated/modules>
20 changes: 10 additions & 10 deletions docs/overview_and_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ You will also need an Ethereum client that is connected to the Ropsten testnet.
.. _binary_releases:

(Optional) AppImage
**************************
~~~~~~~~~~~~~~~~~~~

For easier installation and portability, we create `AppImage <http://appimage.org/>`_ releases, that should work on most 64bit GNU/Linux distributions. For official releases, you will find the AppImage on the `github release page <https://github.com/raiden-network/raiden/releases>`_. AppImages are built from the main github repository, you will need to have ``make`` and ``docker`` installed.
For easier installation and portability, we create `AppImage <http://appimage.org/>`_ releases, that should work on most 64bit GNU/Linux distributions. For official releases, you will find the AppImage on the `GitHub release page <https://github.com/raiden-network/raiden/releases>`_.

Building it
~~~~~~~~~~~
**Building it**

AppImages are built from the main GitHub repository, you will need to have ``make`` and ``docker`` installed.

Calling::

Expand All @@ -66,8 +67,7 @@ artifact to ``dist/raiden--x86_64.AppImage``. If you want to build a specific (g

RAIDENVERSION=v1.0.0 make bundle

Using it
~~~~~~~~
**Using it**

The release artifact ``raiden--x86_64.AppImage`` is an executable that takes the same commandline flags as the main
``raiden`` script. See `AppImage Documentation <https://github.com/AppImage/AppImageKit/blob/appimagetool/master/README.md>`_ for advanced integration with your distribution.
Expand All @@ -80,13 +80,13 @@ Firing it up
Using geth
~~~~~~~~~~

Run the client and let it sync with the Ropsten testnet::
Run the Ethereum client and let it sync with the Ropsten testnet::

geth --testnet --fast --bootnodes "enode://20c9ad97c081d63397d7b685a412227a40e23c8bdc6688c6f37e97cfbc22d2b4d1db1510d8f61e6a8866ad7f0e17c02b14182d37ea7c3c8b9c2683aeb6b733a1@52.169.14.227:30303,enode://6ce05930c72abc632c58e2e4324f7c7ea478cec0ed4fa2528982cf34483094e9cbc9216e7aa349691242576d552a2a56aaeae426c5303ded677ce455ba1acd9d@13.84.180.240:30303"

Unless you already have an account you can also create one in the console by invoking ``personal.newAccount()``.

If problems arise for above method, please see `the Ropsen README <https://github.com/ethereum/ropsten>`_ for further instructions.
If problems arise for above method, please see `the Ropsten README <https://github.com/ethereum/ropsten>`_ for further instructions.

Then launch Raiden with the default testnet keystore path::

Expand All @@ -103,9 +103,9 @@ After syncing the chain, create an account on the Ropsten testnet by navigating

http://127.0.0.1:8180

After account creation, launch Raiden with the path of your keystore supplied and the RPC endpoint of the parity client (defaults show)::
After account creation, launch Raiden with the path of your keystore supplied::

raiden --keystore-path "~/.local/share/io.parity.ethereum/keys/test" --eth-rpc-endpoint "127.0.0.1:8545"
raiden --keystore-path ~/.local/share/io.parity.ethereum/keys/test"

Select the Ethereum account when prompted, and type in the account's password.

Expand Down
14 changes: 6 additions & 8 deletions docs/rest_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,14 @@ A channel object consists of a
- ``'opened'``: The channel is open and tokens are tradeable
- ``'closed'``: The channel has been closed by a participant
- ``'settled'``: The channel has been closed by a participant and also settled.

- ``'settle_timeout'``: The number of blocks that are required to be mined from the time that ``close()`` is called
until the channel can be settled with a call to ``settle()``.
- ``'settle_timeout'``: The number of blocks that are required to be mined from the time that ``close()`` is called until the channel can be settled with a call to ``settle()``.


Event Object
==============

Channels events are encoded as json objects with the event arguments as attributes
of the dictionary, with one difference. The ``event_type`` is also added for all events to easily distinguish between events.
of the dictionary, with one difference. The ``event_type`` and the ``block_number`` are also added for all events to easily distinguish between events.



Expand Down Expand Up @@ -123,8 +121,8 @@ And with a 201 response we also get the address as can be seen below::
Querying Information About Channels and Tokens
===============================================

Querying specific channel
--------------------------
Querying a specific channel
----------------------------

There are multiple ways to query information about your channels. The most direct, if you know the channel address, is to query the channel master resource endpoint ``/api/<version>/channels/<channel_address>`` with a ``GET`` request.

Expand All @@ -151,7 +149,7 @@ The other ways to query information about the channels is to navigate the docume
hierarchy of the API and find the channel address which will lead you to the master
resource as shown above.

Querying All Channels
Querying all channels
--------------------------

By making a ``GET`` request to ``/api/<version>/channels`` you can get a list of all non-settled channels.
Expand Down Expand Up @@ -227,7 +225,7 @@ Possible Responses
+------------------+---------------------------+


Querying All Partners for a Token
Querying all partners for a Token
-----------------------------------

By making a ``GET`` request to ``/api/<version>/tokens/<token_address>/partners`` you can get a list of all partners
Expand Down
14 changes: 9 additions & 5 deletions docs/webui_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@ Once Raiden and node.js has been installed, it is quite easy to install and star

This could be run automatically as part of installing Raiden, but to keep the run time of tests down, it's not.

With the web application installed, we can :ref:`fire up Raiden <running_raiden>`. Raiden can be started without the web application by providing the ``--no-web-ui`` flag.
With the web application installed, we can :ref:`fire up Raiden <running_raiden>`. Make sure, you add the CORS domain to the start parameters of your ethereum client::

geth <...other parameters...> --rpccorsdomain "http://localhost:5001"

Raiden can be started without the web application by providing the ``--no-web-ui`` flag.

Now all that is left to do is to navigate to `localhost:5001 <localhost:5001>`_ and interaction with Raiden through a web application can begin.


The landing page
------------------
The first thing that will meet the user is the landing page. The landing page is meant to give a short introduction to Raiden and link to some relevant documentation. Furthermore it is also meant to provide an overview of some interesting statistics about Raiden.
The first thing that will meet the user is the landing page. The landing page is meant to give a short introduction to Raiden and link to some relevant documentation.

Below is a screenshot of the landing page.

Expand All @@ -42,15 +46,15 @@ Tokens
----------
The ``Tokens`` view provides information about the registered token networks. Furthermore it also allows for automatically joining an existing token network along with registering a new token network.

The first thing to notice in this view is the list of tokens for which a token network exists. All tokens that have been registered in Raiden will show up in this list. If the user knows the name or the address of a token, it's very easy to search for it using the ``Filter`` bar. If the token the user searches for does not show up, it most likely means that it is not yet registered. Registering can however be done by pressing the ``Register New Token`` button and provide the token address. For each token in the list of tokens some information is provided. This information includes the ``Symbol`` of the token, the ``Address`` of the token, the ``Name`` of the token and the user's ``Balance`` of a specific token. It's easy to sort the tokens, so that only tokens that a user actually holds, show up in the beginning of the list. This is done by simply pressing the name of the value desired for sorting.
The first thing to notice in this view is the list of tokens for which a token network exists. All tokens that have been registered in Raiden will show up in this list. If the user knows the name or the address of a token, it's very easy to search for it using the ``Filter`` bar. If the token the user searches for does not show up, it most likely means that it is not yet registered. Registering can however be done by pressing the ``Register New Token`` button and provide the token address. For each token in the list of tokens some information is provided. This information includes the ``Symbol`` of the token, the ``Address`` of the token, the ``Name`` of the token and the user's ``Balance`` of a specific token. It's easy to sort the tokens, so that only tokens that a user actually holds, show up in the beginning of the list. This is done simply by pressing the name of the value desired for sorting.

In the ``Actions`` column it is possible to open an actions menu for each token network. This menu provides the option to ``Join Network``. A pop up will then appear where the user can choose how many tokens to automatically join the token network with. See :ref:`connect <connect-to-network>` for more details on how this works.

Should it at some point in time be desired to entirely leave a token network. The ``Leave Network`` action menu point allows you to do so. This will automatically close and settle all open channels within a specified token network. For more information on how this works, please see :ref:`leave <leave-network>`.

The most interesting feature in the ``Actions`` menu is the ``Tranfer`` point. This will allow the user to choose an address to send tokens to that the user is not directly connected to. This is done by mediating transfers through nodes that are connected with each other.
The most interesting feature in the ``Actions`` menu is the ``Tranfer`` action. This will allow the user to choose an address to send tokens to that the user is not directly connected to. This is done by mediating transfers through nodes that are connected with each other.

The last point the ``Actions`` menu is ``Watch Events``. This will simply open tab within the ``Tokens`` view and allow the user to see all channels created and deleted for the specific token.
The last point in the ``Actions`` menu is ``Watch Events``. This will simply open tab within the ``Tokens`` view and allow the user to see all channels created and deleted for the specific token.

In this view it is also possible to ``Swap Tokens``. This is done by pressing the ``Swap Tokens`` button and then filling in the form. For more information on what a token swap is, please see :ref:`token swaps <token-swaps>`.

Expand Down
8 changes: 4 additions & 4 deletions docs/what_is_the_dev_preview.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
What is the Raiden Developer Preview
************************************

*And what is it not*
*And what it is not*


.. toctree::
Expand All @@ -20,13 +20,13 @@ Raiden API and to get an idea of the full potential of Raiden once all issues ar
Below is a listing of things that are included in the Developer Preview together with things that are in the roadmap, but are not yet implemented.


The Developer Preview includes
The Developer Preview supports
-------------------------------

- Opening, closing and settling of payment channels.
- Direct and mediated (multi hop) transfers.
- Automatically joining a token network and connecting to peers.
- A :doc:`REST API <rest_api>` with endpoints for all functionality.
- A :doc:`REST API <rest_api>` with endpoints for all functionalities.
- Possibility to create token networks for all ERC20 tokens.
- Restartability in case of a proper shutdown of the Raiden node.
- :ref:`ERC20 token swaps <token-swaps>`.
Expand All @@ -45,4 +45,4 @@ Other restrictions
------------------
Currently all nodes participating in a transfer need to be online in order for a transfer to be carried out. This means that users must run a full Raiden node to receive transfers too. The Developer Preview does not offer a Raiden light client, it is however a goal to `implement a light client <https://github.com/raiden-network/raiden/issues/114>`_ in the future.

The transportation layer used in the Developer Preview is not very sophisticated and thus it is storing the IP addresses of all nodes participating in the `Endpoint Registry <https://github.com/raiden-network/raiden/blob/master/raiden/smart_contracts/EndpointRegistry.sol>`_ smart contract. In the future it is planned to use something like Whisper for the transportation layer.
The transport layer used in the Developer Preview is not very sophisticated and thus it is storing the IP addresses of all nodes participating in the `Endpoint Registry <https://github.com/raiden-network/raiden/blob/master/raiden/smart_contracts/EndpointRegistry.sol>`_ smart contract. In the future it is planned to use something like Whisper for the transportation layer.

0 comments on commit d254c84

Please sign in to comment.