Skip to content

Commit

Permalink
Make install and request doc for API resources
Browse files Browse the repository at this point in the history
  • Loading branch information
perdy committed Oct 15, 2017
1 parent 9d581f9 commit 708cfcf
Show file tree
Hide file tree
Showing 15 changed files with 680 additions and 39 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ ENV/

# IDEA
.idea/

# Barrenero services
barrenero-*/
6 changes: 3 additions & 3 deletions Barrenero.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
{
"name": "Wallet",
"request": {
"url": "http://{{host}}/api/v1/status",
"url": "http://{{host}}/api/v1/wallet",
"method": "GET",
"header": [
{
Expand All @@ -240,14 +240,14 @@
}
]
},
"description": "Wallet status"
"description": "Wallet status, including balance for each token and last transactions."
},
"response": []
},
{
"name": "Storj",
"request": {
"url": "http://{{host}}/api/v1/status",
"url": "http://{{host}}/api/v1/storj",
"method": "GET",
"header": [
{
Expand Down
7 changes: 4 additions & 3 deletions doc/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

Miner
=====
API
===

.. toctree::
:maxdepth: 1
:maxdepth: 2
:caption: Contents

Installation<installation.rst>
Configuration<configuration.rst>
API Resources<resources.rst>

Overview
--------
Expand Down
34 changes: 12 additions & 22 deletions doc/source/api/resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,16 @@ Resources

These are the resources exposed by Barrenero API.

Register User
-------------
.. toctree::
:maxdepth: 1
:caption: Resources

Register User<resources/register_user.rst>
Login User<resources/login_user.rst>
Barrenero Status<resources/status.rst>
Restart Service<resources/restart.rst>
Ether Miner Status<resources/ether_status.rst>
Ether Miner Nanopool<resources/ether_nanopool.rst>
Storj Miner Status<resources/storj.rst>
Wallet<resources/wallet.rst>

Login User
----------

Barrenero Status
----------------

Restart Service
---------------

Ether Miner Status
------------------

Ether Miner Nanopool
--------------------

Storj Miner Status
------------------

Ethereum Wallet
---------------
67 changes: 67 additions & 0 deletions doc/source/api/resources/ether_nanopool.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
..
Barrenero, a set of services and tools for effective mining cryptocurrencies.
Copyright (C) 2017 José Antonio Perdiguero López
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

Ether Miner Nanopool
====================

Retrieve Ether nanopool status.

Request
-------

URL
^^^

`/api/v1/ether/nanopool`

Headers
^^^^^^^

Authorization
Token <auth_token>

Response
--------

.. code:: javascript
{
"balance": {
"confirmed": float,
"unconfirmed": float
},
"hashrate": {
"current": float,
"one_hour": float,
"three_hours": float,
"six_hours": float,
"twelve_hours": float,
"twenty_four_hours": float
},
"workers": [
{
"id": string,
"hashrate": float
}
],
"last_payment": {
"date": string,
"hash": string,
"value": float,
"confirmed": bool
}
}
50 changes: 50 additions & 0 deletions doc/source/api/resources/ether_status.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
..
Barrenero, a set of services and tools for effective mining cryptocurrencies.
Copyright (C) 2017 José Antonio Perdiguero López
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

Ether Miner Status
==================

Retrieve Ether miner status.

Request
-------

URL
^^^

`/api/v1/ether/status`

Headers
^^^^^^^

Authorization
Token <auth_token>

Response
--------

.. code:: javascript
{
"status": "active",
"hashrate": [
{
"graphic_card": int,
"hashrate": float
}
]
}
50 changes: 50 additions & 0 deletions doc/source/api/resources/login_user.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
..
Barrenero, a set of services and tools for effective mining cryptocurrencies.
Copyright (C) 2017 José Antonio Perdiguero López
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

Login User
==========

Retrieve user token and user given username and password.

Request
-------

URL
^^^

`/api/v1/auth/user`

Parameters
^^^^^^^^^^

Username
Name to register user

Password
Password to register user

Response
--------

.. code:: javascript
{
"username": string,
"account": string,
"is_api_superuser": bool,
"token": string
}
56 changes: 56 additions & 0 deletions doc/source/api/resources/register_user.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
..
Barrenero, a set of services and tools for effective mining cryptocurrencies.
Copyright (C) 2017 José Antonio Perdiguero López
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

Register User
=============

Register a new user providing username, password, account and API password.

Request
-------

URL
^^^

`/api/v1/auth/register`

Parameters
^^^^^^^^^^

Username
Name to register user

Password
Password to register user

Account
Ethereum wallet account, starting with *0x*.

API Password
Password used to identify as a API superuser, that gives access to methods such restarting services.

Response
--------

.. code:: javascript
{
"username": string,
"account": string,
"is_api_superuser": bool,
"token": string
}
51 changes: 51 additions & 0 deletions doc/source/api/resources/restart.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
..
Barrenero, a set of services and tools for effective mining cryptocurrencies.
Copyright (C) 2017 José Antonio Perdiguero López
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

Restart Service
===============

Restart a Barrenero's Systemd service giving the name.

Request
-------

URL
^^^

`/api/v1/restart`

Headers
^^^^^^^

Authorization
Token <auth_token>

Parameters
^^^^^^^^^^

name
Systemd service name to restart

Response
--------

.. code:: javascript
{
"name": "barrenero_miner_ether",
"status": "restarted"
}

0 comments on commit 708cfcf

Please sign in to comment.