Installing MINT

Install Dependencies

Note: Dependencies must be installed as root/sudo
1
apt-get install libffi-dev libssl-dev python-dev python3-pip
2
pip3 install virtualenv
Copied!
Note: virtualenv is a best practice for python, but installation can also be on a user/global level.

Install Databases

Note: Databases must be installed as root/sudo
MINT uses a local SQLite database which requires MySQL setup (running a MySQL server instance is not required). Assuming a Ubuntu 16.04. or later operating system, install:
1
apt-get install libmysqlclient-dev
Copied!

Install bos-mint

Note: bos-mint should be installed as user
You can either install bos-mint via pypi / pip3 (production installation) or via git clone (debug installation). For production use install bos-auto via pip3 is recommended, but the Git master branch is always the latest release as well, making both installations equivalent.
1
cd ~
2
mkdir bos-mint
3
cd bos-mint
4
# create virtual environment
5
virtualenv -p python3 env
6
# activate environment
7
source env/bin/activate
8
# install bos-mint into virtual environment
9
pip3 install bos-mint
Copied!
For debug use, checkout from GitHub (master branch) and install dependencies manually:
1
cd ~
2
# checkout from github
3
git checkout https://github.com/peerplays-network/bos-mint
4
cd bos-mint
5
# create virtual environment
6
virtualenv -p python3 env
7
# activate environment
8
source env/bin/activate
9
# install dependencies
10
pip3 install -r requirements.txt
Copied!
BOS MINT is supposed to run in the virtual environment. Either activate it beforehand like shown above or run it directly in the env/bin folder.

Upgrading bos-mint

Note: bos-mint should be upgraded as user
For production installation, upgrade to the latest version - including all dependencies run:
1
pip3 install --upgrade bos-mint
Copied!
For debug installation, pull latest master branch and upgrade dependencies manually:
1
git pull
2
pip3 install -r requirements.txt --upgrade
Copied!

Modify Configuration

Next step is to configure bos-auto.
1
# basic mint configuration file
2
wget https://raw.githubusercontent.com/peerplays-network/bos-mint/master/config-example.yaml
3
mv config-example.yaml config-bos-mint.yaml
4
# modify config-bos-mint.yaml (add your own peerplays node and secret key)
Copied!
Default configuration only requires the following:
1
# see bos_mint/config-defaults.yaml for explanation and all possible override values
2
secret_key: # enter some random string
3
allowed_assets:
4
- BTF
5
connection:
6
use: beatrice
7
beatrice:
8
node:
9
- # enter your node
Copied!
Possible override values are :
1
debug: False
2
project_name: MINT
3
project_sub_name: The BOS Manual Intervention Module
4
secret_key: # enter any random string
5
sql_database: "sqlite:///{cwd}/bookied-local.db"
6
connection:
7
use: # enter your desired chain
8
beatrice:
9
node:
10
- # enter your node
11
nobroadcast: False
12
num_retries: 1
13
notifications:
14
accountLessThanCoreInfo: 1000
15
accountLessThanCoreWarning: 200
16
allowed_assets:
17
- BTF
18
- BTC
19
- PPY
20
- BTCTEST
21
- TEST
22
allowed_transitions:
23
EventStatus:
24
create:
25
- upcoming
26
upcoming:
27
- in_progress
28
- finished
29
- frozen
30
- canceled
31
in_progress:
32
- finished
33
- frozen
34
- canceled
35
finished:
36
- canceled
37
frozen:
38
- upcoming
39
- in_progress
40
- frozen
41
- canceled
42
- finished
43
BettingMarketGroupStatus:
44
create:
45
- upcoming
46
upcoming:
47
- closed
48
- canceled
49
- in_play
50
- frozen
51
in_play:
52
- frozen
53
- closed
54
- canceled
55
frozen:
56
- closed
57
- canceled
58
- in_play
59
- upcoming
60
closed:
61
- graded
62
- canceled
63
graded:
64
- re_grading
65
- settled
66
- canceled
67
re_grading:
68
- graded
69
- canceled
70
BettingMarketStatus:
71
create:
72
- unresolved
73
unresolved:
74
- win
75
- not_win
76
- canceled
77
- frozen
78
frozen:
79
- unresolved
80
- win
81
- not_win
82
- canceled
83
win:
84
- not_win
85
- canceled
86
not_win:
87
- canceled
88
- win
Copied!

Running bos-mint

To run MINT in debug mode use:
1
bos-mint start --port 8001 --host localhost
Copied!
The output that you see should contain:
1
2018-05-18 11:56:04,754 INFO : * Running on http://localhost:8001/ (Press CTRL+C to quit)
Copied!
The above setup is basic and for development use. Going forward, a Witness may want to deploy UWSGI with parallel workers for the endpoint.
MINT is purposely run on localhost to restrict outside access. Securing a Python flask application from malicious break in attempts is tedious and would be an ongoing effort.
Important: Recommendation is to access it via a SSH tunnel or through VPN.
Example for SSH tunnel:
Assume bos-mint is running on a remote server accessible via 1.2.3.4 and you have login credentials via SSH (password or private key access). On the local machine that you'll be using to access MINT via a web browser open the tunnel:
1
ssh -f -N -L 8080:127.0.0.1:8001 [email protected]1.2.3.4
Copied!
-f : Send process to background
-N : Do not send commands (if you need open ssh connections only for tunnelling)
-L : Port mapping (8080 port on your machine, 127.0.0.1:8001 - proxy to where MINT runs)
Now you can open mint in your browser using http://localhost:8080 address.
After starting MINT use your favourite desktop browser to access it and you'll be asked to enter your Witness key that will be stored encrypted in the local Peerplays wallet.
Note: MINT is not optimized for mobile use yet.

Development Use

For MINT development use checkout the latest repository from:
GitHub - peerplays-network/bos-mint: The Manual Intervention Module (MINT) provides a web interface for Witnesses to manually intervene in the otherwise fully-automated process of bringing Bookie Events, BMGs, and Betting Markets to the Peerplays blockchain (through bos-auto). This allows Witnesses to handle any edge cases that may arise and cannot be dealt with by bos-auto.
GitHub
and then run:
1
$ ./run_dev_server.sh # Run MINT
Copied!