diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml new file mode 100644 index 0000000..11de6f1 --- /dev/null +++ b/.github/workflows/docs-deploy.yml @@ -0,0 +1,35 @@ +name: Publish docs via GitHub Pages + +# Controls when the action will run. +on: + push: + branches: + - master + - main + paths: + - mkdocs.yml + - docs/** + - requirements-mkdocs.txt + pull_request: + branches: + - master + - main + paths: + - mkdocs.yml + - docs/** + - requirements-mkdocs.txt + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + name: Deploy docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.x + - run: pip install -r requirements-mkdocs.txt + - run: mkdocs gh-deploy --force diff --git a/.gitignore b/.gitignore index d6d6ece..0b888d9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,8 @@ testnet.json /build/_workspace/ /build/bin/ + +# Files generated by docs build +/MANIFEST +/manifest.json +/site \ No newline at end of file diff --git a/Makefile b/Makefile index ad84df6..313c238 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # with Go source code. If you know what GOPATH is then you probably # don't need to bother with make. -.PHONY: all test clean +.PHONY: all test clean mkdocs-serve GOBIN = ./build/bin GOGET = env GO111MODULE=on go get @@ -17,3 +17,6 @@ test: all clean: env GO111MODULE=on go clean -cache rm -fr build/_workspace/pkg/ $(GOBIN)/* + +mkdocs-serve: ## Serve generated documentation (during development) + build/mkdocs-serve.sh diff --git a/build/mkdocs-serve.sh b/build/mkdocs-serve.sh new file mode 100755 index 0000000..420a19a --- /dev/null +++ b/build/mkdocs-serve.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# This script installs requirements for and starts the live-reloading development server for MkDocs. +# MkDocs generates a static site from the markdown files in docs/. + +py_command=python +pip_command="${py_command} -m pip" + +setup_py_command() { + if [ -z $(which ${py_command}) ]; then + py_command=python3 + return + fi + py_command_major_version=$(${py_command} 2>&1 --version | cut -d' ' -f2 | head -c1) + if [ $py_command_major_version != 3 ]; then + py_command=python3 + fi +} +setup_py_command + +set -ex +${py_command} --version +${pip_command} --version +set +x + +${pip_command} install -r requirements-mkdocs.txt + +mkdocs serve \ No newline at end of file diff --git a/docs/PAYOUTS.md b/docs/PAYOUTS.md index be8e805..b09b0a5 100644 --- a/docs/PAYOUTS.md +++ b/docs/PAYOUTS.md @@ -1,3 +1,8 @@ +--- +hide: + - navigation # Hide navigation +--- + **First of all make sure your Redis instance and backups are configured properly http://redis.io/topics/persistence.** Keep in mind that pool maintains all balances in **Shannon**. diff --git a/docs/POLICIES.md b/docs/POLICIES.md index 7ba3f76..7201055 100644 --- a/docs/POLICIES.md +++ b/docs/POLICIES.md @@ -1,3 +1,8 @@ +--- +hide: + - navigation # Hide navigation +--- + # Enforcing Policies Pool policy server collecting several stats on per IP basis. There are two options: `iptables+ipset` or simple application level bans. Banning is disabled by default. diff --git a/docs/STRATUM.md b/docs/STRATUM.md index 4fa8bf0..40bcca1 100644 --- a/docs/STRATUM.md +++ b/docs/STRATUM.md @@ -1,3 +1,8 @@ +--- +hide: + - navigation # Hide navigation +--- + # Stratum Mining Protocol This is the description of stratum protocol used in this pool. diff --git a/docs/img/favicon.png b/docs/img/favicon.png new file mode 100644 index 0000000..6ed7397 Binary files /dev/null and b/docs/img/favicon.png differ diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..ae81a1a --- /dev/null +++ b/docs/index.md @@ -0,0 +1,16 @@ +--- +hide: + - navigation # Hide navigation +--- + +# core-pool + +## Features + +* Support for HTTP and Stratum mining +* Detailed block stats with luck percentage and full reward +* Failover geth instances: geth high availability built in +* Separate stats for workers: can highlight timed-out workers so miners can perform maintenance of rigs +* JSON-API for stats +* New vue based UI +* Supports Ethereum Classic, Mordor, Ethereum, Ropsten & Ubiq. diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..cd5601d --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,74 @@ +# Project information +site_name: CorePool Documentation +site_description: Documentation for CorePool +site_url: https://etclabscore.github.io/core-pool/ +site_author: CorePool Team + +# Repository +repo_name: etclabscore/core-pool +repo_url: https://github.com/etclabscore/core-pool +edit_uri: edit/master/docs/ + +# Copyright +copyright: 'Copyright © 2021 etclabscore/core-pool - All rights reserved' + +# Configuration +theme: + # https://github.com/squidfunk/mkdocs-material/tree/master/src + name: material + logo: img/favicon.png + favicon: img/favicon.png + language: en + + palette: + scheme: slate + primary: black + accent: green + + icon: + repo: fontawesome/brands/github + + # Don't include MkDocs' JavaScript + include_search_page: false + + features: + - navigation.tabs + - navigation.tabs.sticky + - navigation.expand + - navigation.sections + # - navigation.instant + +use_directory_urls: true + +plugins: + - search + - minify: + minify_html: true + - git-revision-date-localized: + type: timeago + +# Extensions +markdown_extensions: + - abbr + - admonition + - attr_list + - codehilite + - def_list + # - meta + - smarty + - toc: + permalink: true + - pymdownx.emoji + - pymdownx.superfences + - pymdownx.details + - pymdownx.magiclink: + repo_url_shortener: true + repo_url_shorthand: true + social_url_shorthand: true + +# Page tree +nav: + - Home: index.md + - Payouts: PAYOUTS.md + - Stratum: STRATUM.md + - Policies: POLICIES.md diff --git a/requirements-mkdocs.txt b/requirements-mkdocs.txt new file mode 100644 index 0000000..f0ede4c --- /dev/null +++ b/requirements-mkdocs.txt @@ -0,0 +1,28 @@ +Babel==2.9.0 +click==7.1.2 +future==0.18.2 +gitdb==4.0.5 +GitPython==3.1.12 +htmlmin==0.1.12 +Jinja2==2.11.2 +joblib==1.0.0 +jsmin==2.2.2 +livereload==2.6.3 +lunr==0.5.8 +Markdown==3.3.3 +MarkupSafe==1.1.1 +mkdocs==1.1.2 +mkdocs-git-revision-date-localized-plugin==0.8 +mkdocs-material==6.2.4 +mkdocs-material-extensions==1.0.1 +mkdocs-minify-plugin==0.3.0 +nltk==3.5 +Pygments==2.7.3 +pymdown-extensions==8.1 +pytz==2020.5 +PyYAML==5.3.1 +regex==2020.11.13 +six==1.15.0 +smmap==3.0.4 +tornado==6.1 +tqdm==4.56.0