Browse Source

Merge pull request #3 from patchkez/move_dirs

directories magic
revert-24-test_rpcbind_to_assetname
Mihail «Kolo» Fedorov 7 years ago
committed by GitHub
parent
commit
57d08f1032
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 116
      README.md
  2. 0
      dragonriders/.gitignore
  3. 84
      dragonriders/README.md
  4. 0
      dragonriders/dokomodo/__init__.py
  5. 0
      dragonriders/dokomodo/cli.py
  6. 0
      dragonriders/dokomodo/templates/assetchains.j2
  7. 0
      dragonriders/dokomodo/templates/docker-compose-template.conf.j2
  8. 0
      dragonriders/dokomodo/yaml/config.ini
  9. 0
      dragonriders/dokomodo/yaml/data.yaml
  10. 0
      dragonriders/requirements.txt
  11. 0
      dragonriders/setup.py
  12. 2
      kolo/README.md
  13. 0
      kolo/config.sh
  14. 0
      kolo/do.sh
  15. 0
      kolo/do/bitchips.sh
  16. 0
      kolo/do/example.sh
  17. 0
      kolo/do/pony.art

116
README.md

@ -1,84 +1,32 @@
# DOkomodo - swiss army knife for Notary Nodes
Current komodo/iguana management scripts are not ideal and this is idea how to replace
existing komodo/iguana scripts with universal framework. Python [Click](http://click.pocoo.org)
framework was used which is ideal for creating CLI applications. Main idea of Click is that your
functions will become excutable as commands.
Features of DOkomodo:
- single data file in yaml format (easy to edit), sections for prod and dev environments - all data
like list of assetchains and their ports will come here.
- repeating functions like e.g. loading list of assetchains do not have to be written again and again
- data file loaded only once and data accessed via instance attributes
- configuration in config.ini file allows you to say for which coins mining is enabled, you can disable
minining completely or you can enable mining on randomly selected assetchains
- currently only 2 commands available
## Installation steps
### Enable python3 virtualenv
Virtualenv is directory which contains all python packages you need for your project.
Install virtualenv on Centos (as root user):
```
# yum install python34 python-pip
```
Install virtualenv on Ubuntu (as root):
```
# apt-get install python-pip
```
Now install virtualenv package:
```
# pip install -U virtualenv
```
Create our virtualenv
```
cd ~/venv_projects
virtualenv -p python3 komodotools_venv
```
This is how we activate our virtualenvironment. You can deactivate it with `deactivate` command:
```
source ~/venv_projects/komodotools_venv/bin/activate
```
### Clone this repository
Make sure you have activated your virtualenv before this step.
```
cd ~/git_projects/
git clone <this_repo>.git && cd komodotools
pip install -Ur requirements.txt
pip install --editable .
```
requirements.txt file contains list of all python packages we need for this project. All python packages will be installed into virtualenv folder you created. They won't collide with your system python packages.
## How-to use it
Once your virtualenv is activated, type `dokomodo`:
```
$ dokomodo
Usage: dokomodo [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
assetchains Replacement for assetchains script
generate_docker_compose Generates docker-compose file with all assetchains
```
Then you can continue specify subcommands:
```
$ dokomodo assetchains --help
Usage: dokomodo assetchains [OPTIONS]
Options:
-b, --branch [development|production]
[required]
--help Show this message and exit.
```
## Komodotools repository
Purpose of this repository is to collect scripts/tools from Notary Nodes operators.
We would like to get rid of scripts in [komodo](https://github.com/jl777/komodo) and [iguana](https://github.com/jl777/SuperNET) repositories. These supposed to serve as examples in the past.
Because we did not decide what the best management tooling is, we will keep different ideas separated in directories until we fix problems which will converge to common tools.
## Contribution
- normal Github workflow is followed (fork this repo, create branch, make changes and push back to your repo, create PR, review, merge, repeat)
- if you see similar script to one which exists in repo, try to implement your changes against it
- each directory must contain README.md file with description how to install/use your scripts
- update this README.md and add brief description what your script/tool does
- try to keep only one version of file which would work in test and prod environments
- once your scripts are merged into this repository, refer to it and push all updates here
- try to separate data/configs from code, if the data/configs will change, your scripts should still work without rewriting them
## Directories content
### kolo
It was Kolo's idea to create this repository and here is his concept how it should work.
### dragonriders
- dokomodo - script written in Python [Click](http://click.pocoo.org) framework.
- write funtcions which will become commands
- supports dev and prod environments
- assetchains data stored in yaml data file and ini config for configuration (you can enable mining for specific chains)
- there is Config Class which takes care of parsing config/data files so no need to do it in you functions
- many other features supported by Click framework
### a-team
- complete step-by-step guide with bash installation scripts
## Contacts
Ideas can be discussed in [#notarynode](https://komodo-platform.slack.com) Slack channel, but please all code proposals discuss via PRs on Github.

0
.gitignore → dragonriders/.gitignore

84
dragonriders/README.md

@ -0,0 +1,84 @@
# DOkomodo - swiss army knife for Notary Nodes
Current komodo/iguana management scripts are not ideal and this is idea how to replace
existing komodo/iguana scripts with universal framework. Python [Click](http://click.pocoo.org)
framework was used which is ideal for creating CLI applications. Main idea of Click is that your
functions will become excutable as commands.
Features of DOkomodo:
- single data file in yaml format (easy to edit), sections for prod and dev environments - all data
like list of assetchains and their ports will come here.
- repeating functions like e.g. loading list of assetchains do not have to be written again and again
- data file loaded only once and data accessed via instance attributes
- configuration in config.ini file allows you to say for which coins mining is enabled, you can disable
minining completely or you can enable mining on randomly selected assetchains
- currently only 2 commands available
## Installation steps
### Enable python3 virtualenv
Virtualenv is directory which contains all python packages you need for your project.
Install virtualenv on Centos (as root user):
```
# yum install python34 python-pip
```
Install virtualenv on Ubuntu (as root):
```
# apt-get install python-pip
```
Now install virtualenv package:
```
# pip install -U virtualenv
```
Create our virtualenv
```
cd ~/venv_projects
virtualenv -p python3 komodotools_venv
```
This is how we activate our virtualenvironment. You can deactivate it with `deactivate` command:
```
source ~/venv_projects/komodotools_venv/bin/activate
```
### Clone this repository
Make sure you have activated your virtualenv before this step.
```
cd ~/git_projects/
git clone <this_repo>.git && cd komodotools
pip install -Ur requirements.txt
pip install --editable .
```
requirements.txt file contains list of all python packages we need for this project. All python packages will be installed into virtualenv folder you created. They won't collide with your system python packages.
## How-to use it
Once your virtualenv is activated, type `dokomodo`:
```
$ dokomodo
Usage: dokomodo [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
assetchains Replacement for assetchains script
generate_docker_compose Generates docker-compose file with all assetchains
```
Then you can continue specify subcommands:
```
$ dokomodo assetchains --help
Usage: dokomodo assetchains [OPTIONS]
Options:
-b, --branch [development|production]
[required]
--help Show this message and exit.
```

0
dokomodo/__init__.py → dragonriders/dokomodo/__init__.py

0
dokomodo/cli.py → dragonriders/dokomodo/cli.py

0
dokomodo/templates/assetchains.j2 → dragonriders/dokomodo/templates/assetchains.j2

0
dokomodo/templates/docker-compose-template.conf.j2 → dragonriders/dokomodo/templates/docker-compose-template.conf.j2

0
dokomodo/yaml/config.ini → dragonriders/dokomodo/yaml/config.ini

0
dokomodo/yaml/data.yaml → dragonriders/dokomodo/yaml/data.yaml

0
requirements.txt → dragonriders/requirements.txt

0
setup.py → dragonriders/setup.py

2
kolo/README.md

@ -0,0 +1,2 @@
## Do script - original idea
This was initial idea of Kolo about how he would like to manage Notary Nodes. There would be one central command which would fire another commands.

0
config.sh → kolo/config.sh

0
do.sh → kolo/do.sh

0
do/bitchips.sh → kolo/do/bitchips.sh

0
do/example.sh → kolo/do/example.sh

0
do/pony.art → kolo/do/pony.art

Loading…
Cancel
Save