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 2609 additions and 0 deletions
doc/uml/network.png

21.7 KiB

@startuml
Network -->o Node : Connect to node_received()
Network -> Node : Starts network discovery
activate Node
Node -> duniterpy : HTTP GET peering/peers?leaves=true
alt "root" hash changed
loop "for all leaves changed"
activate Node
Node -> duniterpy : HTTP GET peering/peers/leaf=leaf_hash
end
end
Network <-- Node : node_received()
ref over Network
New node is instanciated
if pubkey not known yet.
It starts it's own
network discovery
end ref
@enduml
\ No newline at end of file
doc/uml/processors.png

10.6 KiB

@startuml
class IdentitiesProcessor << (P,lightgreen) >> {
find_identities()
find_certifiers_of()
find_certified_by()
}
class CertificationProcessor << (P,lightgreen) >> {
}
class TransactionProcessor << (P,lightgreen) >> {
}
class CommunityProcessor << (P,lightgreen) >> {
}
class BlockchainProcessor << (P,lightgreen) >> {
}
class NodesProcessor << (P,lightgreen) >> {
}
@enduml
\ No newline at end of file
doc/uml/requests.png

26 KiB

@startuml
activate "Core Component"
"Core Component" -> BmaAccess : Request data
BmaAccess -> BmaAccess : Request cache
ref over BmaAccess
Data is obsolete
(new block mined
since last caching)
end ref
BmaAccess -> duniterpy : HTTP GET
alt Rollback
BmaAccess -> BmaAccess : Find last block number rollbacked
ref over BmaAccess
If the request is a bma/blockchain/Block, we check if the hash answered is the same
as our hash, in which case, we know that the rollback didn't reset blocks before
this one.
Blocks from this one to the current block are considered obsolete
end ref
end
BmaAccess -> BmaAccess : Update cache data
"Core Component" <- BmaAccess : Return data data
deactivate "Core Component"
@enduml
\ No newline at end of file
doc/uml/services.png

13.4 KiB

@startuml
class ProfileService << (S,cyan) >> {
add_connection()
remove_connection()
}
class AccountService << (S,cyan) >> {
send_transaction()
send_certification()
send_membership()
send_identity()
send_revokation()
}
class TransactionsService << (S,cyan) >> {
handle_new_block()
refresh_transactions()
rollback_transactions()
}
class RegistryService << (S,cyan) >> {
handle_new_block()
}
class NetworkService << (S,cyan) >> {
discover_network()
}
class BlockchainService << (S,cyan) >> {
receive_block()
}
@enduml
\ No newline at end of file
doc/uml/tx_lifecycle.png

63.2 KiB

@startuml note "With B a Block\nWith W the Median fork window\nWith Cur the current block of the main branch\nWith T a time" as N1 state Local_Tx { [*] --> To_send : Signed locally To_send : B = none To_send --> Awaiting : Node answered\n200 OK to POST Awaiting : Time = Cur.MedianTime Awaiting --> Refused : Not registered in [T; T+W*MedianTime] Refused --> To_send : Send back Refused --> [*] : Drop } state Registered { [*] --> Validating : Posted\nsin the blockchain Validating : B = Block containing the Tx Awaiting --> Validating : Found in the blockchain Validating --> Validated : Cur-B > W Validated --> Validating : Blockchain\nrollback\ntx in fork window Validated --> Awaiting : Blockchain\nrollback\ntx local removed Validated --> [*] : Blockchain\nrollback\ntx removed Validating --> [*] : Blockchain\nrollback\ntx removed } @enduml
\ No newline at end of file
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys, os, multiprocessing, subprocess
root_path = os.path.abspath(os.path.join(os.path.dirname(__file__)))
resources = os.path.abspath(os.path.join(os.path.dirname(__file__), 'res'))
gen_resources = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src/sakia'))
def convert_ui(args, **kwargs):
subprocess.call(args, **kwargs)
def build_resources():
try:
to_process = []
for root, dirs, files in os.walk(root_path):
for f in files:
if f.endswith('.ui'):
source = os.path.join(root, f)
dest = os.path.join(root, os.path.splitext(os.path.basename(source))[0]+'_uic.py')
exe = 'pyuic5'
elif f.endswith('.qrc'):
source = os.path.join(root, f)
filename = os.path.splitext(os.path.basename(source))[0]
# we remove "sakia." from the rc filename
# its only named like this so that imports are corrects in uic files
dest = os.path.join(gen_resources, filename.replace('sakia.', '')+'_rc.py')
exe = 'pyrcc5'
else:
continue
print(source + " >> " + dest)
to_process.append([exe, '-o', dest, source])
if sys.platform.startswith('win'):
# doing this in parallel on windows will crash your computer
[convert_ui(args, shell=True) for args in to_process]
else:
pool = multiprocessing.Pool()
pool.map(convert_ui, to_process)
except EnvironmentError:
print("""\
Warning: PyQt5 development utilities (pyuic5 and pyrcc5) not found
Unable to install praxes' graphical user interface
""")
build_resources()
\ No newline at end of file
import sys, os, multiprocessing, subprocess, time, shutil
gen_resources = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src/sakia'))
ts = os.path.abspath(os.path.join(os.path.dirname(__file__), 'res', 'i18n', 'ts'))
qm = os.path.abspath(os.path.join(os.path.dirname(__file__), 'res', 'i18n', 'qm'))
if not os.path.exists(qm):
os.mkdir(qm)
translations = []
qm_files = []
qm_shortnames = []
def prepare_qm():
for root, dirs, files in os.walk(ts):
for f in files:
if f.endswith('.ts'):
tsfilename = os.path.join(root, f)
qmshort = "{0}qm".format(f[:-2])
qmfilename = os.path.join(qm, qmshort)
srcdest = (tsfilename, qmfilename)
translations.append(srcdest)
qm_shortnames.append(qmshort)
else:
continue
print(os.path.join(root, f))
for (ts_file, qm_file) in translations:
# avoid conflict with qt4 lrelease by running qtchooser directly
if sys.platform.startswith('win') or shutil.which("qtchooser") == None or "--lrelease" in sys.argv:
subprocess.call(["lrelease", ts_file, "-qm", qm_file])
else:
subprocess.call(["qtchooser", "-run-tool=lrelease", "-qt=5", ts_file, "-qm", qm_file])
print(ts_file + " >> " + qm_file)
def build_resources():
files = ""
for file in qm_shortnames:
files += """
<file alias="{0}">qm/{0}.qm</file>""".format(file[:-3])
rccfile = """<RCC>
<qresource prefix="i18n">{0}
</qresource>
</RCC>
""".format(files)
print(rccfile)
qrc_filename = os.path.abspath(os.path.join(os.path.dirname(__file__),
'res',
'i18n',
'langs-{0}.qrc'.format(int(time.time()))
))
pyc_filename = os.path.abspath(os.path.join(gen_resources, 'i18n_rc.py'))
with open(qrc_filename, 'w') as outfile:
outfile.write(rccfile)
try:
subprocess.call(["pyrcc5", "-o", pyc_filename, qrc_filename])
print(qrc_filename + " >> " + pyc_filename)
finally:
os.remove(qrc_filename)
prepare_qm()
# add Qt standardButtons qm file
# This file must be copied from Qt libs in the res/i18n/qm folder of the project
qtbase_filename = "qtbase_fr.qm"
if os.path.exists(os.path.join(qm, qtbase_filename)):
qm_shortnames.append(qtbase_filename)
build_resources()
#-----------------------------------------------------------------------------
# Copyright (c) 2013-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
hiddenimports = ['sip', 'PyQt5.QtCore']
from PyInstaller.utils.hooks import qt_plugins_binaries
from PyInstaller.compat import is_linux
binaries = []
binaries.extend(qt_plugins_binaries('accessible', namespace='PyQt5'))
binaries.extend(qt_plugins_binaries('iconengines', namespace='PyQt5'))
binaries.extend(qt_plugins_binaries('imageformats', namespace='PyQt5'))
binaries.extend(qt_plugins_binaries('inputmethods', namespace='PyQt5'))
binaries.extend(qt_plugins_binaries('graphicssystems', namespace='PyQt5'))
binaries.extend(qt_plugins_binaries('platforms', namespace='PyQt5'))
if is_linux:
binaries.extend(qt_plugins_binaries('platformthemes', namespace='PyQt5'))
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
# This is needed to bundle draft3.json and draft4.json files that come
# with jsonschema module
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('lib2to3')
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
from PyInstaller.utils.hooks import collect_submodules
hiddenimports = collect_submodules('pkg_resources._vendor')
\ No newline at end of file
#!/bin/bash
#__version_info__ = ('0', '20', '0dev6')
current=`grep -P "__version_info__ = \(\"\d+\", \"\d+\", \"\d+(\w*)\"\)" src/sakia/__init__.py | grep -oP "\"\d+\", \"\d+\", \"\d+(\w*)\""`
echo "Current version: $current"
if [[ $1 =~ ^[0-9]+.[0-9]+.[0-9]+[0-9A-Za-z]*$ ]]; then
IFS='.' read -r -a array <<< "$1"
sed -i "s/__version_info__\ = ($current)/__version_info__ = (\"${array[0]}\", \"${array[1]}\", \"${array[2]}\")/g" src/sakia/__init__.py
sed -i "s/#define MyAppVerStr .*/#define MyAppVerStr \"$1\"/g" ci/appveyor/sakia.iss
sed -i "s/Version: .*/Version: $1/g" ci/travis/debian/DEBIAN/control
sed -i "s/Version=.*/Version=$1/g" res/linux/usr/share/applications/sakia.desktop
sed -i "s/version=.*/version=$1/g" ci/appimage/config.env
git commit src/sakia/__init__.py ci/appveyor/sakia.iss ci/travis/debian/DEBIAN/control res/linux/usr/share/applications/sakia.desktop ci/appimage/config.env -m "$1"
git tag "$1" -a -m "$1"
else
echo "Wrong version format"
fi
pypeg2
aiohttp==3.6.2
async-timeout==3.0.1
attrs==19.3.0
duniterpy==0.58.1
jsonschema==3.2.0
networkx==2.4
PyQt5==5.9.2
PyYAML==5.3
Quamash==0.6.1
setuptools>=46.0.0
wheel
twine
\ No newline at end of file
black==20.8b1
duniter-mirage>=0.1.50
mypy==0.770
pylint==2.4.4
pytest
pytest-asyncio
md-to-html
\ No newline at end of file
This diff is collapsed.