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
Select Git revision

Target

Select target project
  • elmau/silkaj
  • Mr-Djez/silkaj
  • jbar/silkaj
  • clients/python/silkaj
  • Bernard/silkaj
  • cebash/silkaj
  • jytou/silkaj
  • c-geek/silkaj
  • vincentux/silkaj
  • jeanlucdonnadieu/silkaj
  • matograine/silkaj
  • zicmama/silkaj
  • manutopik/silkaj
  • atrax/silkaj
14 results
Select Git revision
Show changes
Commits on Source (982)
Showing with 1131 additions and 182 deletions
# ---> Python
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/
*.py[cod] *.py[cod]
...@@ -9,7 +8,6 @@ __pycache__/ ...@@ -9,7 +8,6 @@ __pycache__/
# Distribution / packaging # Distribution / packaging
.Python .Python
env/
build/ build/
develop-eggs/ develop-eggs/
dist/ dist/
...@@ -21,9 +19,12 @@ lib64/ ...@@ -21,9 +19,12 @@ lib64/
parts/ parts/
sdist/ sdist/
var/ var/
wheels/
share/python-wheels/
*.egg-info/ *.egg-info/
.installed.cfg .installed.cfg
*.egg *.egg
MANIFEST
# PyInstaller # PyInstaller
# Usually these files are written by a python script from a template # Usually these files are written by a python script from a template
...@@ -38,12 +39,17 @@ pip-delete-this-directory.txt ...@@ -38,12 +39,17 @@ pip-delete-this-directory.txt
# Unit test / coverage reports # Unit test / coverage reports
htmlcov/ htmlcov/
.tox/ .tox/
.nox/
.coverage .coverage
.coverage.* .coverage.*
.cache .cache
nosetests.xml nosetests.xml
coverage.xml coverage.xml
*,cover *.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations # Translations
*.mo *.mo
...@@ -51,17 +57,104 @@ coverage.xml ...@@ -51,17 +57,104 @@ coverage.xml
# Django stuff: # Django stuff:
*.log *.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation # Sphinx documentation
docs/_build/ docs/_build/
# PyBuilder # PyBuilder
.pybuilder/
target/ target/
# Idea # Jupyter Notebook
.idea .ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# Vim swap files # PyCharm
*~ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
*.swp # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
*.swo # and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
stages:
- checks
- tests
- package
- website
variables:
DOCKER_IMAGE: "registry.duniter.org/docker/python3/poetry"
PYTHON_VERSION: "3.12"
image: $DOCKER_IMAGE/$PYTHON_VERSION:latest
.code_changes:
rules:
- changes:
- "**.py"
- "**/*.py"
- .pre-commit-config.yaml
- .gitlab-ci.yml
.pc_changes:
rules:
- changes:
- "**.py"
- "**/*.py"
- "**.md"
- "**/*.md"
- .pre-commit-config.yaml
.mkdocs_changes:
rules:
- changes:
- "mkdocs.yml"
- "docs/**.md"
- "**.py"
- "**/*.py"
.changes:
rules:
- changes:
- "**.py"
- "**/*.py"
- .gitlab-ci.yml
- pyproject.toml
build:
extends: .changes
stage: checks
script:
- poetry build
.pre-commit:
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
cache:
paths:
- ${PRE_COMMIT_HOME}
mypy:
extends:
- .code_changes
- .pre-commit
stage: checks
script:
- pre-commit run -a mypy
pre-commit:hooks:
extends:
- .pc_changes
- .pre-commit
stage: checks
script:
- pre-commit run -a check-ast
- pre-commit run -a check-merge-conflict
- pre-commit run -a check-toml
- pre-commit run -a debug-statements
- pre-commit run -a end-of-file-fixer
- pre-commit run -a mixed-line-ending
- pre-commit run -a trailing-whitespace
- pre-commit run -a insert-license
- pre-commit run -a mdformat
ruff:
extends:
- .code_changes
- .pre-commit
stage: checks
script:
- pre-commit run -a ruff
- pre-commit run -a ruff-format
.tests:
extends: .changes
stage: tests
image: $DOCKER_IMAGE/$PYTHON_VERSION:latest
script:
- poetry install --extras deathreaper
- poetry run pytest tests/unit
unit_tests:3.9:
extends: .tests
variables:
PYTHON_VERSION: "3.9"
unit_tests:3.10:
extends: .tests
variables:
PYTHON_VERSION: "3.10"
unit_tests:3.11:
extends: .tests
variables:
PYTHON_VERSION: "3.11"
tests:3.12:cov:
extends: .tests
coverage: '/(?i)total.*\s+(\d+%)/'
script:
- poetry install --extras deathreaper
- poetry run pytest --cov silkaj --cov-report html --cov-report xml --cov-report term
artifacts:
paths:
- htmlcov
- coverage.xml
expire_in: 2 days
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
unit_tests:3.13:
extends: .tests
variables:
PYTHON_VERSION: "3.13"
.image:
stage: package
tags: [docker]
image: docker:latest
services:
- docker:dind
variables:
PYTHON_VERSION: "3.12"
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE/$CHANNEL/$ENV:$CI_COMMIT_SHORT_SHA" -f image/$ENV --build-arg PYTHON_VERS=$PYTHON_VERSION .
- docker push "$CI_REGISTRY_IMAGE/$CHANNEL/$ENV:$CI_COMMIT_SHORT_SHA"
- docker tag "$CI_REGISTRY_IMAGE/$CHANNEL/$ENV:$CI_COMMIT_SHORT_SHA" "$CI_REGISTRY_IMAGE/$CHANNEL/$ENV:latest"
- docker push "$CI_REGISTRY_IMAGE/$CHANNEL/$ENV:latest"
.image:release:
extends: .image
variables:
CHANNEL: "release"
after_script:
- docker tag "$CI_REGISTRY_IMAGE/$CHANNEL/$ENV:$CI_COMMIT_SHORT_SHA" "$CI_REGISTRY_IMAGE/$CHANNEL/$ENV:$CI_COMMIT_TAG"
- docker push "$CI_REGISTRY_IMAGE/$CHANNEL/$ENV:$CI_COMMIT_TAG"
rules:
- if: $CI_COMMIT_TAG
when: manual
image:release:poetry:
extends: .image:release
variables:
ENV: "poetry"
image:release:pip:
extends: .image:release
variables:
ENV: "pip"
.image:branch:
extends: .image
allow_failure: true
variables:
CHANNEL: $CI_COMMIT_BRANCH
rules:
- if: $CI_COMMIT_TAG
when: never
- when: manual
image:branch:poetry:
extends: .image:branch
variables:
ENV: "poetry"
image:branch:pip:
extends: .image:branch
variables:
ENV: "pip"
pypi_test:
stage: package
rules:
- if: $CI_COMMIT_TAG
when: manual
script:
- poetry config repositories.pypi_test https://test.pypi.org/legacy/
- poetry publish --build --username $PYPI_TEST_LOGIN --password $PYPI_TEST_PASSWORD --repository pypi_test
pypi:
stage: package
rules:
- if: $CI_COMMIT_TAG
when: manual
script:
- poetry publish --build --username $PYPI_LOGIN --password $PYPI_PASSWORD
release:
stage: package
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- echo "running release_job"
release:
tag_name: "$CI_COMMIT_TAG"
description: "$CI_COMMIT_TAG"
website:
stage: website
extends: .mkdocs_changes
needs: ["tests:3.12:cov"]
variables:
RELEASE: "0.20"
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
script:
- poetry install --with docs
- git fetch origin pages --depth=1
- git config user.name $GITLAB_USER_NAME
- git config user.email $GITLAB_USER_EMAIL
- poetry run mike deploy $RELEASE
- git remote set-url origin "https://${TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git"
- git push origin pages
exclude: |
(?x)^(
docs/usage/cli.md|
g1_monetary_license/.*
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-ast
- id: check-merge-conflict
- id: check-toml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
hooks:
- id: mypy
- repo: https://gitlab.com/devopshq/gitlab-ci-linter
rev: v1.0.6
hooks:
- id: gitlab-ci-linter
args:
- "--server"
- "https://git.duniter.org"
- "--project"
- "clients/python/silkaj"
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
files: \.py$
args:
- --license-filepath
- license_header.txt
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.22
hooks:
- id: mdformat
additional_dependencies:
- mdformat-mkdocs>=2.0.0
- mdformat-frontmatter
# Authors and contributors
- Moul, Maël Azimi <ma.azimi@moul.re>
- Matograine <tom.ngr@zaclys.net>
- Tortue <ucoin@tednet.fr>
- cebash, Sébastien DA ROCHA <sebastien@da-rocha.net>
- atrax, <duniter@karam.email>
- cgeek, Cédric Moreau <cem.moreau@gmail.com>
- jytou, Jean-Yves Toumit <jytoumit@gmail.com>
- Bernard <bernard@dugas-family.org>
- ManUtopiK, Emmanuel Salomon <emmanuel.salomon@gmail.com>
- mmuman, François Revol
- MrNem, Pi Nguyen <nguyenpi@hotmail.com>
- vtexier, Vincent Texier <vit@free.fr>
- vincentux, <vincentux@vincentux.fr>
# Changelog
Checkout the changelog on [Silkaj website](https://silkaj.duniter.org/latest/changelog).
# Contributing
Checkout the contributing guide on [Silkaj website](https://silkaj.duniter.org/latest/contributing).
...@@ -659,4 +659,3 @@ specific requirements. ...@@ -659,4 +659,3 @@ specific requirements.
if any, to sign a "copyright disclaimer" for the program, if necessary. if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>. <http://www.gnu.org/licenses/>.
<img src="https://git.duniter.org/clients/python/silkaj/raw/main/docs/images/silkaj_logo.svg" width="250" />
# Silkaj # Silkaj
- CLI Duniter client written with Python 3. [![Version](https://img.shields.io/pypi/v/silkaj.svg)](https://pypi.python.org/pypi/silkaj)
[![License](https://img.shields.io/pypi/l/silkaj.svg)](https://pypi.python.org/pypi/silkaj)
[![Python versions](https://img.shields.io/pypi/pyversions/silkaj.svg?logo=python&label=Python&logoColor=gold)](https://pypi.python.org/pypi/silkaj)
[![Code format](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![Coverage report](https://git.duniter.org/clients/python/silkaj/badges/main/coverage.svg)](https://silkaj.duniter.org/latest/coverage/)
[![Website](https://img.shields.io/website/https/silkaj.duniter.org.svg)](https://silkaj.duniter.org)
[![Dev pipeline status](https://git.duniter.org/clients/python/silkaj/badges/main/pipeline.svg)](https://git.duniter.org/clients/python/silkaj/)
[![types - Mypy](https://img.shields.io/badge/types-Mypy-blue.svg)](http://www.mypy-lang.org/)
[![Built with Material for MkDocs](https://img.shields.io/badge/Material_for_MkDocs-526CFE?style=for-the-badge&logo=MaterialForMkDocs&logoColor=white)](https://squidfunk.github.io/mkdocs-material/)
Command line client for Ğ1 libre-currency powered by Duniter
- [Website](https://silkaj.duniter.org) - [Website](https://silkaj.duniter.org)
## Install ## Install
### With release
Download [last release](https://git.duniter.org/clients/python/silkaj/tags) with `wget`.
Check it's integrity comparing it to `silkaj_sha256sum`:
```bash
sha256sum silkaj
```
Add executable permissions: ### Distribution
Install with your favorite package manager. See below the [packaging status paragraph](#packaging-status).
### Pipx
If you want a more recent version [install with pipx](https://silkaj.duniter.org/latest/install/):
```bash ```bash
chmod a+x silkaj sudo apt install pipx
pipx install silkaj
``` ```
### Manually ### Docker images
- [Install inside a Python environemnt](doc/install_pyenv.md)
- [Install without Python environment](doc/install_on_the_system.md) There is two kind of images. One build with `pip` for user purposes, and one using Poetry for developer purposes.
- [Build an executable with Pyinstaller](doc/build_with_pyinstaller.md)
- [Install as a drop-down for GNOME Shell with Argos](doc/argos.md) - [Docker images](https://silkaj.duniter.org/latest/contributing/container_usage/)
### For contributing purposes
- [Install the Poetry development environment](https://silkaj.duniter.org/latest/contributing/install_poetry/)
- Check out the [contributing guidelines](https://silkaj.duniter.org/latest/contributing/)
## Usage ## Usage
- Get help usage with `-h`, `--help` or `--usage` options, then run:
- Get help usage with `-h` or `--help` options, then run:
```bash ```bash
./silkaj <sub-command> silkaj <sub-command>
``` ```
- Will automatically request and post data on `duniter.org 10901` main Ğ1 node. Silkaj command line interface (CLI) is structured by groups of commands:
- Specify a custom node with `-p` option: ```sh
```bash silkaj blockchain -h
./silkaj <sub-command> -p <address>:<port> silkaj money -h
silkaj money transfer -h
silkaj wot revocation -h
``` ```
## Features You can find commands at the root, such as `silkaj license`
- Currency information
- Show amount of account - Will automatically request and post data on https://g1.duniter.org/node/summary official Ğ1 endpoint.
- Send transaction
- Proof-of-Work difficulties: Σ diffi, Π diffi, match - Specify a custom node with `-ep` option where `<port>` and `<path>` are optional:
- network information tab:
- endpoints, ip6, ip4, domain name and port. Handle nodes sharing same pubkey.
- pubkey, uid, if member.
- Proof-of-Work difficulties.
- generated block and median times.
- nodes versions.
- current block n°, hash and time.
- Issuers last ones or all: hash, gentime, mediantime
## Example
```bash ```bash
./silkaj network silkaj -ep <hostname>:<port>/<path> <sub-command>
### 20 peers ups, with 15 members and 5 non-members
| domain | ip4 | port | block | hash | gen_time | uid |member| pubkey |diffi| version |
|---------------------+----------------+------+-------+-------------+----------+-----------+------+--------+-----+----------|
| cgeek.fr | 88.174.120.187 | 9330| 41166 | 000027421F… | 15:59:00 | cgeek | yes | HnFcS… | 77 | 0.31.0b6 |
| mirror1.cgeek.fr | 88.174.120.187 | 9331| 41166 | 000027421F… | 15:59:00 | | no | 4jT89… | | 0.31.0b6 |
| mirror2.cgeek.fr | 88.174.120.187 | 9332| 41166 | 000027421F… | 15:59:00 | | no | AZ2JP… | | 0.31.0b6 |
| …t.duniter.inso.ovh | | 80| 41166 | 000027421F… | 15:59:00 | inso | yes | 8Fi1V… | 231 | 0.30.17 |
| peer.duniter.org | 51.255.197.83 | 8999| 41166 | 000027421F… | 15:59:00 | | no | BSmby… | | 0.30.17 |
| desktop.moul.re | 78.227.107.45 | 24723| 41166 | 000027421F… | 15:59:00 | moul | yes | J78bP… | 77 | 0.31.0b7 |
| misc.moul.re | 78.227.107.45 | 8999| 41166 | 000027421F… | 15:59:00 | moul | yes | J78bP… | 77 | 0.31.0b7 |
| test-net.duniter.fr | 88.189.14.141 | 9201| 41166 | 000027421F… | 15:59:00 | kimamila | yes | 5ocqz… | 385 | 0.31.0b3 |
| raspi3.cgeek.fr | 88.174.120.187 | 8999| 41166 | 000027421F… | 15:59:00 | | no | G3wQw… | | 0.31.0a9 |
| duniter.vincentux.fr| | 8999| 41166 | 000027421F… | 15:59:00 | vincentux | yes | 9bZEA… | | 0.30.17 |
| remuniter.cgeek.fr | 88.174.120.187 | 16120| 41166 | 000027421F… | 15:59:00 | remuniter…| yes | TENGx… | | 0.30.17 |
| | 88.163.42.58 | 34052| 41166 | 000027421F… | 15:59:00 | cler53 | yes | 4eDis… | 77 | 0.30.17 |
| suchard.si7v.fr | 163.172.252.3 | 8999| 41166 | 000027421F… | 15:59:00 | hacky | yes | DesHj… | 77 | 0.31.0a8 |
| | 87.91.122.123 | 9330| 41166 | 000027421F… | 15:59:00 | mmpio | yes | BmDso… | 154 | 0.31.0b3 |
| …er.help-web-low.fr | 151.80.40.148 | 8999| 41166 | 000027421F… | 15:59:00 | pafzedog | yes | XeBpJ… | 154 | 0.30.17 |
| | 87.90.32.15 | 8999| 41166 | 000027421F… | 15:59:00 | nay4 | yes | BnSRj… | 77 | 0.31.0a9 |
| duniter.modulix.net | 212.47.227.101 | 9330| 41166 | 000027421F… | 15:59:00 | modulix | yes | DeCip… | | 0.30.17 |
| | 88.174.120.187 | 33036| 41166 | 000027421F… | 15:59:00 | | no | GNRug… | | 0.31.0b7 |
| duniter.cco.ovh | 163.172.176.32 | 8999| 41166 | 000027421F… | 15:59:00 | charles | yes | DA4PY… | 77 | 0.31.0a8 |
| duniter.ktorn.com | 107.170.192.122| 8999| 41166 | 000027421F… | 15:59:00 | ktorn | yes | BR5DD… | 77 | 0.30.17 |
``` ```
## Features
### Currency information & blockchain exploration
- Check the present currency information stand
- Display current proof of work difficulty level to generate the next block
- Explore the blockchain block by block
### Money management
- Transaction emission
- Multi-recipients transaction support
- Read transaction recipients and amounts from a file
- Consult wallets balances
- Consult wallet history
### Web-of-Trust management
- Look up for public keys and identities
- Check sent and received certifications and consult the membership status of any given identity in the Web of Trust
- Certification emission
- Membership emission
- Revocation file handling
- [DeathReaper: exclusions reports on Discourse forums](https://silkaj.duniter.org/latest/usage/deathreaper/)
### Authentication
- Authentication methods: Scrypt, Seedhex, PubSec, and (E)WIF
### Others
- Account storage
- Display Ğ1 monetary license
- Public key checksum
## Wrappers
- [Multi-recipients transfers and automation](https://silkaj.duniter.org/latest/usage/multi-recipients_transfers_and_automation)
- [Transaction generator written in Shell](https://gitlab.com/jytou/tgen)
- [Ğ1Cotis](https://git.duniter.org/matograine/g1-cotis)
- [G1pourboire](https://git.duniter.org/matograine/g1pourboire)
- [Ğ1SMS](https://git.duniter.org/clients/G1SMS/)
- [Ğmixer](https://git.duniter.org/tuxmain/gmixer-py/)
- [printqrjune](https://github.com/jbar/printqrjune)
### Dependencies ### Dependencies
Silkaj is based on Python dependencies:
- [Tabulate](https://bitbucket.org/astanin/python-tabulate/overview): to display charts. Silkaj is based on following Python modules:
- [Commandlines](https://github.com/chrissimpkins/commandlines): to parse command and sub-commands.
- [PyNaCl](https://github.com/pyca/pynacl/): Cryptography (NaCl) library. - [Click](https://click.palletsprojects.com/): Composable command line interface toolkit
- [scrypt](https://bitbucket.org/mhallin/py-scrypt): scrypt key derivation function. - [DuniterPy](https://git.duniter.org/clients/python/duniterpy/): Most complete client oriented Python library for Duniter/Ğ1 ecosystem
- [pyaes](https://github.com/ricmoo/pyaes): Pure-Python implementation of AES - [Pendulum](https://pendulum.eustace.io/): Datetimes made easy
- [texttable](https://github.com/foutaise/texttable/): Creation of simple ASCII tables
### Names ### Names
I wanted to call that program: I wanted to call that program:
- bamiyan - bamiyan
- margouillat - margouillat
- lsociety - lsociety
- cashmere - cashmere
I finally called it `Silkaj` as `Silk` in esperanto. I finally called it `Silkaj` as `Silk` in esperanto.
## Packaging status
[![Packaging status](https://repology.org/badge/vertical-allrepos/silkaj.svg?columns=2)](https://repology.org/project/silkaj/versions)
## Integrate it on a dropdown menu to the panel
Under GNOME Shell, with [Argos](https://github.com/p-e-w/argos) extension:
- [Install Argos](https://github.com/p-e-w/argos#installation)
- Put inside `~/.config/argos/silkaj.30s.sh`:
```bash
#!/usr/bin/env bash
/path/to/silkaj/silkaj argos
```
Add execution premission:
```bash
chmod u+x ~/.config/argos/silkaj.30s.sh
```
Argos should the script and reload it every 30 seconds.
# Build with Pyinstaller
## Install Pyinstaller
```bash
pip install pyinstaller
```
If you are using Pyenv, don’t forget to save pyinstaller install:
```bash
pyenv rehash
```
## Build
```bash
pyinstaller src/silkaj.py --hidden-import=_cffi_backend --hidden-import=_scrypt --onefile
```
You will found the exetuable file on `silkaj/dist` folder.
# Install Silkaj on the system
## Retrieve sources
Clone repository:
```bash
git clone https://github.com/duniter/silkaj.git
```
## Dependencies
You may install dependencies.
You could install all dependencies from `pip`.
If you choose to install from distribution packages, some dependencies could be missing.
You will have to install them with `pip`.
### From pip
```bash
sudo pip3 install -r requirements.txt
```
Use `pip` command if `pip3` is not present.
Upgrade `pip` adding `--upgrade pip` to previous command.
### From distributions package managers
#### Debian-like
```bash
sudo apt-get install python-tabulate python-ipaddress
```
#### Fedora
```bash
sudo dnf install python-devel python-ipaddress python3-tabulate python3-pynacl python3-devel python-pyaes
```
# Install Silkaj on a Python environment
## Install Pyenv
### Install pyenv tools
```bash
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
```
### Handle shell modifications: point 2,3 and 4.
- [Follow pyenv install documentation](https://github.com/pyenv/pyenv#installation)
### Install latest Python version and create pyenv
```bash
pyenv install 3.6.0
pyenv shell 3.6.0
pyenv virtualenv silkaj-env
```
## Install Silkaj
### Retrieve silkaj sources
```bash
git clone https://github.com/duniter/silkaj.git
cd silkaj
```
### Install dependencies and store them on pyenv environement
```bash
pip install -r requirements.txt --upgrade
pyenv rehash
```
### Activate pyenv and run silkaj
```bash
pyenv activate silkaj-env
./silkaj
```
authors:
moul:
name: Moul
description: Silkaj and DuniterPy developer
# `latest/` is too much with `mkdocs serve`
# hack to have it displayed with mike
avatar: ../latest/images/Moul.png
# Blog
---
date:
created: 2016-09-16
authors:
- moul
categories:
- release
---
# Silkaj: new CLI Duniter client
I am pleased to announce a new Duniter client!
It's a client from CLI (command line interface) written with Python 3.
- [Diaspora\* post](https://framasphere.org/posts/2226277)
- [Code repository](https://github.com/duniter/silkaj) with a tutorial to install it.
This client was started almost two weeks ago and needed to be mature enough before public release.
<!-- more -->
## Features
You could see the [result of one of its best sub command `network`](https://github.com/duniter/silkaj#example):
```{..yaml .no-copy}
./src/silkaj.py network
### 20 peers ups, with 15 members and 5 non-members
| domain | ip4 | port | block | hash | gen_time | uid |member| pubkey |diffi| version |
|---------------------+----------------+------+-------+-------------+----------+-----------+------+--------+-----+----------|
| cgeek.fr | 88.174.120.187 | 9330| 41166 | 000027421F… | 15:59:00 | cgeek | yes | HnFcS… | 77 | 0.31.0b6 |
| mirror1.cgeek.fr | 88.174.120.187 | 9331| 41166 | 000027421F… | 15:59:00 | | no | 4jT89… | | 0.31.0b6 |
| mirror2.cgeek.fr | 88.174.120.187 | 9332| 41166 | 000027421F… | 15:59:00 | | no | AZ2JP… | | 0.31.0b6 |
| …t.duniter.inso.ovh | | 80| 41166 | 000027421F… | 15:59:00 | inso | yes | 8Fi1V… | 231 | 0.30.17 |
| peer.duniter.org | 51.255.197.83 | 8999| 41166 | 000027421F… | 15:59:00 | | no | BSmby… | | 0.30.17 |
| desktop.moul.re | 78.227.107.45 | 24723| 41166 | 000027421F… | 15:59:00 | moul | yes | J78bP… | 77 | 0.31.0b7 |
| misc.moul.re | 78.227.107.45 | 8999| 41166 | 000027421F… | 15:59:00 | moul | yes | J78bP… | 77 | 0.31.0b7 |
| test-net.duniter.fr | 88.189.14.141 | 9201| 41166 | 000027421F… | 15:59:00 | kimamila | yes | 5ocqz… | 385 | 0.31.0b3 |
| raspi3.cgeek.fr | 88.174.120.187 | 8999| 41166 | 000027421F… | 15:59:00 | | no | G3wQw… | | 0.31.0a9 |
| duniter.vincentux.fr| | 8999| 41166 | 000027421F… | 15:59:00 | vincentux | yes | 9bZEA… | | 0.30.17 |
| remuniter.cgeek.fr | 88.174.120.187 | 16120| 41166 | 000027421F… | 15:59:00 | remuniter…| yes | TENGx… | | 0.30.17 |
| | 88.163.42.58 | 34052| 41166 | 000027421F… | 15:59:00 | cler53 | yes | 4eDis… | 77 | 0.30.17 |
| suchard.si7v.fr | 163.172.252.3 | 8999| 41166 | 000027421F… | 15:59:00 | hacky | yes | DesHj… | 77 | 0.31.0a8 |
| | 87.91.122.123 | 9330| 41166 | 000027421F… | 15:59:00 | mmpio | yes | BmDso… | 154 | 0.31.0b3 |
| …er.help-web-low.fr | 151.80.40.148 | 8999| 41166 | 000027421F… | 15:59:00 | pafzedog | yes | XeBpJ… | 154 | 0.30.17 |
| | 87.90.32.15 | 8999| 41166 | 000027421F… | 15:59:00 | nay4 | yes | BnSRj… | 77 | 0.31.0a9 |
| duniter.modulix.net | 212.47.227.101 | 9330| 41166 | 000027421F… | 15:59:00 | modulix | yes | DeCip… | | 0.30.17 |
| | 88.174.120.187 | 33036| 41166 | 000027421F… | 15:59:00 | | no | GNRug… | | 0.31.0b7 |
| duniter.cco.ovh | 163.172.176.32 | 8999| 41166 | 000027421F… | 15:59:00 | charles | yes | DA4PY… | 77 | 0.31.0a8 |
| duniter.ktorn.com | 107.170.192.122| 8999| 41166 | 000027421F… | 15:59:00 | ktorn | yes | BR5DD… | 77 | 0.30.17 |
```
---
date:
created: 2022-04-18
authors:
- moul
categories:
- release
---
# v0.10.0
Silkaj team is pleased to announce the stable release of Silkaj version 0.10.0
The most important changes are highlighted in this article, if you are looking for a comprehensive list of changes, check out the changelog.
## Introduction
This release comes with the handling of the complete life cycle of the revocation file,
the ability to read transaction amounts and recipients listing from a file, convenient for recurrent transaction.
Last but not least, the code handling Ğ1 monetary license has been refactored.
The upstream changes have been retrieved and now features the license into six languages.
Under the hood, Silkaj codebase has been updated to use DuniterPy v1.0,
which comes with breaking backward compatible changes on the `Documents` classes and
the drop of the asynchronous property.
As always, this release also comes with an emphasis on the development environment,
with `pre-commit` usage generalization with the introduction of new hooks.
<!-- more -->
## Revocation
The complete lifecycle of the revocation document and its storage in a file is now supported!
The `revocation` command comes with four sub-commands:
```{..yaml .no-copy}
silkaj revocation --help
Usage: silkaj revocation [OPTIONS] COMMAND [ARGS]...
Create, save, verify or publish revocation document. Subcommands optionally
take the path to the revocation document.
Options:
-h, --help Show this message and exit.
Commands:
publish Publish revocation document.
revoke Create and publish revocation document.
save Create and save a revocation document.
verify Verifies that a revocation document is correctly formatted and...
```
With these command, you can generate a revocation file, verify its integrity and publish to actually revoke an identity.
For the first time we implemented sub-subcommands thanks to Click.
In the future, we will implement more commands using this feature, since we now know how to implement it.
## Read transaction recipients and amounts from a file
You can now define a file following this format. For instance, a file named `recipients.txt`:
```title="recipients.txt"
<ABSOLUTE|RELATIVE>
# comment 1
<amount1> <pubkey1>
# comment 2
<amount2> <pubkey2>:[<checksum2>]
```
It lists the amounts and the recipients’ pubkeys for which the multi-recipients transaction will be issued.
The checksum can be append to the pubkey to have its integrity checked.
And pass it to `silkaj tx` command as follow:
```
silkaj --gtest tx -f recipients.txt
```
It will generate a multi-recipients transaction with the amounts in absolute or relative reference depending of the setted header (`ABSOLUTE` or `RELATIVE`).
## Ḡ1 Monetary license
The upstream repository containing the licenses has been updated.
This update brings fixes and improvements on the existing languages and brings additional new languages: Esperanto, Espagnol, Italian, and Portuguese
The display is now only displaying the embedded license files in the console, since it’s available in six up-to-date languages.
```{..yaml .no-copy}
silkaj license
In which language would you like to display Ğ1 monetary license? (es, en, eo, it, fr, pt) [en]: fr
```
The display in the browser has been removed since there were just two websites links to outdated licences in French and English.
## DeathReaper
If you missed DeathReaper crowdfunding completion, you can check this [message](https://forum.duniter.org/t/je-me-presente-je-suis-deathreaper-alias-la-faucheuse/6539/83) or the complete post if you have not been aware of.
## Silkaj Docker image
The automated generation of Silkaj Docker images has been implemented in the first place to distribute DeathReaper.
This is a new way to install Silkaj and its environment. This is convenient to distribute non-stable releases.
You can find the [documentation on how to use these images](../../contributing/container_usage.md).
## Network
- The asynchronous property has been dropped. The HTTP library usage has been migrated from `asyncio` to `urllib`
- The global option to specify a custom endpoint has been renamed from `-p/--peer` to `-ep/--endpoint`
- Silkaj network layer has been refactored, bringing a more robust code
## DuniterPy v1.0
Support have been added to support DuniterPy v1.0 which came with many breaking backward compatible changes in the `Documents` classes.
## Meta
This release introduces support for Python v3.10 and drops support for Python v3.6.
## Development Environment
`pre-commit` usage has been generalized with `black`, `isort`, `pyupgrade`, `insert-license`, and `gitlab-ci-linter` hooks.
These hooks are run as jobs into the CI.
## Thanks
moul, matograine
## Outlook
New `pre-commit` hooks (`pylint`, `flake8`, `mypy`) will be introduced to have more guardrails in order to ensure that future implementations will allow to reach higher code quality.
Then, it’s planned to migrate from `tabulate` to `Texttable`, and then restructure the repository.
Once these prerequisites have been completed, the emphasis will be put onto migrating to Duniter v2 using Substrate.
This means using new APIs: RPC, Subsquid, Using new documents called extrinsincs, and probably other changes.
---
date:
created: 2022-03-21
authors:
- moul
categories:
- rc
---
# Call for testing Silkaj v0.10.0rc
Hey fellow testers and early-adopters!
We are pleased to announce Silkaj v0.10.0 release candidate, and we would be happy to receive feedback before releasing it as stable.
<!-- more -->
## Pre-release installation
You can install this pre-release version from PyPI or from a Docker image.
To install the Python package, run following command:
```
pip3 install silkaj --user --upgrade --pre
```
To [install and run Silkaj from a container](../../contributing/container_usage.md):
```
sudo docker pull registry.duniter.org/clients/python/silkaj/release/pip:v0.10.0rc0
```
Run Silkaj from outside the image:
```
sudo docker run -it registry.duniter.org/clients/python/silkaj/release/pip:v0.10.0rc0 silkaj info
```
## Tests
Please test it globally, and check [v0.10.0 milestone short summary](https://git.duniter.org/clients/python/silkaj/-/milestones/9#code) which contains the changes which have been implemented during this development cycle.
Pay a special attention to the newly introduced revocation command.
Manual tests help us making sure everything works fine in different cases.
Here are some tests we think are necessary.
Make sure you test on Ğ1-Test network to avoid any revocation or loss of money to happen.
### Revocation
`revocation` command handle the revocation document in an extended way.
Check the sub-commands:
```
silkaj revocation --help
```
Make sure you are able to create new identities before proceeding.
Create a revocation file with an existing identity.
Verify the generated file, and publish it!
```
silkaj --gtest revocation save revocation_test.txt
silkaj --gtest revocation verify revocation_test.txt
silkaj --gtest revocation publish revocation_test.txt
```
Or directly all the previous steps with one command:
```
silkaj --gtest revocation revoke
```
### License
Check Ğ1 monetary license get displayed correctly in any language and in any configuration: workstation or headless computers.
```
silkaj license
silkaj --g1-license-web license
```
### Network, documents issuance
Silkaj’s network code layer have been completely rewritten, an other HTTP library is used, the asynchronous propery has been dropped, and the documents classes have been refactored.
Try any commands requesting information from the network or try sending any document.
```
silkaj info
silkaj -ep <hostname>:<port> membership
```
### Transaction recipients and amounts definition reading from a file
You can now define `recipients.txt` file following this format:
```title="recipients.txt"
ABSOLUTE
# moul-test
10 5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH:baK
# matograine
20 d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76LRN:FVm
```
And pass it to `silkaj tx` command as follow:
```
silkaj --gtest tx -f recipients.txt
```
Check that everything works fine with `RELATIVE` reference.
You can also check broken file, and see if Silkaj reacts properly to any error in the file format definition.
### Others
Feel free to play and look for hidden bugs and/or UI/UX improvements!
We are looking forward for your feedback!
______________________________________________________________________
The stable release is planned for April 16th 2022, which will be released with an announcement listing the new features as well as a detailed changelog.
Silkaj team
---
date:
created: 2022-11-27
authors:
- moul
categories:
- release
---
# Silkaj v0.11.0 release
Silkaj team is pleased to announce the stable release of Silkaj version 0.11.0
The most important changes are highlighted in this article, if you are looking for a comprehensive list of changes, check out the changelog.
## Introduction
This release comes with the `pipx` installation method, a new design of command line interface with commands separated in groups.
Last but not least, it contains the migration to `Texttable` table library, network improvements and fixes, and Python v3.11 support.
On the development environment side, the repository has been restructured, the code has been annotated with types, and linted.
`mypy` and `pylint` pre-commit hooks have been introduced. The tests have been separated into unit and integration tests.
`main` branch is new name of the main branch.
This release emphasis was put onto strengthen the development environment as well as improving the structure of Silkaj code base.
The goal was to do preparations and cleaning before Substrate migration in order to be fully focus onto it in next development cycle.
This release is the latest planned major release with Duniter v1/BMA support and the one planned to end into Debian 12 Bookworm.
<!-- more -->
## `pipx` installation method
`pipx` have been found to be a recommendable tool over `pip` to install an end-user Python software when the latter is not available in distributions repositories.
In addition to `pip` features, `pipx` creates virtual environments, which prevents conflicting dependencies among several installed Python software.
A nice feature of `pipx` is the `ensurepath` commands which takes care to add the Python executables path into the `PATH` environment variable, which can be found to be the trickiest part of the installation.
Silkaj documentation has been updated to suggest `pipx` instead of `pip`.
In short, you can install Silkaj via `pipx` this way:
```
sudo apt install pipx libsodium23
pipx install silkaj
```
For a comprehensive documentation, check the [installation documentation](../../install.md).
## New CLI design
The commands have been grouped into following groups: `blockchain`, `money`, and `wot`.
The other commands not related to these topics have been kept at the root of the CLI tree.
```{..yaml .no-copy}
silkaj --help
about Display program information
authentication Generate authentication file
blockchain Blockchain related commands
checksum Generate checksum out of a passed pubkey or an...
license Display Ğ1 monetary license
money Money management related commands
wot Web-of-Trust related commands
```
```{..yaml .no-copy}
silkaj blockchain --help
blocks Display blocks: default: 0 for current window size
difficulty Display the current Proof of Work difficulty level to...
info Display information about currency
verify Verify blocks’ signatures.
```
```{..yaml .no-copy}
silkaj money --help
balance Get wallet balance
history Display transaction history
transfer Transfer money
```
```{..yaml .no-copy}
silkaj wot --help
certify Send certification
lookup User identifier and public key lookup
membership Send and sign membership document: for first emission and...
revocation Create, save, verify or publish revocation document.
status Check received and sent certifications and consult the...
```
In this process following commands have been renamed:
```{..yaml .no-copy}
diffi −> difficulty
tx −> transfer
cert −> certify
revocation save −> revocation create
wot −> wot status
```
## Texttable
The code has been migrated from `tabulate` to `Texttable` external table libraries.
`Texttable` was introduced and was only used from the `history` command, where the other commands were using `tabulate`.
Both were used, and we had to make the choice to stick with one and get the opportunity to reduce the dependency list of one item.
The migration has been done. You will probably notice differences in the table style and the alignments in the columns.
Before, with `tabulate`:
```{..yaml .no-copy}
| uid | blocks | percent |
|-------------+----------+-----------|
| vit2 | 33 | 33.0 |
| Pini | 25 | 25.0 |
| moul-test | 24 | 24.0 |
| jytou4-test | 10 | 10.0 |
| jytou5-test | 8 | 8.0 |
```
Now, with `texttable`:
```{..yaml .no-copy}
│─────────────│────────│─────────│
│ uid │ blocks │ percent │
│═════════════│════════│═════════│
│ vit2 │ 33 │ 33 │
│ Pini │ 26 │ 26 │
│ moul-test │ 23 │ 23 │
│ jytou4-test │ 10 │ 10 │
│ jytou5-test │ 8 │ 8 │
│─────────────│────────│─────────│
```
## Network
Breaking network connection is something recurrent on local network with BMA.
A hack have been introduced to circumvent this issue with `sleep` calls between repetitive requests which retrieve user ids from public keys.
The singletons have been replaced with `@functools.lru_cache()` decorator usage.
They are both used to reduce the network traffic and therefore speed-up the commands execution.
They are basically allowing to reuse the result obtained from the first request in case the same request happen again.
In Silkaj, they are used to retrieve the UD value, the currency parameters, and the head block only once.
Singletons pattern has been a pain to handle specially within the tests. `@functools.lru_cache()` fixes that which comes in handy as a boilerplate.
## Argos
`argos` command have been removed. This command was displaying basic information similar to the `info` command but formatted for Argos.
Argos is a GNOME Shell extension which displays what has been generated out of a shell command into a GNOME Shell pop-over.
This command has been found not to be really used and poorly maintained. It has been decided to be remove in the meantime.
## Python 3.11
This release introduces support for Python v3.11 released on the 24th of October 2022.
## Repository restructuration
As well as the new CLI commands grouping, the runtime and the tests code have been classified into following directories: `blockchain`, `money`, and `wot`.
In addition to that, there is now a Python file per command and files for "helpers" and tools placed aside.
## Development Environment
New `pre-commit` hooks have been introduced: `mypy`, `pylint`, `autoflake`, `pre-commit-hooks`, and `mdformat`.
Type annotations has been introduced in the whole runtime code.
This greatly improves the code quality, specially now that the code is fully typed, and linted.
It will be of great help in future developments.
The tests have been separated into `unit` and `integration` tests directories. This separation makes things clearer.
The unit tests are pretty quick to be performed, where the integration tests takes more time since they require network requests.
On the CI side, now just one job runs the integration tests in the job generating the coverage.
Integration tests were known to fail because of the unstable nature of the network. Now, in case the integration tests fails, it is only necessary to restart one job.
The branch workflow changed to a unique `main` branch which takes over the `dev` and `master` branches.
The coverage integration into GitLab has been fixed.
## Thanks
moul, matograine
## Outlook
v0.20.0 is planned to be the next release. It will be fully dedicated to add support for Duniter v2 based on Substrate framework.
Duniter v1/BMA support will be dropped from Silkaj v0.2x branch, while v0.1x will still be maintained until we productively switch to Duniter v2.
But, no new features will be implemented on v0.1x branch.
This development cycle might take some time, so it is expected to get preview releases.
v0.20.0 development cycle is planned as follow.
The network layer needs to be adapted to use following APIs: Substrate RPC, and Hasura indexer’s using GraphQL.
Then, It is planned to migrate current features and commands.
Finally, new v2 related features will be implemented.
In this development cycle, parallel developments might occur, such as setting up the new website or the configuration support implementation in Silkaj.
We are looking forward for a better future with the migration of Duniter on Substrate framework.
---
date:
created: 2022-11-12
authors:
- moul
categories:
- rc
---
# Call for testing Silkaj v0.11.0rc0
Hey fellow testers and early-adopters!
We are pleased to announce Silkaj v0.11.0 release candidate, and we would be happy to receive feedback before releasing it as stable.
<!-- more -->
It is planned to be the latest release with Duniter v1/BMA support and the release to enter Debian 12 Bookworm.
## Pre-release installation
You can install this pre-release version from PyPI or from a Docker image.
To install the Python package, run following command:
Install `pipx` from the [installation documentation](../../install.md):
```
sudo apt install pipx
pipx install --pip-args "\--pre" silkaj
```
To [install and run Silkaj from the container](../../contributing/container_usage.md):
```
sudo docker pull registry.duniter.org/clients/python/silkaj/release/pip:v0.11.0rc0
```
Run Silkaj from outside the image:
```
sudo docker run -it registry.duniter.org/clients/python/silkaj/release/pip:v0.11.0rc0 silkaj
```
## Tests
Please check [v0.11.0 milestone short summary](https://git.duniter.org/clients/python/silkaj/-/milestones/15) as well as the changelog containing the changes which did happen during this development cycle.
Structural changes were made, so please check Silkaj is still working in its entirety.
Manual tests help us making sure everything works fine in different cases.
Make sure you test it on Ğ1-Test network to avoid a revocation or any money loss to happen.
## Pipx installation
Test that the newly introduced [`pipx` method installation documentation](../../install.md) works fine in your case, with your particular Unix system.
Tell us how can the documentation be improved, if a non-obvious step for you is missing or if a necessary package isn't listed for Silkaj to work on your system.
## New CLI design
Silkaj commands have been reorganized into following groups: `blockchain`, `money`, `wot`.
Some commands not related to these contexts have been kept in the top-level group.
Tell us if the new CLI design with sub-sub-commands compared to the previous one with all the commands at the top-level instead fits best, is less convenient, is following a more structured logic.
```{..yaml .no-copy}
Commands:
about Display program information
authentication Generate authentication file
blockchain Blockchain related commands
checksum Generate checksum out of a passed pubkey or an...
license Display Ğ1 monetary license
money Money management related commands
wot Web-of-Trust related commands
```
## Table generation
The underlying table generation library has been changed.
Tell us if the tables are displaying content correctly, or if any improvement can be done, or if a regression got introduced.
### Others
Feel free to play and look for hidden bugs and/or UI/UX improvements!
We are looking forward for your feedback!
______________________________________________________________________
The stable release is planned on November 26th 2022, which will be released with a detailed announcement explaining the changes.
Silkaj team
---
date:
created: 2023-08-14
authors:
- moul
categories:
- minor
---
Bug fix release, because `libnacl` brought in a breaking change.
- Bump DuniterPy to v1.1.1 [duniterpy#206](https://git.duniter.org/clients/python/duniterpy/-/issues/206)