Skip to content

Commit

Permalink
Integrate TzStats and sphinx documentation (#127)
Browse files Browse the repository at this point in the history
* Add Sphnix documentation and edit travis CI to build the doc
* Updated documentation content
* Update .travis.yml
* Added lib for spellchecking
* Add tzstats implementation [tested] and fix documentation
* Remove tzscan class and prepare tzstats class for further development
* Remove baker from delegators' list
  • Loading branch information
amzid authored and jdsika committed Nov 2, 2019
1 parent bb76917 commit c7a9255
Show file tree
Hide file tree
Showing 26 changed files with 612 additions and 443 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,6 @@ logs/
reports/
*/*/__pycache__/
*/__pycache__/
email.ini
email.ini
logs/
docs/build/
42 changes: 39 additions & 3 deletions .travis.yml
@@ -1,9 +1,45 @@
# Use distribution Ubuntu 18.04 Bionic
dist: bionic

# Travis CI does install a virtual environment automatically for python 3.6
language: python

python:
- "3.6"
- "3.6"

# command to install dependencies
install:
- pip install -r requirements.txt
- sudo apt-get update -y
- sudo apt-get install libenchant1c2a -y
# Requirements for the software
- pip install -r requirements.txt
# Requirements to deploy the documentation
- pip install sphinx_rtd_theme
- pip install sphinxcontrib.spelling
- pip install --upgrade recommonmark

# Addons necessary for documentation.
addons:
apt:
packages:
- python3-sphinx

# command to run tests
before_script: export PYTHONPATH=$PYTHONPATH:$(pwd)
script: python3 -m unittest discover -s src
script:
- python3 -m unittest discover -s src
#- make spelling
#- make linkcheck
- cd docs
- sphinx-build -b html ./ ./build/
- touch build/.nojekyll

deploy:
provider: pages
skip_cleanup: true
local_dir: docs/build
keep-history: true
target_branch: gh-pages
github_token: $GITHUB_TOKEN
on:
branch: master
20 changes: 20 additions & 0 deletions docs/Makefile
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = TezosRewardDistributor
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
157 changes: 157 additions & 0 deletions docs/conf.py
@@ -0,0 +1,157 @@
# -*- coding: utf-8 -*-
#
# Tezos Reward Distributor documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 19 20:34:36 2019.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['recommonmark']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'markdown',
'.md': 'markdown',
}

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Tezos Reward Distributor'
copyright = u'2019, habanoz'
author = u'habanoz'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u'1.0'
# The full version, including alpha/beta/rc tags.
release = u'6.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars

# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'TezosRewardDistributordoc'

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
'papersize': 'a4paper',

# The font size ('10pt', '11pt' or '12pt').
#
'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
'preamble': '',

# Latex figure (float) alignment
#
'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'TezosRewardDistributor.tex', u'Tezos Reward Distributor Documentation',
u'habanoz', 'manual'),
]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'tezosrewarddistributor', u'Tezos Reward Distributor Documentation',
[author], 1)
]

# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'TezosRewardDistributor', u'Tezos Reward Distributor Documentation',
author, 'TezosRewardDistributor', 'One line description of project.',
'Miscellaneous'),
]
35 changes: 35 additions & 0 deletions docs/configuration.rst
@@ -0,0 +1,35 @@

How to configure Tezos Reward Distributor?
=====================================================

Baker Configuration:
------------------------

Each baker has its own configuration and policy. A payment system should
be flexible enough to cover needs of bakers. The application uses a yaml
file for loading baker specific configurations.

Configuration tool can be used to create baking configuration file
interactively. Also an example configuration file is present under
examples directory. For more information on configuration details, please
see our wiki `page <https://github.com/habanoz/tezos-reward-distributor/wiki/Configuration>`_.

TRD is designed to work as a linux service. It expects use of tezos
signer for encrypted payment accounts. Unencrypted payment accounts can
be used without tezos signer. If a payment account is encrypted and not
configured to be signed by tezos signer, TRD will freeze. For more
information on payment addresses please refer to our wiki `page <https://github.com/habanoz/tezos-reward-distributor/wiki/Payment-Address>`_.

Email Setup
------------------------

Get emails for payment reports at each cycle. Fill email.ini file with
your email details to receive payment emails.

Fee Setup
------------------------

fee.ini file contains details about transaction fees. Currently the fee
value specified under DEFAULT domain is used as fee amount. It is in
mutez.

6 changes: 6 additions & 0 deletions docs/contributers.rst
@@ -0,0 +1,6 @@
For developers
=====================================================

Please refer to contributions guide_ on wiki pages.

.. _guide : https://github.com/habanoz/tezos-reward-distributor/wiki/How-to-Contribute
53 changes: 53 additions & 0 deletions docs/index.rst
@@ -0,0 +1,53 @@
Tezos Reward Distributor (Run & Forget) |Build Status|
======================================================

DISCLAIMER : TEZOS REWARD DISTRIBUTOR IS PROVIDED AS IS. IT IS UNDER
CONSTANT DEVELOPMENT. EVENT THOUGH IT IS WELL TESTED, PLEASE USE WITH
CARE. ALWAYS MAKE A PRE-RUN IN DRY MODE BEFORE MAKING ACTUAL PAYMENTS.
IF YOU WANT TO RUN IN SERVICE MODE DO IT AFTER YOU ARE CONFIDENT WITH
THE APPLICATION. IN SERVICE MODE DO NOT UPDATE OFTEN.

What is Tezos Reward Distributor?
------------------------------------------------

TRD is a software for distributing baking rewards with delegators. This
is not a script but a full scale application which can run in the
background all the time. It can track cycles and make payments. It does
not have to be used as a service, It can also be used interactively.

TRD supports complex payments, pays in batches, provides two back ends
for calculations: rpc and tzstats. It was developed and tested extensively by
the community. For more information, please check following Medium article_
and the source code which can be found in the following Github_ repo.

.. _article : https://medium.com/@huseyinabanox/tezos-reward-distributor-e6588c4d27e7

.. _Github : https://github.com/habanoz/tezos-reward-distributor

.. toctree::
:maxdepth: 2
:caption: Tezos Reward Distributor:

installation
configuration
run
contributers

Funding
------------------------

TRD is an open source project and will stay like this. It is not funded
by any organization. A grant request is rejected by Tezos Foundation.
However, I will try to continue to enhance the software and support the
community.

TRD Art Work
------------------------

This Github Repo_ contains logo images. If you are
using TRD and want to let everybody know about it, feel free to place
them in your website.

.. |Build Status| image:: https://travis-ci.com/habanoz/tezos-reward-distributor.svg?branch=development
:target: https://travis-ci.com/habanoz/tezos-reward-distributor
.. _Repo: https://github.com/habanoz/trd-art
32 changes: 32 additions & 0 deletions docs/installation.rst
@@ -0,0 +1,32 @@
How to get and install Tezos Reward Distributor?
=====================================================

Requirements and Setup
------------------------


Python 3 is required. You can use following commands to install.

::

sudo apt-get update
sudo apt-get -y install python3-pip

Download the application repository using git clone:

::

git clone https://github.com/habanoz/tezos-reward-distributor

To install required modules, use pip with requirements.txt provided.

::

cd tezos-reward-distributor
pip3 install -r requirements.txt

Regulary check and upgrade to the latest available version:

::

git pull

0 comments on commit c7a9255

Please sign in to comment.