silkaj issueshttps://git.duniter.org/clients/python/silkaj/-/issues2024-03-27T23:28:41+01:00https://git.duniter.org/clients/python/silkaj/-/issues/166Document shell completion set up2024-03-27T23:28:41+01:00Jonas SmedegaardDocument shell completion set upHi,
Would be nice if silkaj registered with bash to offer TAB-completion of its various command-line options and arguments.
This seems helpful: https://stackoverflow.com/questions/52282173/extending-bash-completion-with-python-clickHi,
Would be nice if silkaj registered with bash to offer TAB-completion of its various command-line options and arguments.
This seems helpful: https://stackoverflow.com/questions/52282173/extending-bash-completion-with-python-click0.12.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/179Generate man pages2024-03-27T21:27:13+01:00MoulGenerate man pages- https://salsa.debian.org/cryptocoin-team/silkaj/blob/debian/master/debian/rules#L12
For Debian and other distros- https://salsa.debian.org/cryptocoin-team/silkaj/blob/debian/master/debian/rules#L12
For Debian and other distrosBackloghttps://git.duniter.org/clients/python/silkaj/-/issues/487Move sources in `src` directory2024-03-27T21:18:01+01:00MoulMove sources in `src` directory…as [recommended by Python packaging](https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/).
- [ ] Move `silkaj` directory in `src` directory
- [ ] Add this commit in a `.git-blame-ignore-revs`?…as [recommended by Python packaging](https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/).
- [ ] Move `silkaj` directory in `src` directory
- [ ] Add this commit in a `.git-blame-ignore-revs`?Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/18Use a Terminal based and/or Graphical user interface2024-03-14T15:09:31+01:00MoulUse a Terminal based and/or Graphical user interfaceCurrently silkaj is using dirty one-shot `os.system("clear")` then `texttable` libs to display charts.
It's not possible to sort lines and to keep open all this charts. It could also be possible to see evolving charts.
Silkaj could be ...Currently silkaj is using dirty one-shot `os.system("clear")` then `texttable` libs to display charts.
It's not possible to sort lines and to keep open all this charts. It could also be possible to see evolving charts.
Silkaj could be a multiple user interface client. Silkaj would stay a CLI client. Then, I would preferably go first for a console/TUI client using `textual`/`blessed`, then a GUI client using `PyGObject`/`GTK4`.
We could have three modes with different features depending on the interface:
- `silkaj-cli`
- `silkaj-console/tui`
- `silkaj-gtk/gui`
---
### TUI
- #440+
#### Curses libraries
> All in Debian
- [blessed](https://github.com/jquast/blessed) − [doc](https://blessed.readthedocs.io/en/stable/index.html)
- [urwid](https://github.com/urwid/urwid)
- [curtisies](https://github.com/thomasballinger/curtsies)
- [terminaltables](https://github.com/Robpol86/terminaltables)
- [npyscreen](https://pypi.org/project/npyscreen/) − [Blog article](https://medium.com/@ValTron/create-tui-on-python-71377849879d)
- [picotui](https://github.com/pfalcon/picotui)
- [asciimatics](https://github.com/peterbrittain/asciimatics)
- [bitcoind-ncurses2](https://github.com/esotericnonsense/bitcoind-ncurses2)
#### Curses
To do so, I suggest to use `curses` lib.
We could takes example and use curses lib used on XMPP console client [Poezio](https://poez.io).
- [(es) Prez](https://www.youtube.com/watch?v=CoWmLJVtTQs)
#### Inspiration
- [Ranger](https://github.com/ranger/ranger/tree/master/ranger/gui)
- [Poezio](https://lab.louiz.org/poezio/poezio/-/tree/master/poezio/ui)
---
### GTK/PyGObject
- https://pygobject.readthedocs.io/en/latest/
- https://rafaelmardojai.pages.gitlab.gnome.org/pygobject-guide/gtk4.html
- https://www.bassi.io/articles/2022/12/02/on-pygobject/
- https://www.gtk.org/
- Could also be a solution, but it would need lots of work.
- Could be a nice way to have it on the Librem 5/PinePhone
- Modern Python applications which uses Python3/GTK+3: [Lollypop](https://wiki.gnome.org/Apps/Lollypop).
[Pitivi](https://en.wikipedia.org/wiki/Pitivi), ([Gajim](https://en.wikipedia.org/wiki/Gajim), [Deluge](https://en.wikipedia.org/wiki/Deluge_(software))).
#### GTK3+
- [pgi API](https://lazka.github.io/pgi-docs/)
- [Python GTK3 Tutorial](https://python-gtk-3-tutorial.readthedocs.io/en/latest/)
#### GTK4
- [Tutorial](https://belmoussaoui.com/article/5-how-to-create-a-gtk-application-using-python-part-1)
- [The Simplicity of Making Librem 5 Apps](https://puri.sm/posts/the-simplicity-of-making-librem-5-apps/)
- https://github.com/ToshioCP/Gobject-tutorial
- https://github.com/ToshioCP/Gtk4-tutorial
- https://bestofcpp.com/repo/ToshioCP-Gtk4-tutorial
- http://ssalewski.de/gtkprogramming.html
- https://docs.gtk.org/gtk4/getting_started.html
#### Slint
- https://github.com/slint-ui/slint/
- https://slint.dev/
- v1.5.0 adds Python API support
- Rust based
- Multiple platforms native: web, Android, …
---
### GUI Desktop frameworks
- https://www.analyticsindiamag.com/8-python-gui-frameworks-for-developers/
### Terminal not based on Ncurses (in Debian)
- [python-prompt-toolkit](https://github.com/prompt-toolkit/python-prompt-toolkit)
### Web framework
- [Flask](https://github.com/pallets/flask): [click-web click module](https://github.com/fredrik-corneliusson/click-web), would generate forms from CLI commands and options
- [Sanic](https://github.com/huge-success/sanic)
### Web/Multi-platform/Android
- [GUY : un module python3 pour créer des GUI multiplateforme (android aussi!)](https://linuxfr.org/users/manatlan/journaux/guy-un-module-python3-pour-creer-des-gui-multiplateforme-android-aussi)
- [wuy](https://github.com/manatlan/wuy), [guy](https://github.com/manatlan/guy)
- [Kivy](https://kivy.org/#home)
- [BeeWare](https://beeware.org/):
- [Toga](https://github.com/beeware/toga), in alpha stage, based on GTK+3, https://toga.readthedocs.io/en/latest/
- [Article](https://pyfound.blogspot.com/2020/05/cpython-on-mobile-platforms.html)
- [Using Python for Mobile Development: Kivy vs BeeWare](https://dbader.org/blog/python-mobile-development-kivy-vs-beeware)
### GUI from the CLI
- [Gooey](https://github.com/chriskiehl/Gooey)
### ~~Aioconsole~~
- ~~https://github.com/vxgmichel/aioconsole~~ This is an `async`/`await` Python console0.30.0https://git.duniter.org/clients/python/silkaj/-/issues/433Set up new website structure with MkDocs2024-03-13T21:17:47+01:00MoulSet up new website structure with MkDocs## MkDocs
- https://www.mkdocs.org/
- https://github.com/mkdocs/mkdocs
- https://github.com/mkdocs/catalog
- https://repology.org/badge/vertical-allrepos/python:mkdocs.svg
- https://repology.org/badge/vertical-allrepos/mkdocs.svg
- Used ...## MkDocs
- https://www.mkdocs.org/
- https://github.com/mkdocs/mkdocs
- https://github.com/mkdocs/catalog
- https://repology.org/badge/vertical-allrepos/python:mkdocs.svg
- https://repology.org/badge/vertical-allrepos/mkdocs.svg
- Used by [substrate-interface](https://polkascan.github.io/py-substrate-interface/), [Textual](https://textual.textualize.io/), [Pipx](https://pypa.github.io/pipx/), and [Ruff](https://docs.astral.sh/ruff/)
- Allows to build markdown docs from the repository
- Very simple static framework website written in Python
## Tasks
### MkDocs initial set-up
- [x] Read the User Guide
- [x] `pyproject.toml`: Introduce `mkdocs` dependencies in `doc` group
- [x] Set-up initial project `mkdocs.yml`
- [x] Move `md` files to default `docs` directory
- [x] Set symlinks for changelog, contributing(, readme)
- [x] Choose theme: [material](https://squidfunk.github.io/mkdocs-material/)
- [x] Set favicon
- [x] Night/day switch
- [x] Set-up navigation with current content
### Deployment
```yaml
poetry install --only docs
poetry run mkdocs build -d public
```
- [x] Support website/documentation per releases and development one with [Mike](https://github.com/jimporter/mike):
- Drop-down support to switch between ie `v0.12` and `main`
- [x] Mike git commits changes to `pages` branch. Add `.gitlab-ci.yml` on this branch to publish the website and its’s multiple versions (no need schedule)
- [x] On `pages` branch: basic `.gitlab-ci.yml` to copy the content into a `public` directory and publish to GitLab Pages via a `pages` job
- [GitLab Pages implementation](https://gitlab.com/groups/gitlab-org/-/epics/10914), will come later in the Community edition
- https://pypi.org/project/lightweight-versioned-gitlab-pages/
- https://stackoverflow.com/questions/55596789/deploying-gitlab-pages-for-different-branches/58915486#58915486
- only on `main` branch and `tag`? Set `RELEASE` variable to `0.12` or to `0.20-dev`.
- how to handle the coverage and website deployments?
- [`mkdocs-coverage`](https://github.com/pawamoy/mkdocs-coverage)
- `website` job [`needs:`](https://docs.gitlab.com/ee/ci/yaml/#needs) `tests:3.12:cov` job artifact
- https://stackoverflow.com/a/64008569
- handle coverage display on `main` branch, don’t display `Coverage` tab when on release branch? Always display.
- [x] Protect `pages` branch
- [ ] Update coverage badge link to website coverage path
- [x] Adapt GitLab Pages deployment: Ansible role, now from Silkaj repository
- Not sure if Ansible configuration would work with three paths `clients/python/silkaj`
### Document contribution
- [x] How to install `mkdocs`, serve the docs, build locally
- Link mkdocs, material, mike, coverage, gitlab … docs
### Set up structure and use existing content
- [x] Fix `mkdocs serve` warnings
- [x] Update links in release notes, contributing(, readme)
- [x] `README.md` `CONTRIBUTING.md`: update links to the URL of this website
- [x] Create index/main page inspired from [Textual one](https://github.com/Textualize/textual/blob/d958f5bf778a3807ba75884fe15134c6dc294460/docs/index.md)
- [x] Clean and proofread current documentation
- move container usage (and poetry installation) to install section? Advanced installation, somehow contributing stuff. Nope?
- [x] enable syntax highlight, fix code block where we don’t want it
- [x] enable code block copy where needed
- [x] Id anchors in changelog
- [x] Move `CHANGELOG.md` to `docs/changelog.md`, with the `{ id=0.11.0 }` it might get ugly looking at it on GitLab. Same for `CONTRIBUTING.md`, Drop them from GitLab "syntax", not sure for the logos
- [x] create `CHANGELOG.md` and `CONTRIBUTING.md` referring to those pages on the website
- [x] structure `docs` folder: `usage`, `contributing`
- [x] Introduce [`mdformat-mkdocs`](https://github.com/KyleKing/mdformat-mkdocs) to format with four spaces bullet points
- [x] Keep `mike` `prefix_path` to `public`, serving to http://localhost:8000/pages (needs doc precision) or select `version.json`, `latest`, and `0.12` items in the artifact
- [x] Integrate generated coverage with [`mkdocs-coverage`](https://github.com/pawamoy/mkdocs-coverage)
- [x] Changelog with [`mkdocs-gitlab-plugin`](https://pypi.org/project/mkdocs-gitlab-plugin/):
- had to find the `gitlab_links` plugins name in `setup.py`, report that it would be great to have it in the readme: contribute
- Would be great to being able to [link other projects such as DuniterPy](https://gitlab.inria.fr/vidjil/mkdocs-gitlab-plugin/-/issues/1)
- [x] Blog tab containing releases notes:
- [x] Move `releases_notes` directory in `docs/blog` directory
- [x] Set up built-in `mkdocs-material` blog (not [`mkdocs-blogging-plugin`](https://github.com/liang2kl/mkdocs-blogging-plugin))
- Yaml frontmatter kept: [`mdformat-frontmatter`](https://github.com/butler54/mdformat-frontmatter)
- [x] Add [excerpts](https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/#adding-an-excerpt)
- [x] Add [authors](https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/#adding-authors)
- [x] Local author profile picture not available from archive, category slug, set up url formats
- [x] Set up categories/tags for the releases and RC testing to separated them
- [x] [Add badge](https://squidfunk.github.io/mkdocs-material/blog/2023/11/30/adding-a-badge-to-your-project/) to readme and GitLab repo badges
- [x] [disable fonts coming from Google gstatic](https://github.com/squidfunk/mkdocs-material/issues/739#issuecomment-377978270)
- [x] Retrieve valuable content from current and Vue websites (no real value left: intro text maybe?)
### Archive current websites
- [x] Archive [two other websites repositories](https://git.duniter.org/websites)
- https://git.duniter.org/websites/silkaj_website
- https://git.duniter.org/websites/doc_silkaj
Set them as archives. Visible in [the archived tab](https://git.duniter.org/groups/websites/-/archived). Redirect, saying that the website is now in Silkaj repository
Thank Manutopik for the Vue website solution which wasn’t retained.
I prefer MkDocs: it’s written in Python, it’s simple, (no JS), I have full control over it0.12.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/486Website follow-ups2024-03-11T22:39:00+01:00MoulWebsite follow-ups### Advanced content
- [ ] Add new content to documentation: #479+
- [ ] Improve index/readme/first page
- [ ] #277+
- [ ] Set up [`mkdocs-rss-plugin`](https://guts.github.io/mkdocs-rss-plugin/)
- Fix warnings about temporary files gen...### Advanced content
- [ ] Add new content to documentation: #479+
- [ ] Improve index/readme/first page
- [ ] #277+
- [ ] Set up [`mkdocs-rss-plugin`](https://guts.github.io/mkdocs-rss-plugin/)
- Fix warnings about temporary files generated in `/tmp` for coverage and blog
- [ ] Website navigation thinking
- [ ] Automatically generate CLI usage with [`mkdocs-click`](https://github.com/mkdocs/mkdocs-click) (#179+)
- [ ] #468+: automatically generate screenshots
- [ ] Donation page: to Silkaj and Duniter projects
### Set up new domain name
- [ ] Domain name: silkaj.${tld}?
- [ ] Choose domain name, rent it
- [ ] CNAME to pages.duniter.org
- [ ] Adapt Ansible conf
- [ ] Set silkaj.duniter.org redirection to new domain
<!--
- https://en.wikipedia.org/wiki/.ml
- https://en.wikipedia.org/wiki/.lc
.click, .site, .website, .world
-->0.20.0https://git.duniter.org/clients/python/silkaj/-/issues/468rich-codex: Automate terminal screenshot for doc2024-03-11T22:36:41+01:00Moulrich-codex: Automate terminal screenshot for doc- https://github.com/ewels/rich-codex
- https://ewels.github.io/rich-codex/- https://github.com/ewels/rich-codex
- https://ewels.github.io/rich-codex/Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/277Store releases announcements into this git repository2024-03-11T22:36:40+01:00MoulStore releases announcements into this git repositoryCould be into this repository, but in the website repository it would make more sense. As we have to store images, and this could be displayed on a blog, changelog page.
- [v0.11.{1,2}](https://forum.duniter.org/t/silkaj-v0-11-0-release/...Could be into this repository, but in the website repository it would make more sense. As we have to store images, and this could be displayed on a blog, changelog page.
- [v0.11.{1,2}](https://forum.duniter.org/t/silkaj-v0-11-0-release/10087/3)
- [v0.8.1](https://forum.duniter.org/t/silkaj-v0-8-0-release/7686/7)
- !145+
- [Silkaj v0.7.x releases: DuniterPy](https://forum.duniter.org/t/silkaj-v0-7-x-releases-duniterpy/6099)
- [Silkaj v0.6.x releases: Let’s install](https://forum.duniter.org/t/silkaj-v0-6-x-releases-let-s-install/4858)
- [Silkaj v0.5.0 release: Let’s certify!](https://forum.duniter.org/t/silkaj-v0-5-0-release-let-s-certify/4712)
- [Silkaj v0.4.0 release](https://forum.duniter.org/t/silkaj-v0-4-0-release/4071)
- [Silkaj v0.3.0 release: Let's send money!](https://forum.duniter.org/t/silkaj-v0-3-0-release-lets-send-money/2404)
- [No announcement for the v0.2.0: just a changelog, the announcement was done in the v0.3.0 looks like](https://git.duniter.org/clients/python/silkaj/-/releases)
- [Silkaj: new CLI Duniter client](https://forum.duniter.org/t/silkaj-new-cli-duniter-client/1278)
## Todos
- [ ] Import them, including images
- [ ] Proofreads them
- [ ] Fix milestones hard-coded urls, missing `/-/milestone/#`, use i.e. %"0.20.0" instead0.20.0https://git.duniter.org/clients/python/silkaj/-/issues/479Document Silkaj usage2024-03-11T22:36:40+01:00MoulDocument Silkaj usage- [ ] Installation
- [ ] CLI basics: group of commands, general and command specific options
- [ ] Authentication: already in `account_storage`, move it somewhere else?
- [x] #477+
- [ ] `wot` commands:
- [ ] `lookup`
- [ ] `status`
...- [ ] Installation
- [ ] CLI basics: group of commands, general and command specific options
- [ ] Authentication: already in `account_storage`, move it somewhere else?
- [x] #477+
- [ ] `wot` commands:
- [ ] `lookup`
- [ ] `status`
- [ ] `certify`
- [ ] `membership`
- [ ] `revocation`
- [ ] `money` commands:
- [ ] `transfer`
- [ ] transfer to multiple recipients
- [ ] transfer with recipients from a file
- [ ] `balance`
- [ ] `history`
- [ ] `license`
- [ ] `blockchain` commands:
- [ ] `info`
- [ ] `blocks`
- [ ] How to
- [ ] How to create a wallet
- [ ] How to become member
- [ ] FAQ
To be put later on the website #433+0.20.0https://git.duniter.org/clients/python/silkaj/-/issues/477Account storage support: authentication, revocation2024-02-29T08:56:19+01:00MoulAccount storage support: authentication, revocation- https://askubuntu.com/a/14536
- Storage per currency, per account name
- `$XDG_DATA_HOME`|`$HOME/.local/share/silkaj/${currency}`
- `${account_name}`: defined by the user, passed via general/specific option `-a/--account`
- `revo...- https://askubuntu.com/a/14536
- Storage per currency, per account name
- `$XDG_DATA_HOME`|`$HOME/.local/share/silkaj/${currency}`
- `${account_name}`: defined by the user, passed via general/specific option `-a/--account`
- `revocation.txt`
- `authentication_file_${format}.json`: Silkaj would discover which format is it, v1 formats will be dropped at some point
## Implementation
### Account storage
* [x] Introduce global `-a/--account` option
* [x] Storage class into `silkaj/storage.py` with tests `tests/units/test_storage.py`
### Authentication
Read from `--auth-*` method, store into account storage:
```plaintext
silkaj --account <account> authentication --auth-*
```
Need special handling of `--auth-*` and `--account` options separately in the authentication selection handling for the `authentication` command. Other commands using the authentication should read only from `--account`. The `authentication` command is kind of a converter command from `--auth-*` methods to account storage.
Use `authentication` command as an importer from scattered files to this account storage structure
* [x] Move `--auth-*` options as `authentication` specific options?
- Con: Would no longer allow easy authentication on other commands
- Pro: Would force more secure account storage usage, conversion
* [x] Set authentication methods as `MutuallyExclusive`
* [x] Implementation in `authentication` command to store in the account storage
* [x] Support a better default authentication file format creation in the storage than `seedhex`?
* [x] Implement [(E)WIF](https://git.duniter.org/documents/rfcs/-/blob/master/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md) authfile saving #173
* [ ] Discover which authfile format it is: v1 (seedhex, pubsec), v2 (encrypted json)
- `authentication_file_ed25519.txt`, `authentication_file_sr25519.json`
* [ ] Write tests
### Revocation
```plaintext
# read auth file, write revocation file
silkaj --account <account> wot revocation create
# read revocation file
silkaj --account <account> wot revocation {verify,publish}
```
* [x] `create` read authfile from `--account` and write revocation file into `--account`
* [x] `verify`/`publish`: consume file from general `--account` option
* [ ] Write tests
### Importer command?
- `account import`
- import already generated auth and revocation files to an account?
### New Account label
- [x] replace `Storage` label
### Documentation
- [x] Write documentation how this works (input as general option, output as command-specific option)
- [x] Update `README.md§Features` with `Account (storage)` and `Authentication methods`.
### `account` commands
- `account list` command
```py
def list(self):
for root, dirnames, filenames in self.path.parent.walk():
print(root, dirnames, filenames)
```
- list available accounts per currencies: there contents, auth file, revocation file
- following implementations can all be done with Unix commands. To be done in a follow-up ticket?
- instead of a copy to the right place?
- `account remove $account`: remove complete account, remove only authentication or revocation file?
- `account rename $old_name $new_name`0.12.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/440Set console interface with Textual console/TUI framework2024-01-17T15:02:33+01:00MoulSet console interface with Textual console/TUI framework- Maintain both CLI and Console interfaces using same backend
## Prerequisites
- Read documentation, tutorials, get familiar with the framework, try PoC
## Implementation
- [ ] Install `textual` and [`textual-dev`](https://github.com/...- Maintain both CLI and Console interfaces using same backend
## Prerequisites
- Read documentation, tutorials, get familiar with the framework, try PoC
## Implementation
- [ ] Install `textual` and [`textual-dev`](https://github.com/Textualize/textual-dev)
- [ ] Find a way to have substrate client passed for the CLI and Console interfaces
- [ ] Sketch the views
- [ ] Implement the interfaces
- [ ] Write tests
### Design views of the interface
- https://excalidraw.com/ ([YunoHost package of excalidraw](https://github.com/YunoHost-Apps/excalidraw_ynh))
### Testing
- [Testing How-to](https://textual.textualize.io/guide/testing/)
- [pytest-asyncio](https://pypi.org/project/pytest-asyncio/)
- [pytest-textual-snapshot](https://github.com/Textualize/pytest-textual-snapshot)
## Launcher
- [ ] Create launcher, like for Vim, Neovim, Emacs, Ranger, so it can be started from GNOME Shell for instance
## Later
- Ploting: https://github.com/Textualize/textual-plotext
---
### About Textual
- [Repository](https://github.com/Textualize/textual)
- [Website](https://textual.textualize.io/)
- [Repology](https://repology.org/badge/vertical-allrepos/python:textual.svg)
- [Textual: The Definitive Guide](https://dev.to/wiseai/textual-the-definitive-guide-part-1-1i0p)
- [CSS in the Terminal with Python and Textual](https://www.willmcgugan.com/blog/tech/post/css-in-the-terminal-with-python-and-textual/)
- [Crash course on Fedora Magazine](https://fedoramagazine.org/crash-course-on-using-textual/)
### Videos
- [A Look At – and Inside – Textual](https://www.youtube.com/watch?v=1kTWxamIJ_k)
- [Terminal magic with Rich and Textual - Talk Python Live Stream](https://www.youtube.com/watch?v=laWyjfzur28)
- [CSS within the terminal with Python and Textual](https://www.youtube.com/watch?v=bXgIj2cXaZ4)
- [Will McGugan](https://www.youtube.com/c/WillMcGugan/videos)0.20.0https://git.duniter.org/clients/python/silkaj/-/issues/485Bump copyright to 20252023-12-09T14:01:05+01:00MoulBump copyright to 2025- [ ] Update to 2025:
- [In the header file](https://git.duniter.org/clients/python/silkaj/-/blob/main/CONTRIBUTING.md#update-copyright-year)
- In MkDocs config once #433+ is done
- [ ] Open ticket for 2026 and link it to this one- [ ] Update to 2025:
- [In the header file](https://git.duniter.org/clients/python/silkaj/-/blob/main/CONTRIBUTING.md#update-copyright-year)
- In MkDocs config once #433+ is done
- [ ] Open ticket for 2026 and link it to this one0.20.02024-12-10https://git.duniter.org/clients/python/silkaj/-/issues/429Migrate to Substrate2023-12-06T16:54:13+01:00MoulMigrate to SubstrateDuniter v2 Substrate support with `substrate-interface`:
- APIs: RPC, and GraphQL Hasura
---
- [`substrate-interface` repository](https://github.com/polkascan/py-substrate-interface)
- [`SubstrateInterface` documentation](https://polkas...Duniter v2 Substrate support with `substrate-interface`:
- APIs: RPC, and GraphQL Hasura
---
- [`substrate-interface` repository](https://github.com/polkascan/py-substrate-interface)
- [`SubstrateInterface` documentation](https://polkascan.github.io/py-substrate-interface/)
- [Extrinsincs: Runtime calls](https://duniter.org/wiki/duniter-v2/runtime-calls/)
- [Runtime events](https://duniter.org/wiki/duniter-v2/runtime-events/)
---
### Transition plan
- Release and maintain v0.12.0 as BMA-only
- v0.20.0dev as Substrate-only
Allow non-related developments/experimentation to happen in parallel?: Which would not create much git conflicts:
- #433+
- #79+: Seems the best candidate, the class development it-self, not the integration in the commands
- #18+, #440+: PyGObject3, Textual TUI console: Just experimentation of the possibilities, interface design, no integration
---
### Consider Hexagonal architecture
- duniterpy#117
- https://blog.octo.com/architecture-hexagonale-trois-principes-et-un-exemple-dimplementation/ [en](https://blog.octo.com/en/hexagonal-architecture-three-principles-and-an-implementation-example/)
---
### Set up Duniter v2s and indexer on ĞDev
- [x] [Set-up Duniter-v2s](https://duniter.org/wiki/duniter-v2/run-smith/)
- [ ] [Become smith](https://duniter.org/wiki/duniter-v2/become-smith/)
- [ ] Set-up Indexer: [Subsquid](https://forum.duniter.org/t/subsquid-for-gdev/10684), [duniter-indexer](https://git.duniter.org/manutopik/duniter-indexer)
### Plan
> - Split changes in child items/sub-tickets. Put them in the Kanban board and/or milestone.
> - Ideas from [Tikka roadmap](https://forum.duniter.org/t/feuille-de-route-de-tikka/8977)
> - [Matograine’s plan](https://git.duniter.org/matograine/silkaj/-/blob/ef232fb934249a15e2bb49580c2a8c8462b47a43/PLAN_TRANSITION_V2S.md)
- ~~Delete code of commands which will be rewritten, keep structure, pick code in git history for the reimplementation~~
- Delete step-by-step commands, functions which have been rewritten
#### Delete features which don’t make sense anymore and which are not very coupled
- [x] Delete `blockchain diffi`, since the PoW is no longer a thing with BABE/Grandpa consensus algorithm
- [x] Delete `blockchain verify` cmd, doesn’t make sense anymore, algorithm can be retrieved in the git history for next `blocks` implementation (#283)
- [x] Delete `checksum` command since the address integrity (checksum) and currency is integrated into the address.
#### Set up network layers
- [x] Introduce [`substrate-interface`](https://pypi.org/project/substrate-interface/) dependency
- [x] Set up RPC API network layer
- [ ] Set up GraphQL API network layer
#### Pre-requisites
- [ ] #477+
##### Authentication
###### v1/v2 methods handling
- [ ] Function to use v1/ED25519 or v2/SR25519 authentication to all commands depending on what has been passed
- [ ] save v1 auth files into config/auth directory
- [ ] Priority: v2 auth file, v1 methods. default?
- [ ] ~~Warn in the release note (and from TUI?) that v1 auth methods are deprecated and will be dropped in next release (after migration to Duniter v2s). Please convert your `authfiles` to v2 format.~~
- [ ] ~~Allow commands authentication only from encrypted json v2 format~~
- [ ] Not very useful feature. Delete ~~Command to [convert v2 pubkey v1 → ss58 v2s address](https://forum.duniter.org/t/python-script-to-generate-g1v2-genesis-json/9795/2)~~
###### v2 method
- [x] Implement Substrate authentication method: [create](https://polkascan.github.io/py-substrate-interface/reference/keypair/#substrateinterface.keypair.Keypair.export_to_encrypted_json), [read](https://polkascan.github.io/py-substrate-interface/reference/keypair/#substrateinterface.keypair.Keypair.create_from_encrypted_json)
- [ ] `save-authfile` command: ~~`Convert v1 authentication methods to encrypted v2 authentication json file format`~~
- Can’t save encrypted authfile from v1 authentication methods (ED25519)
- [ ] Encrypted json v2 format creation from `mnemonic` (#90+)
###### Status
- Having both (v1) ed25519 and (v2) sr25519 authentication methods makes things more complex
- Substrate interface does not support to save this cryptography into the json encrypted file format
###### Options
- [Will substrate-interface provide ed25519 to be save as json encrypted file format?](https://github.com/polkascan/py-substrate-interface/blob/40f255cbca1b32c429c3eb7f8d35fcd46e83efee/substrateinterface/keypair.py#L412-L417) Do we wait for it? Try to overwrite `Keypair.export_to_encrypted_json()` with `ed25519` support if it works (`super()`).
- Get rid of ed25519 auth methods from silkaj:
- transfer Ğ1 units from a ed25519 to an sr25519 (this transfer still requires v1 auth)
- Can we convert at the conversion stage from Nd.js to Substrate [with this migrator](https://git.duniter.org/tools/py-g1-migrator/-/blob/master/custom/addresses_switches.json)?
##### Others
- [ ] Get currency code/name from RPC
- [ ] Display fees per transaction and ask for confirmation (some are reimbursed, so mention the fees are reimbursed)
- [ ] Request `uids` from the indexer to set the link between the identity index and the identity nickname/alias
#### Migrate existing features
> (I): requires the indexer
- Get information from displaying commands from RPC queries:
- [x] `money balance`
- [ ] (I?) `info`
- [ ] (I?) `wot status`
- Adapt commands which send RPC calls extrinsics:
- [ ] `money transfer`: basic transfer, multi-recipients
- [ ] `wot certify`
- [ ] `wot membership`
- [ ] `wot revocation`
- Get information from displaying commands from the indexer:
- [ ] (I) `wot lookup`
- [ ] (I) `money history`
- [ ] `blockchain blocks`
#### Important features to be migrated
Only implemented by Silkaj, so once we switch the Ğ1 on Duniter-v2s, following features will stop serving:
- multi-recipients transfers to Ğ1 technical ecosystem remunerations
- DeathReaper: notifying the exclusions on the forums
#### Implement new features
- [ ] [UD creation](https://forum.duniter.org/t/implementation-creation-manuelle-du-du-et-guide-pour-dev-clients-wallet/9544)
- [ ] Display UDs in `history` command
- [ ] [Blacksmith sub-WoT](https://forum.duniter.org/t/la-sous-toile-forgerons/9047) handling
- [ ] Commands similar to normal wot?: `smith-wot`: `certify`, `lookup`, `membership`, `revocation`, `status`
- [ ] [Integrate Smith license](https://git.duniter.org/1000i100/g1_monetary_license/-/blob/master/smith_license/g1_smith_license_fr.adoc)
- [Becoming Smith diagram](https://forum.duniter.org/t/becoming-smith-as-a-bpmn-diagram/10980)
- [ ] Node administration via Unsafe RPC: `smith`: `rotate-key`, `go-offline`, `go-online`
- [ ] Check whether the RPC API connected to is in `Unsafe`, `Safe` mode
- [ ] Technical Committee: `tech-committee`: `list-members`, `list-proposals`, `vote`
#### Later
- [ ] #90+
- [ ] Change owner_key
- [ ] DeathReaper: Keep it similar listening to the blockchain events. Listen to exclusions from the indexer. Could be replaced with a feature onchain to report via email the exclusion. The indexer could store the email addresses. Having the emails accessible to everyone would be an issue for spam purposes. A private service/indexer should keep the emails.
- [ ] [Schedule transfer support](https://forum.duniter.org/t/gdev-virements-reguliers/9459)0.20.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/425Introduce humanize tool2023-11-27T21:56:19+01:00MoulIntroduce humanize toolCould be use in DeathReaper (commented comment in DR code).Could be use in DeathReaper (commented comment in DR code).0.20.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/437Issue to import libsodium on Windows2023-11-21T22:25:46+01:00MoulIssue to import libsodium on Windows```bash
OSError: Could not locate nacl lib, searched for libsodium
```
In DuniterPy we are using `libnacl` which requires `libsodium` to be installed on Unix from the distribution package
manager. On Windows, [it can be installed](https...```bash
OSError: Could not locate nacl lib, searched for libsodium
```
In DuniterPy we are using `libnacl` which requires `libsodium` to be installed on Unix from the distribution package
manager. On Windows, [it can be installed](https://stackoverflow.com/questions/47413755/installing-pythons-cryptography-on-windows).
For DuniterPy, we could use `PyNaCl`: duniterpy#83.
Or migrate to `substrate-interface` cryptography’s.Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/482Add support for Python v3.132023-11-20T14:27:16+01:00MoulAdd support for Python v3.13### Python pre-releases
- [ ] Set up v3.13 test job
- [ ] With `allow_failure: true`, to allow tests to fail
### Python stable release
- [ ] Remove `allow_failure: true`, now on the tests should pass
- [ ] Move coverage to v3.13 job
-...### Python pre-releases
- [ ] Set up v3.13 test job
- [ ] With `allow_failure: true`, to allow tests to fail
### Python stable release
- [ ] Remove `allow_failure: true`, now on the tests should pass
- [ ] Move coverage to v3.13 job
- [ ] Set default container used by jobs to v3.13
- [ ] Handle deprecation warning and breaking features
- [ ] Switch Silkaj image build to v3.13
### Post
- [ ] Open follow-up v3.14 tickets
### References
- Expected to be release the [October 1st 2024](https://peps.python.org/pep-0719/).
- docker/python3/poetry#10+
- clients/python/duniterpy#208+0.20.02024-10-01https://git.duniter.org/clients/python/silkaj/-/issues/446Publish on Spanish forum2023-11-13T15:06:54+01:00MoulPublish on Spanish forum- [ ] Setup DeathReaper account on https://foro.moneda-libre.org/
- [ ] Ask to make it administrator
- [ ] Generate token
- [ ] Implement Spanish forum handling in `excluded` command
- [ ] Spanish(/English) translation of the output
- [ ...- [ ] Setup DeathReaper account on https://foro.moneda-libre.org/
- [ ] Ask to make it administrator
- [ ] Generate token
- [ ] Implement Spanish forum handling in `excluded` command
- [ ] Spanish(/English) translation of the output
- [ ] DeathReaper repo: Setup Spanish Forum credentials for DeathReaper in CI/CD variables.
---
Priority to be considered regarding Substrate migration.
With Substrate, a better system could be setup. An web based email registration system, which would be listening to the blockchain/RPC or the Indexer and then send email. This would be a more efficient system, since now new G1 members do not necessarily have forums accounts.Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/462DeathReaper enhancements2023-11-13T15:06:54+01:00MoulDeathReaper enhancements### Display job link in the message
- [ ] New `--{job,pipeline}-link` Silkaj option to pass the link to the job which generated the message.
- [ ] [Predefined variables reference](https://docs.gitlab.com/ee/ci/variables/predefined_vari...### Display job link in the message
- [ ] New `--{job,pipeline}-link` Silkaj option to pass the link to the job which generated the message.
- [ ] [Predefined variables reference](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html): `CI_JOB_URL`, `CI_PIPELINE_URL`
- [ ] DeathReaper CI: pass `CI_JOB_URL` [GitLab predefined variable](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html)
`Generated [from job](link).`
### Report number of exclusions in the report
- [ ] as a header: `Number of exclusions since $T: $X`
### Ability to pass Discourse forums URLs as an option
- Great pre-requisite for #446+
- With multiple-values: `@click.option(multiple=True)`
- [ ] `--discourse-forums-urls/-dfu forum.monnaie-libre.fr forum.duniter.org foro.moneda-libre.org` `--api-key ml-fr, duniter, ml-es`
### Tests
- [ ] Add tests, since `excluded` coverage is 38%, and makes the total coverage drop from 81 to 77%Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/376Replace tools.message_exit() with sys.exit()2023-11-13T14:27:15+01:00MoulReplace tools.message_exit() with sys.exit()`sys.exit()` can print an error and send the appropriate error status to the shell.`sys.exit()` can print an error and send the appropriate error status to the shell.Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/283Common code between verify and blocks2023-10-21T09:01:48+02:00MoulCommon code between verify and blocks> Following #262
### Tasks
- [ ] common function to gather a range of blocks specifying `from_`, and `to`.
- [ ] common test on this function gathering blocks on a range by chunks
- [ ] two modes for `blocks` explorer:
- current: spec...> Following #262
### Tasks
- [ ] common function to gather a range of blocks specifying `from_`, and `to`.
- [ ] common test on this function gathering blocks on a range by chunks
- [ ] two modes for `blocks` explorer:
- current: specify number of blocks from head, 0 default to current window
- [ ] Same as verify: a range of blocks: blocks number `from` an `to`.
- [ ] How to specify/filter the two modes: `--range`, `--from-head`/`--head` (this one would be the default).
This could be a method into a class that would inherit the `@click.command` decorator. Would that work?
---
### Later
- [ ] command `blocks` with sub-commands `explorer`, `verify`, …: is this possible with Click?Backlog