Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cebash/sakia
  • santiago/sakia
  • jonas/sakia
3 results
Show changes
Showing
with 1032 additions and 0 deletions
// Emacs mode hint: -*- mode: JavaScript -*-
function Controller() {
installer.autoRejectMessageBoxes();
installer.installationFinished.connect(function() {
gui.clickButton(buttons.NextButton);
})
}
Controller.prototype.WelcomePageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.CredentialsPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.IntroductionPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.TargetDirectoryPageCallback = function()
{
gui.currentPageWidget().TargetDirectoryLineEdit.setText("C:\\Qt\\5.6");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ComponentSelectionPageCallback = function() {
//var widget = gui.currentPageWidget();
//widget.selectAll();
gui.clickButton(buttons.NextButton);
}
Controller.prototype.LicenseAgreementPageCallback = function() {
gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
gui.clickButton(buttons.NextButton);
}
Controller.prototype.StartMenuDirectoryPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ReadyForInstallationPageCallback = function()
{
gui.clickButton(buttons.NextButton);
}
Controller.prototype.FinishedPageCallback = function() {
var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm
if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
checkBoxForm.launchQtCreatorCheckBox.checked = false;
}
gui.clickButton(buttons.FinishButton);
}
:: To build extensions for 64 bit Python 3, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
::
:: To build extensions for 64 bit Python 2, we need to configure environment
:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
::
:: 32 bit builds do not require specific environment configurations.
::
:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
:: cmd interpreter, at least for (SDK v7.0)
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
:: http://stackoverflow.com/a/13751649/163740
::
:: Author: Olivier Grisel
:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
@ECHO OFF
SET COMMAND_TO_RUN=%*
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
IF %MAJOR_PYTHON_VERSION% == "2" (
SET WINDOWS_SDK_VERSION="v7.0"
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
SET WINDOWS_SDK_VERSION="v7.1"
) ELSE (
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
EXIT 1
)
IF "%PYTHON_ARCH%"=="64" (
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
SET DISTUTILS_USE_SDK=1
SET MSSdk=1
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
ECHO Executing: %COMMAND_TO_RUN%
call %COMMAND_TO_RUN% || exit 1
) ELSE (
ECHO Using default MSVC build environment for 32 bit architecture
ECHO Executing: %COMMAND_TO_RUN%
call %COMMAND_TO_RUN% || exit 1
)
#define MyAppName "Sakia"
#define MyAppPublisher "Sakia team"
#define MyAppURL "http://sakia-wallet.org"
#define MyAppExeName "sakia.exe"
#if !Defined(ROOT_PATH)
#define ROOT_PATH "."
#endif
#define MyAppSrc ROOT_PATH
#define MyAppExe ROOT_PATH + "\dist\sakia\" + MyAppExeName
#pragma message MyAppSrc
#if !FileExists(MyAppExe)
#error "Unable to find MyAppExe"
#endif
#define MyAppVerStr "0.53.2"
[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVerStr}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableDirPage=yes
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
OutputDir={#ROOT_PATH}
OutputBaseFilename={#MyAppName}
Compression=lzma
SolidCompression=yes
UninstallDisplayIcon={app}\{#MyAppExeName}
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "{#MyAppSrc}\dist\sakia\*"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs
Source: "{#MyAppSrc}\sakia.ico"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs
Source: "{#MyAppSrc}\sakia.png"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs
Source: "{#MyAppSrc}\LICENSE"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs
Source: "{#MyAppSrc}\ci\appveyor\after_install.cmd"; DestDir: "{app}\"; Flags: ignoreversion
Source: "{#MyAppSrc}\ci\appveyor\vcredist_x86.exe"; DestDir: "{tmp}\"; Flags: ignoreversion deleteafterinstall
Source: "{#MyAppSrc}\ci\appveyor\vcredist_x64.exe"; DestDir: "{tmp}\"; Flags: ignoreversion deleteafterinstall
[Icons]
Name: "{group}\{#MyAppName}"; IconFilename: "{app}\sakia.ico"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; IconFilename: "{app}\sakia.ico"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
#define VCmsg "Installing Microsoft Visual C++ Redistributable...."
[Run]
Filename: "{tmp}\vcredist_x86.exe"; StatusMsg: "{#VCmsg}"; Check: not IsWin64 and not VCinstalled
Filename: "{tmp}\vcredist_x64.exe"; StatusMsg: "{#VCmsg}"; Check: IsWin64 and not VCinstalled
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Filename: "{app}\after_install.cmd"; Description: "Delete ALL existing data"; Flags: postinstall nowait skipifsilent unchecked
[Code]
function VCinstalled: Boolean;
// By Michael Weiner <mailto:spam@cogit.net>
// Function for Inno Setup Compiler
// 13 November 2015
// Returns True if Microsoft Visual C++ Redistributable is installed, otherwise False.
// The programmer may set the year of redistributable to find; see below.
var
names: TArrayOfString;
i: Integer;
dName, key, year: String;
begin
// Year of redistributable to find; leave null to find installation for any year.
year := '';
Result := False;
key := 'Software\Microsoft\Windows\CurrentVersion\Uninstall';
// Get an array of all of the uninstall subkey names.
if RegGetSubkeyNames(HKEY_LOCAL_MACHINE, key, names) then
// Uninstall subkey names were found.
begin
i := 0
while ((i < GetArrayLength(names)) and (Result = False)) do
// The loop will end as soon as one instance of a Visual C++ redistributable is found.
begin
// For each uninstall subkey, look for a DisplayName value.
// If not found, then the subkey name will be used instead.
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, key + '\' + names[i], 'DisplayName', dName) then
dName := names[i];
// See if the value contains both of the strings below.
Result := (Pos(Trim('Visual C++ ' + year),dName) * Pos('Redistributable',dName) <> 0)
i := i + 1;
end;
end;
end;
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{2F4DA7A9-B15B-06FC-474C-A470394CAEAA}
LicenseFile="{#MyAppSrc}\LICENSE"
@ECHO ON
call activate test-environment
echo "%PATH%"
echo "%QT_PLUGIN_PATH%"
python -V
call pyuic5 --version
pyrcc5 -version
lrelease -version
echo "%cd%"
py.test tests/
if %errorlevel% neq 0 exit /b 1
\ No newline at end of file
#!/usr/bin/env bash
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
cd $HOME/build/duniter/sakia
pyenv shell $PYENV_PYTHON_VERSION
coverage -rm
coveralls
\ No newline at end of file
#!/usr/bin/env bash
if [ $TRAVIS_OS_NAME == "osx" ]
then
zip -r sakia-${TRAVIS_OS_NAME}.zip dist/sakia.app/
elif [ $TRAVIS_OS_NAME == "linux" ]
then
zip -r sakia-${TRAVIS_OS_NAME}.zip dist/sakia/
# Debian package
chmod 755 ci/travis/debian/DEBIAN/post*
chmod 755 ci/travis/debian/DEBIAN/pre*
mkdir -p ci/travis/debian/opt/sakia
cp sakia.png ci/travis/debian/opt/sakia/
cp sakia-${TRAVIS_OS_NAME}.zip ci/travis/debian/opt/sakia/sakia.zip
cp -r res/linux/usr ci/travis/debian
fakeroot dpkg-deb --build ci/travis/debian
mv ci/travis/debian.deb sakia-${TRAVIS_OS_NAME}.deb
fi
#!/usr/bin/env bash
if [ $TRAVIS_OS_NAME == "linux" ]
then
export XVFBARGS="-screen 0 1280x1024x24"
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
sleep 3
fi
if [ $TRAVIS_OS_NAME == "osx" ]
then
brew update
brew install libsodium
## Ensure your brew QT version is up to date. (brew install qt -> qt 4.8)
brew install qt5
brew list qt5
brew install pyenv-virtualenv
elif [ $TRAVIS_OS_NAME == "linux" ]
then
sudo apt-get update
sudo apt-get install -qq -y libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 \
libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev \
libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0 \
libxcb-render-util0-dev libxcb-glx0-dev libgl1-mesa-dri libegl1-mesa libpcre3 libgles2-mesa-dev \
freeglut3-dev libfreetype6-dev xorg-dev xserver-xorg-input-void xserver-xorg-video-dummy xpra libosmesa6-dev \
curl libdbus-1-dev libdbus-glib-1-dev autoconf automake libtool libgstreamer-plugins-base0.10-0 dunst fakeroot \
dbus-x11
wget https://download.qt.io/official_releases/qt/5.9/5.9.4/qt-opensource-linux-x64-5.9.4.run
chmod +x qt-opensource-linux-x64-5.9.4.run
./qt-opensource-linux-x64-5.9.4.run -v --script $HOME/build/duniter/sakia/ci/travis/qt-installer-noninteractive.qs
wget http://archive.ubuntu.com/ubuntu/pool/universe/libs/libsodium/libsodium18_1.0.13-1_amd64.deb
sudo dpkg -i libsodium18_1.0.13-1_amd64.deb
rm -r ~/.pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
ldconfig -p
#export $(dbus-launch)
fi
eval "$(pyenv init -)"
pyenv update
pyenv install --list
if [ $TRAVIS_OS_NAME == "osx" ]
then
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install $PYENV_PYTHON_VERSION
elif [ $TRAVIS_OS_NAME == "linux" ]
then
PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --force $PYENV_PYTHON_VERSION
fi
pyenv shell $PYENV_PYTHON_VERSION
cd $HOME
#!/usr/bin/env bash
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
cd $HOME/build/duniter/sakia
pyenv shell $PYENV_PYTHON_VERSION
pip install --upgrade pip
pyenv rehash
pip install coveralls
pip install pytest-cov
pip install pyinstaller==3.3.1
pip install wheel
pip install -r requirements.txt
if [ $TRAVIS_OS_NAME == "linux" ]
then
pip install -U git+https://github.com/posborne/dbus-python.git
pip install notify2
export PATH=/tmp/qt/5.8/5.8/gcc_64/bin:$PATH
fi
if [ $TRAVIS_OS_NAME == "osx" ]
then
brew link --force qt5
export PATH=/Users/travis/.pyenv/versions/$PYENV_PYTHON_VERSION/Python.framework/Versions/3.5/bin:$PATH
fi
echo $PATH
python gen_resources.py
python gen_translations.py --lrelease
if [ $TRAVIS_OS_NAME == "osx" ]
then
pyinstaller sakia.spec
cp -rv dist/sakia/* dist/sakia.app/Contents/MacOS
cp -v res/osx/Info.plist dist/sakia.app/Contents/
rm -rfv dist/sakia
elif [ $TRAVIS_OS_NAME == "linux" ]
then
pyinstaller sakia.spec
rm -f dist/sakia/libdrm.so.2
python setup.py bdist_wheel
fi
Package: sakia
Version: 0.53.2
Section: misc
Priority: optional
Architecture: all
Installed-Size: 122000
Maintainer: inso <insomniak.fr@gmail.com>
Description: Sakia Wallet
#!/bin/bash
SAKIA_ROOT=/opt/sakia
unzip -d $SAKIA_ROOT/ $SAKIA_ROOT/sakia.zip
mv $SAKIA_ROOT/dist/sakia/* $SAKIA_ROOT/
rm $SAKIA_ROOT/sakia.zip
ln -s /opt/sakia/sakia.bin /usr/bin/sakia
#!/bin/bash
rm /usr/bin/sakia
rm -Rf /opt/sakia
// Emacs mode hint: -*- mode: JavaScript -*-
function Controller() {
installer.autoRejectMessageBoxes();
installer.installationFinished.connect(function() {
gui.clickButton(buttons.NextButton);
})
}
Controller.prototype.WelcomePageCallback = function() {
gui.clickButton(buttons.NextButton, 3000);
}
Controller.prototype.CredentialsPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.IntroductionPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.TargetDirectoryPageCallback = function()
{
gui.currentPageWidget().TargetDirectoryLineEdit.setText("/tmp/qt/5.8");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ComponentSelectionPageCallback = function() {
var widget = gui.currentPageWidget();
widget.selectAll();
gui.clickButton(buttons.NextButton);
}
Controller.prototype.LicenseAgreementPageCallback = function() {
gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
gui.clickButton(buttons.NextButton);
}
Controller.prototype.StartMenuDirectoryPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ReadyForInstallationPageCallback = function()
{
gui.clickButton(buttons.NextButton);
}
Controller.prototype.FinishedPageCallback = function() {
var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm
if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
checkBoxForm.launchQtCreatorCheckBox.checked = false;
}
gui.clickButton(buttons.FinishButton);
}
#!/usr/bin/env bash
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
if [ $TRAVIS_OS_NAME == "linux" ]
then
export XVFBARGS="-screen 0 1280x1024x24"
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
sleep 3
fi
if [ $TRAVIS_OS_NAME == "osx" ]
then
brew link --force qt5
export PATH=/Users/travis/.pyenv/versions/$PYENV_PYTHON_VERSION/Python.framework/Versions/3.5/bin:$PATH
fi
cd $HOME/build/duniter/sakia
pyenv shell $PYENV_PYTHON_VERSION
if [ $TRAVIS_OS_NAME == "linux" ]
then
py.test --cov=sakia tests/
else
py.test -s
fi
# Install Sakia for developpers
### Windows install
* Download and install [vcredist2015](https://www.microsoft.com/fr-FR/download/details.aspx?id=48145)
* Download and install [Miniconda](http://conda.pydata.org/miniconda.html).
* Download and install [Git](https://git-scm.com/) and add the binaries path to your `PATH` variable
* Download and install [Qt 5.6](http://download.qt.io/development_releases/qt/5.6/) for your architecture (msvc2015_64 for 64 bits, msvc2015 for 32 bits)
* Open Conda console then : `conda update --yes conda`
* Restart Conda console then :
```
conda config --add channels inso/channel/sakia
conda create -n sakia-env python=3.5 pyqt5 libsodium=1.0.3
activate sakia-env
pip install -r requirements.txt
pip install pyinstaller
```
* To run sakia, you have to export the following variable in your conda console :
```
SET PYTHONPATH=[Path to sakia dir]\\src;%PYTHONPATH%
```
* Then :
```batch
python gen_resources.py
python gen_translations.py
python src/sakia/main.py
```
### Linux & Macos (Pyenv install)
#### Linux System dependencies
##### Fedora
sudo dnf install libsodium qt5-qtsvg python3-qt5 qt5-qttools \
qt5-qttools-devel python3-qt5-devel qtchooser openssl-devel zfstream-devel \
readline-devel sqlite-devel gcc-c++ \
qt5-qtbase-devel qt5-qtsvg-devel
sudo ln -s /usr/bin/lrelease-qt5 /usr/bin/lrelease
##### Ubuntu 14.04+ install
sudo apt-get install curl qt5-qmake qtbase5-dev qttools5-dev-tools libqt5svg5-dev libdbus-1-dev libdbus-glib-1-dev autoconf automake libtool
64 bits:
wget http://archive.ubuntu.com/ubuntu/pool/universe/libs/libsodium/libsodium13_1.0.1-1_amd64.deb
sudo dpkg -i libsodium13_1.0.1-1_amd64.deb
32 bits:
wget http://archive.ubuntu.com/ubuntu/pool/universe/libs/libsodium/libsodium13_1.0.1-1_i386.deb
sudo dpkg -i libsodium13_1.0.1-1_i386.deb
##### Install pyenv on your home:
* Linux :
```bash
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
```
Add in `~/.bash_profile`, in `~/.bashrc` on Fedora:
```bash
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv virtualenv-init -)"
eval "$(pyenv init -)"
export PYENV_ROOT="$HOME/.pyenv"
```
Restart your terminal.
#### MacOS system dependencies
Install the following brew packages :
```bash
brew install wget
brew install libsodium
## Ensure your brew QT version is up to date. (brew install qt -> qt 4.8)
brew install qt5
brew link --force qt5
## Install pyenv
brew install pyenv
brew install pyenv-virtualenv
```
After installation, you'll need to add :
```bash
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
```
to your profile (as stated in the caveats displayed by Homebrew — to display them again, use brew info pyenv). You only need to add that to your profile once.
If you are running El Capitan (MacOS 10.10), you'll need to run `xcode-select --install`
#### Pyenv environment
##### Build python 3.5.4
Building python 3.5.4 requires libraries of `openssl` and `sqlite3`. On Ubuntu, install it using the following commands :
```
apt-get update
apt-get install libssl-dev
apt-get install libsqlite3-dev
```
Restart your shell then prepare your virtualenv:
On GNU/Linux: `PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.5.4`
On MacOS: `env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.5.4`
Run:
```bash
pyenv shell 3.5.4
pyenv virtualenv sakia-env
```
#### Build Sakia:
##### Download Sakia
git clone https://github.com/duniter/sakia
##### Go to dev branch
```bash
cd sakia && git checkout dev
```
##### Configure your PYTHONPATH environment variable
```bash
export PYTHONPATH=${PYTHONPATH}:/YOUR_SAKIA_INSTALL_PATH/src
```
On Linux, you'll need buildable python-dbus and notify2 :
```bash
pyenv local sakia-env
pip install PyQt5
pip install -U git+https://github.com/posborne/dbus-python.git
pip install notify2
```
To build sakia dependencies, go in sakia directory then :
```bash
pip install -r requirements.txt --upgrade
pip install pyinstaller
pyenv rehash
```
##### Run Sakia ressources generator
python gen_resources.py
##### Run Sakia translations generator
python gen_translations.py
##### Build Sakia as a binary
```sh
pyinstaller sakia.spec
```
##### Run Sakia build
```sh
./dist/sakia/sakia
```
##### Run Sakia from sources
cd src && python sakia/main.py
#### Tips
You could find cache repositories on Unix at `~/.conf/sakia` and on Windows at `%APPDATA%\sakia`.
# Install Sakia dev on Fedora
## Install Sakia
### Clone respository
```bash
mkdir -p ~/projects
git clone -b dev git@gihub.com:/duniter/sakia.git ~/projects/sakia_dev
cd ~/projects/sakia_dev
```
### Install pip dependencies
```bash
pip3 install --upgrade pip --user
pip3 install -r requirements.txt --user
```
### Fix Qt link
```bash
sudo ln -s /usr/bin/lrelease-qt5 /usr/bin/lrelease
```
### Script to launch Sakia
```bash
echo "#!/bin/bash
if [ $1 == "dev" ]; then
python3 $HOME/projects/gen_resources.py
python3 $HOME/projects/gen_translations.py
python3 $HOME/projects/src/sakia/main.py -d
fi
if [ $1 == "stable" ]; then
./sakia_stable/dist/sakia/sakia -d
fi" >> $HOME/run_sakia.sh
```
## Python path
### Bash
```bash
echo "# Sakia
export PYTHONPATH=$HOME/projects/sakia_dev/src" >> ~/.bashrc
```
### Fish
```bash
echo "# Sakia
set -x PYTHONPATH "$HOME/projects/sakia_dev/src" >> ~/.config/fish/config.fish
```
## Install dependencies
```bash
sudo dnf install -y python3-qt5 python3-jsonschema qt5-qttools-devel python3-qt5-devel libsodium
```
## Launch Sakia
```bash
./run_sakia.sh dev
```
## Upgrade DuniterPy
```bash
sudo pip3 install --upgrade duniterpy
```
## Dependency to build
```bash
sudo pip3 install pyinstaller
```
# Developing a plugin for sakia
## Prepare dev environment
Follow the doc file [Install for developers](https://github.com/duniter/sakia/blob/dev/doc/install_for_developers.md).
You can use the same pyenv environment to develop your plugin.
## Plugin structure
The plugin source code should follow the structure below :
```
/
[plugin_pkg_name]/
images/ # The directory containing images used in the widget
images.qrc # The qt resources .qrc file describing available images
[image1.png] # The list of images
[image2.png]
__init__.py # The __init__ file of the plugin
[script_1.py] # Some scripts imported in the __init__ file
[script_2.py]
[ui_file.ui] # ui files designed using QtDesigner
```
The `__init__.py` file must set the following global constants :
```python
PLUGIN_NAME = "Title of the plugin"
PLUGIN_DESCRIPTION = "Description of the plugin"
PLUGIN_VERSION = "0.1"
```
The function below must be present in the `__init__.py` file to initialize the plugin on Sakia startup :
```python
def plugin_exec(app, main_window):
"""
:param sakia.app.Application app:
:param sakia.gui.main_window.controller.MainWindowController main_window:
"""
# Place your init code here
pass
```
## Building your plugin
To build the plugin, you need :
### To generate resources (images, qrc, ...)
Generating resources uses [pyrcc5](http://pyqt.sourceforge.net/Docs/PyQt5/resources.html).
Generating designer ui files uses [pyuic5](http://pyqt.sourceforge.net/Docs/PyQt5/designer.html).
To help you generate your resources, you should copy the `gen_resources.py` file from sakia sources and configure the
variable `gen_resources`. Replace `'src'` by the name of your plugin package.
### To import your resources in your code
The generation of the resources builds the following python files :
- `filename.ui` -> `filename_uic.py`
- `filename.qrc` -> `filename_rc.py`
The `filename_uic.py` file should be imported in the file using the designed widget. See the
[dialog of the example plugin](https://github.com/Insoleet/sakia-plugin-example/blob/master/plugin_example/main_dialog.py)
The `filename_rc.py` file should be imported in the `__init__.py` file, on the last line. See the
[\__init__.py of the example plugin](https://github.com/Insoleet/sakia-plugin-example/blob/master/plugin_example/__init__.py#L28)
### To generate your plugin
To generate your plugin, you must zip everything (generated resources) in a zip file respecting the structure below :
```
[plugin_name].zip\
[plugin_name]\
__init__.py
[generated files...]
```
The [setup.py](https://github.com/Insoleet/sakia-plugin-example/blob/master/setup.py) file from the
example plugin is available to help you generate correctly the plugin.
### To test your plugin
To test your plugin, you need to run sakia with the parameter `--withplugin [path to zip file]`. The plugin will
be loaded automatically on startup but won't be installed to user profile directory.
\ No newline at end of file
doc/uml/backend.png

184 KiB

@startuml
!include data.pu
!include processors.pu
!include services.pu
ProfileService "1" --> "1" UserParameters
ProfileService "*" --> "1" UserParametersRepo
AccountService "1" --> "1" Key
AccountService "*" --> "1" KeyRepo
TransactionsService "1" --> "*" Transaction
TransactionsService "*" --> "1" TransactionProcessor
TransactionProcessor "1" --> "1" TransactionRepo
RegistryService "1" --> "*" Identity
RegistryService "1" --> "*" Certification
RegistryService "*" --> "1" IdentitiesProcessor
IdentitiesProcessor "1" --> "1" IdentitiesRepo
RegistryService "*" --> "1" CertificationProcessor
CertificationProcessor "1" --> "1" CertificationRepo
NetworkService "1" --> "*" Node
NetworkService "*" --> "1" NodesProcessor
NodesProcessor "1" --> "1" NodesRepo
BlockchainService "1" --> "1" Blockchain
BlockchainService "1" --> "1" Community
BlockchainService "*" --> "1" BlockchainProcessor
BlockchainProcessor "1" --> "1" BlockchainRepo
BlockchainService "*" --> "1" CommunityProcessor
CommunityProcessor "1" --> "1" CommunityRepo
package Connectors {
class BMAConnector << (S,cyan) >> {
get()
post()
broadcast()
}
}
AccountService --> BMAConnector
BlockchainProcessor --> BMAConnector
CommunityProcessor --> BMAConnector
TransactionProcessor --> BMAConnector
IdentitiesProcessor --> BMAConnector
CertificationProcessor --> BMAConnector
@enduml
\ No newline at end of file
doc/uml/data.png

57.6 KiB

@startuml
class Identity << (D,orchid) >> {
currency: str (FK)
uid: str
pubkey: str (PK)
blockstamp: BlockUID
timestamp: int
signature: str
written_on: BlockUID
revoked_on: BlockUID
member: bool
membership_buid: BlockUID
membership_timestamp: int
membership_type: str
membership_written_on: BlockUID
}
class Certification << (D,orchid) >> {
currency: str (PK)
certifier: str (PK)
certified: str (PK)
blockstamp: BlockUID (PK)
timestamp: int
signature: str
written_on: BlockUID
}
class Transaction << (D,orchid) >> {
currency: str (FK)
blockstamp: str
locktime: int
issuer: str
recipient: str
amount: int
comment: str
sha_hash: str (PK)
}
class Community << (D,orchid) >> {
profile: str (FK)
pubkey: str (FK)
currency: str (PK)
c: float
dt: int
ud0: int
sig_period: int
sig_stock: int
sig_window: int
sig_validity: int
sig_qty: int
xpercent: float
ms_validity: int
step_max: int
median_time_blocks: int
avg_gen_time: int
dt_diff_eval: int
blocks_rot: int
percent_rot: float
}
class Blockchain << (D,orchid) >> {
currency: str (PK)
current_buid: BlockUID
nb_members: int
current_mass: int
median_time: int
last_ud: int
last_ud_base: int
previous_mass: int
}
class Node << (D,orchid) >> {
currency: str (FK)
endpoints: str
uid: str
pubkey: str (PK)
current_buid: BlockUID
previous_buid: BlockUID
state: int
software: str
version: str
merkle_nodes: dict
}
class Key << (D,orchid) >> {
pubkey: str (PK)
salt: str
}
class UserParameters << (D,orchid) >> {
profile: str (PK)
lang: str
ref: 0
expert_mode: bool,
digits_after_comma: int
maximized: bool
notifications: bool
enable_proxy: bool
proxy_type: int
proxy_address: str
proxy_port: 8080: int
international_system_of_units: bool
auto_refresh: bool
forgetfulness: bool
}
class UserParametersRepo << (R,orange) >> {
Create()
Update()
Save()
Drop()
}
class KeyRepo << (R,orange) >> {
Create()
Update()
Save()
Drop()
}
class NodesRepo << (R,orange) >> {
Create()
Update()
Save()
Drop()
}
class BlockchainRepo << (R,orange) >> {
Create()
Update()
Save()
Drop()
}
class CommunityRepo << (R,orange) >> {
Commit()
Update()
Save()
Drop()
}
class TransactionRepo << (R,orange) >> {
Commit()
Update()
Save()
Drop()
}
class CertificationRepo << (R,orange) >> {
Commit()
Update()
Save()
Drop()
}
class IdentitiesRepo << (R,orange) >> {
Commit()
Update()
Save()
Drop()
}
IdentitiesRepo "1" --* "*" Identity
CertificationRepo "1" --* "*" Certification
TransactionRepo "1" --* "*" Transaction
CommunityRepo "1" --* "*" Community
BlockchainRepo "1" --* "*" Blockchain
NodesRepo "1" --* "*" Node
KeyRepo "1" --* "*" Key
UserParametersRepo "1" --* "*" UserParameters
@enduml
\ No newline at end of file