Skip to content

Commit

Permalink
Merge pull request #1 from absolute-community/v1.3
Browse files Browse the repository at this point in the history
V1.3
  • Loading branch information
CryptoCentric authored May 13, 2021
2 parents d0b53d9 + e0a4755 commit f26c55f
Show file tree
Hide file tree
Showing 25 changed files with 543 additions and 666 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

105 changes: 99 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,102 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# JetBrains IDE data
.idea
.idea/*

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.pyc

*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
.cache/
sentinel
build/
dist/
database/*.db
local_settings.py

# Flask instance folder
instance/

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# OS specific and other
.DS_Store
docs/.DS_Store
.keep

# ignore everything in ignore/
ignore/

# SQLite databases
database/*.db
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ python:
- "2.7"
- "3.5"
- "3.6"
before_install:
- chmod +x share/travis_setup.sh


install:
- pip install -r requirements.txt
Expand All @@ -15,6 +14,5 @@ script:
- py.test -svv test/unit/

# style guide check
- find ./lib ./test ./bin -name \*.py -exec pycodestyle --show-source --ignore=E501,E402,E722 {} +


- find ./lib ./test ./bin -name \*.py -exec pycodestyle --show-source --ignore=E501,E402,E722,E129,W503,W504 {} +

25 changes: 12 additions & 13 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
MIT License
The MIT License (MIT)

Copyright (c) 2018 absolutecrypto

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
72 changes: 54 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
# Absolute Sentinel V1.2
# Absolute Sentinel V1.3

An all-powerful toolset for Absolute.

Sentinel is an autonomous agent for persisting, processing and automating Absolute V12.2 governance objects and tasks, and for expanded functions in the upcoming Absolute releases.
> An automated governance helper for Absolute Masternodes.
Sentinel is implemented as a Python application that binds to a local version 12.2 absoluted instance on each Absolute Masternode.
Sentinel is an autonomous agent for persisting, processing and automating Absolute governance objects and tasks. It is a Python application which runs alongside the AbsoluteCore instance on each Absolute Masternode.

This guide covers installing Sentinel onto an existing 12.1 Masternode in Ubuntu 14.04 / 16.04.
## Table of Contents
- [Install](#install)
- [Dependencies](#dependencies)
- [Usage](#usage)
- [Configuration](#configuration)
- [Troubleshooting](#troubleshooting)
- [Maintainer](#maintainer)
- [Contributing](#contributing)
- [License](#license)

## Installation
## Install

### 1. Install Prerequisites
These instructions cover installing Sentinel on Ubuntu 16.04 / 18.04.

### Dependencies

Make sure Python version 2.7.x or above is installed:

Expand All @@ -21,27 +31,35 @@ Update system packages and ensure virtualenv is installed:
$ sudo apt-get update
$ sudo apt-get -y install python-virtualenv

### 2. Install Sentinel
Make sure the local AbsoluteCore daemon running is at least version 12.1 (120100)

$ absolute-cli getinfo | grep version

### Install Sentinel

Clone the Sentinel repo and install Python dependencies.

$ git clone https://github.com/absolute-community/sentinel.git && cd sentinel
$ virtualenv ./venv
$ ./venv/bin/pip install -r requirements.txt

### 3. Set up Cron
## Usage

Sentinel is "used" as a script called from cron every minute.

### Set up Cron

Set up a crontab entry to call Sentinel every minute:

$ crontab -e

In the crontab editor, add the lines below, replacing '/home/YOURUSERNAME/sentinel' to the path where you cloned sentinel to:
In the crontab editor, add the lines below, replacing '/path/to/sentinel' to the path where you cloned sentinel to:

* * * * * cd /home/YOURUSERNAME/sentinel && ./venv/bin/python bin/sentinel.py >/dev/null 2>&1
* * * * * cd /path/to/sentinel && ./venv/bin/python bin/sentinel.py >/dev/null 2>&1

### 4. Test the Configuration
### Test Configuration

Test the config by runnings all tests from the sentinel folder you cloned into
Test the config by running tests:

$ ./venv/bin/py.test ./test

Expand All @@ -53,18 +71,36 @@ An alternative (non-default) path to the `absolute.conf` file can be specified i

absolute_conf=/path/to/absolute.conf

## Building

Install pyinstaller `pip install pyinstaller`

Generate output EXE/ELF: `pyinstaller --onefile --paths=lib/ main.py`

## Troubleshooting

To view debug output, set the `SENTINEL_DEBUG` environment variable to anything non-zero, then run the script manually:

$ SENTINEL_DEBUG=1 ./venv/bin/python bin/sentinel.py

### License
## Maintainer

Many thanks to [@nmarley](https://github.com/nmarley)

## Contributing



Specifically:

* [Contributor Workflow](https://github.com/dashpay/dash/blob/master/CONTRIBUTING.md#contributor-workflow)

To contribute a patch, the workflow is as follows:

* Fork repository
* Create topic branch
* Commit patches

In general commits should be atomic and diffs should be easy to read. For this reason do not mix any formatting fixes or code moves with actual code changes.

Commit messages should be verbose by default, consisting of a short subject line (50 chars max), a blank line and detailed explanatory text as separate paragraph(s); unless the title alone is self-explanatory (like "Corrected typo in main.cpp") then a single title line is sufficient. Commit messages should be helpful to people reading your code in the future, so explain the reasoning for your decisions. Further explanation [here](http://chris.beams.io/posts/git-commit/).

## License

Released under the MIT license, under the same terms as Absolute itself. See [LICENSE](LICENSE) for more info.
Released under the MIT license, under the same terms as AbsoluteCore itself. See [LICENSE](LICENSE) for more info.
2 changes: 1 addition & 1 deletion bin/dbtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib')))
import config
from models import Superblock, Proposal, GovernanceObject, Setting, Signal, Vote, Outcome, Watchdog
from models import Superblock, Proposal, GovernanceObject, Setting, Signal, Vote, Outcome
from models import VoteSignals, VoteOutcomes
from peewee import PeeweeException # , OperationalError, IntegrityError
from absoluted import AbsoluteDaemon
Expand Down
Loading

0 comments on commit f26c55f

Please sign in to comment.