diff --git a/docs/blog/posts/v0.12.0.md b/docs/blog/posts/v0.12.0.md new file mode 100644 index 0000000000000000000000000000000000000000..02060e6b05c27006cf55d7b130b489cbc3408c58 --- /dev/null +++ b/docs/blog/posts/v0.12.0.md @@ -0,0 +1,295 @@ +--- +date: + created: 2025-04-22 +authors: + - moul +categories: + - release +--- + +# Silkaj v0.12.0 release + +I am pleased to announce the stable release of Silkaj version 0.12.0 + +In this article, the most important changes are highlighted. if you are looking for a comprehensive list of changes, check out the changelog. + +## Introduction + +The original plan changed, a difficult choice has been made to work on a second development cycle tied to v1 ecosystem, because v2 ecosystem was not fully ready. +It was worth it for Silkaj project’s growth with huge improvements not tied to v1 nor v2 ecosystems. +It was difficult to go in a slightly different direction, since all contributors’ energy was directed to v2 ecosystem development. +Ğcli took over the role as the first CLI client on v2 ecosystem. Silkaj made little progress on v2 ecosystem. +But, as for v0.11.0, this release also paves the way for implementations based on v2 ecosystem. + +This release comes with the account storage implementation which greatly improves the authentication and revocation files management. +A new documentation website has been set up. +`money history` command features the comma-separated value (CSV) output file format option. +The command line interface has seen great improvements such as a usage with colors, a better error output, the shell completion, and a small help option. +Ğ1 monetary license have been updated, and DeathReaper is now released as part of Silkaj. +Last but not least, Silkaj comes with minor network optimisations and Python 3.13 support. + +This release is the last planned major release with Duniter v1/BMA support. + +<!-- more --> + +## Account storage: authentication and revocation files storage improvements + +Account storage has been implemented to store authentication and revocation files in a common place organized per account and per currency. +Therefore, authentication and revocation files generated by Silkaj would no longer lay anywhere on the operating system. +By default, they used to be saved to and read from current working directory. +This wrong practice is now behind us. +In addition the files are now stored with `600` permissions, meaning that only the Unix user who created them are allowed to read and edit them. + +Furthermore, a consequent change has been made to restrict the storage to only WIF and EWIF authentication file formats defined in the approved [RFC#13](https://git.duniter.org/documents/rfcs/-/blob/master/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md). +It improves the security, by focusing the effort on a single authentication file format for v1 ecosystem. +v2 ecosystem might bring in an additional file format, which could bring additional confusions. + +Therefore, it is no longer possible to authenticate with all the implemented methods. +The authentication is now restricted to WIF or EWIF authentication files format stored in the account storage. +`authentication` command the only one still allowing all the implemented authentication methods as input in order to perform the migration. +To migrate to this new authentication method stored into the account storage, you have to run follow command: + +``` +silkaj --account <account_name> authentication <--auth-method> +``` + +Based on this new authentication way, you can run commands using (E)WIF authentication from the account storage, i.e.: + +``` +silkaj --account <account_name> money balance +``` + +For further details, check out the [account storage documentation](../../usage/account_storage.md). + +## New documentation website + +[Previous website](https://git.duniter.org/websites/silkaj_website), created in 2019 by Attilax, was based on a solution not maintainable over time. +Its technology couldn’t scale up and integrate markdown documentation from the repository. +Therefore, its content quickly became outdated. +In 2020, an [other website solution](https://git.duniter.org/websites/doc_silkaj) based on VuePress was suggested by ManUtopiK which uses markdown documentation. +This solution wasn’t selected and didn’t went productive mainly because I did not have the full control over it. +The fact that VuePress is based on JavaScript technologies is a downside to me. + + + +I found out about [MkDocs](https://www.mkdocs.org/) and the great [Material theme](https://squidfunk.github.io/mkdocs-material/). +This documentation software based on Python is widely used in Python community. +I decided to go with this solution which ticked all the check-boxes. +The initial structure has been set up within the repository. +Following integration plugins have been set up: Click command line interface documentation, test coverage, GitLab issue and merge requests links which is useful in the changelog. +A blog contains the releases announcements. +Continuous deployment has been set up to automatically build and deploy documentation updates to GitLab Pages. +Mike, a system which allows to display the documentation for multiple major releases of Silkaj have been set up. +A drop-down allows to select the documentation dedicated to a version. This should, at least, be helpful for Silkaj v0.1x and v0.2x which will greatly differ. +Finally, a [page](../../contributing/documentation.md) describes how to contribute to the website. + +## CSV output on `money history` command + +``` +silkaj money history <pubkey> --csv-file history.csv +``` + +This command will save the account’s money movements history in the specified file in CSV format (comma-separated value). +You can then operate the data with a spreadsheet software. +The output looks as follow: + +```{..yaml .no-copy} +Date,Issuers/Recipients,Amounts Ğ1,Amounts UDĞ1,Reference +2024-10-24 16:26:55,8ve5XAupWT9NMRbXUnZvQwBCFoq5DQ18bBdjGZciw3wm:Dpf,30.96,2.7992766726943943,Oignons fantastiques merci +2024-10-24 01:34:28,8jWwwyRZMrRsidfVpsGdQGC5zd8pbRDTHrYDwf2kDcrL:9YE,0.25,0.022603978300180832,Dividende Epicerie +``` + +## Command line interface + +### Rich-click + +The command line interface now has a nicer usage interface and looking with colors (missing below) thanks to [`rich-click`](https://github.com/ewels/rich-click), a Click add-on. + +```{..yaml .no-copy} +silkaj --help + + Usage: silkaj [OPTIONS] COMMAND [ARGS]... + +╭─ Basic options ─────────────────────────────────────────────────────────────╮ +│ --help -h Show this message and exit. │ +│ --version -v Show the version and exit. │ +╰─────────────────────────────────────────────────────────────────────────────╯ +╭─ Endpoint and currency specification ───────────────────────────────────────╮ +│ --endpoint -ep TEXT Without specifying this option, the default endpoint │ +│ reaches Ğ1 currency on its official endpoint: │ +│ https://g1.duniter.org. --endpoint allows to specify │ +│ a custom endpoint following `<host>:<port>/<path>` │ +│ format. `port` and `path` are optional. In case no │ +│ port is specified, it defaults to 443. NOTE: This │ +│ argument is mutually exclusive with arguments: │ +│ [gtest]. │ +│ --gtest -gt Uses official ĞTest currency endpoint: │ +│ https://g1-test.duniter.org NOTE: This argument is │ +│ mutually exclusive with arguments: [endpoint]. │ +╰─────────────────────────────────────────────────────────────────────────────╯ +╭─ Account and authentication specification ──────────────────────────────────╮ +│ --account -a TEXT Account name used in storage │ +│ `$HOME/.local/share/silkaj/$currency/$account_name` │ +│ for authentication and revocation. │ +│ --password -p TEXT EWIF authentication password. If you use this option, │ +│ prefix the command with a space so the password is │ +│ not saved in your shell history. In case of an │ +│ encrypted file, password input will be prompted. │ +╰─────────────────────────────────────────────────────────────────────────────╯ +╭─ Options ───────────────────────────────────────────────────────────────────╮ +│ --display -d Display the generated document before sending it │ +│ --dry-run -n By-pass the licence and confirmation. Do not send the │ +│ document, but display it instead │ +╰─────────────────────────────────────────────────────────────────────────────╯ +╭─ Commands ──────────────────────────────────────────────────────────────────╮ +│ about Display program information │ +│ authentication Generate and store authentication file │ +│ blockchain Blockchain related commands │ +│ checksum Generate checksum out of a passed pubkey or an │ +│ authentication method. Checks if the passed checksum is │ +│ valid. │ +│ license Display Ğ1 monetary license │ +│ money Money management related commands │ +│ wot Web-of-Trust related commands │ +╰─────────────────────────────────────────────────────────────────────────────╯ +``` + +A better error output: + +```{..yaml .no-copy} +silkaj -a test wot revocation verify + + Usage: silkaj wot revocation verify [OPTIONS] + + Try 'silkaj wot revocation verify -h' for help +╭─ Error ─────────────────────────────────────────────────────────────────────╮ +│ /home/moul/.local/share/silkaj/g1/test/revocation.txt not found for account │ +│ name: test │ +╰─────────────────────────────────────────────────────────────────────────────╯ +``` + +### Shell completion + +This information has been missed, but Click v8.0 comes with an integrated shell completion feature. +Therefore, it can be set from Silkaj v0.10.0 onward. To set up the shell completion follow the [shell completion documentation](../../install.md#shell-completion). + +### Small help option + +In addition to the `--help` option, it is now possible to pass the small help option `-h` to all sub-commands. + +## Renaming transfer comment to reference + +The free "comment" field in Duniter v1’s Transaction document has been extensively used in a slightly wrong manner. +Banks use _Payment reference_ term for this field which can be used to refer to a contract number for instance. + +It has been decided to rename it in order for the users to think about using it the appropriate way. +The fields in `money transfer` and `money history` user interface has been renamed to "reference". +The important change here is `--comment/-c` option from `money transfer` has been renamed to `--reference/-ref`. + +## `wot status` command displays precise expiration date of received certifications + +For better monitoring of our certifications and to maintain our membership, `wot status` command now displays precise expiration dates of received certifications. +Previously they were computed and were very imprecise with three months of inaccuracy! + +Silkaj v0.11: + +```{..yaml .no-copy} +│───────────────────│──────────────────│────────────────│──────────────────│ +│ received_expire │ received │ sent │ sent_expire │ +│═══════════════════│══════════════════│════════════════│══════════════════│ +│ December 3, 2024 │ Matograine ✔ │ vit │ October 1, 2024 │ +│ October 11, 2025 │ HugoTrentesaux ✔ │ Zheny │ October 26, 2025 │ +│ December 19, 2025 │ BenoitLavenier ✔ │ HugoTrentesaux │ August 17, 2026 │ +│ December 21, 2025 │ nicoleC ✔ │ Matograine │ August 17, 2026 │ +│ July 9, 2026 │ vit ✔ │ │ │ +│ August 20, 2026 │ tuxmain ✔ │ │ │ +│ August 20, 2026 │ kapis │ │ │ +│───────────────────│──────────────────│────────────────│──────────────────│ +``` + +Silkaj v0.12: + +```{..yaml .no-copy} +│───────────────────│──────────────────│────────────────│──────────────────│ +│ received_expire │ received │ sent │ sent_expire │ +│═══════════════════│══════════════════│════════════════│══════════════════│ +│ February 21, 2025 │ Matograine ✔ │ vit │ October 1, 2024 │ +│ January 8, 2026 │ HugoTrentesaux ✔ │ Zheny │ October 26, 2025 │ +│ March 21, 2026 │ BenoitLavenier ✔ │ HugoTrentesaux │ August 17, 2026 │ +│ March 23, 2026 │ nicoleC ✔ │ Matograine │ August 17, 2026 │ +│ October 16, 2026 │ vit ✔ │ │ │ +│ November 28, 2026 │ tuxmain ✔ │ │ │ +│ January 28, 2025 │ kapis ✘ │ │ │ +│───────────────────│──────────────────│────────────────│──────────────────│ +✔: Certification written in the blockchain +✘: Pending certification, deadline treatment +``` + +The expiration date of sent certifications are still computed and should not be really taken into account. +They were not changed since this is a bit more complex to do with BMA API, and also less important than the received certifications. +No additional time should be spent on v1 ecosystem, but should instead go to v2 ecosystem :wink: + +## Ğ1 monetary license update + +German and Catalan new translations have been added to Ğ1 monetary license. +Spanish and Italian translations have been improved. +The French copy has been updated to v0.3 which includes rules on how to change the document. + +## DeathReaper is now released as part of Silkaj + +DeathReaper used to be maintained on a separated `git` branch and only distributed via containers. +This was made because its main dependency `pydiscourse` is not packaged in Debian repositories. +This could be a reason to make an update of Silkaj Debian package unnecessary harder. + +A solution has been set up to activate `wot exclusions` command only once `pydiscourse` dependency is installed. +This way, Debian packaging is still possible without having to package `pydiscourse`. + +Therefore, DeathReaper has been merged on `main` branch. +Check out [DeathReaper documentation](../../usage/deathreaper.md) on how to install and use it. + +## BMA optimisations + +On BMA API, the Web-of-Trust related requests now have an argument to specify whether we passed a public key or an identity username. +Silkaj is specifying this argument which provides faster replies to the queries. + +## Python versions support + +This release introduces official support for Python v3.12 and v3.13. + +[Pendulum](https://pendulum.eustace.io/) datetime library was lacking maintenance and had no Python v3.13 support. +I replaced Pendulum with [Arrow](https://arrow.readthedocs.io/). +Just before Silkaj release, Pendulum v3.1 has been released with Python 3.13 support. +I reverted back to Pendulum usage. + +`request_url()` has been fixed in [DuniterPy v1.2.1](https://git.duniter.org/clients/python/duniterpy/-/blob/main/CHANGELOG.md#v121-26th-march-2025) to support Python 3.13. + +On the other hand, Python v3.7 and v3.8 support have been dropped. + +## Development Environment + +Ruff replaces `black`, `autoflake`, `pylint`, `isort` and `pyupgrade` pre-commit hooks. +The latter is written in Rust and is blazing faster compared to the latter. + +When publishing a release, the pipeline will automatically create a release page on Silkaj repository. + +## Removals + +With this release being the last one planned with Duniter v1/BMA support, some commands do not make sense anymore with v2 Substrate ecosystem. +Therefore `blockchain verify` has been removed from this release. +`checksum` and `blockchain difficulty` commands will be removed out of next release. + +## Outlook + +v0.20.0 is planned to be the next release. +It will be focus onto adding support for Duniter v2 based on Substrate framework. +Duniter v1/BMA support will be dropped from Silkaj v0.2x branch, while v0.1x will be on maintenance mode until Ğ1 currency switches productively to Duniter v2 ecosystem. +No new features will be implemented on v0.1x branch. +v0.20 development cycle might take some time, therefore it is expected to get preview releases. + +The migration to v2 ecosystem is planned as follow: The network layer will be adapted to use following APIs: Substrate RPC, and Subsquid indexer via its Hasura GraphQL API. +Then, it is planned to migrate current features and commands. +Finally, in a following release new v2 related features will be implemented. + +We are looking forward for a better experience with Ğ1 currency migration to v2 ecosystem based on Substrate framework and Subsquid indexer. + +Once the porting to Duniter v2 Substrate reaches an interesting point, a v0.30.0 release is planned to implement a GUI based on [Textual](https://www.textualize.io/) framework which run in the terminal, and can also run in a web browser. diff --git a/docs/changelog.md b/docs/changelog.md index 476072f621a34657de7605bc6d5403ec8a4ca617..78fc07aae2b52f4c82d431949b48ef110eb5d6f2 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -3,6 +3,74 @@ hide: - navigation --- +## v0.12.0 <small>April 22, 2025</small> { id="0.12.0" } + +### [Milestone v0.12.0](https://git.duniter.org/clients/python/silkaj/-/milestones/20) + +### Code + +- !244, #470: Support BMA optimizations +- !253, !254, !256, #443: Merge DeathReaper `256_excluded` branch on `main` branch +- !265, !270, !276, #258: Implement CSV output on `history` command +- !268, #490: `wot status`: Display precise expiration date of received certifications +- !283, #471: Rename transfer’s comment to reference +- !251, #351: Delete `blockchain verify` command +- !267, #124: Convert `OrderedDict` to `dict` + +#### Account storage support: authentication and revocation improvements + +- !277, #477: Account storage support: `authentication`, `revocation` +- !240, #420: Rework authentication file path +- !249, #481: Save revocation file as only readable and writeable as user (`600` permission) +- !248, #435: Revocation: remove `--dry-run` and `--display` options from `save` and `verify` commands, drop default revocation file path + +#### Command-line interface + +- !241, #466: Make the CLI looks better with `rich-click` +- #166: Document shell completion set-up +- !242, #469: Use `click.Path()` +- !243, #419: Implement `-h` small `--help` option for all commands +- !279, #501: Replace `sys.exit()` with `click.Context.fail()` for better user output +- !246: Rework endpoints usage doc and CLI options help + +### Website + +- !271, !281, #433, #196: Set up new website structure with MkDocs +- !280, #277: Integrate releases announcements into the website +- !282, #502: Generate automatic CLI interface documentation with mkdocs-click +- !285: Add v0.12.0 announcement and changelog, release v0.12.0 + +### Project + +- #483: Switch DuniterPy usage back to PyPI release +- !257, !278, #473: Update Ğ1 Monetary license +- !247, #459: Rework project description +- !233: CI change, coverage url fix, documentation, hooks bump + +#### Python versions + +- !237, #457: Drop Python v3.7 support +- !263, #464: Drop Python v3.8 support +- !238, #474: Initial Python v3.12 support +- !250, #448: Add support for Python v3.12 +- !264, #482: Add support for Python v3.13 + - !269, !284, #492: Migrate from Pendulum to Arrow datetime lib + +#### Copyright + +- !231, #417: Update copyright to 2023 +- !258, #456: Update copyright to 2024 +- !272, #485: Update copyright to 2025 + +### Development Environment + +- !234, !236, !245, !273, #458: Introduce Ruff pre-commit hook to replace black, autoflake, pylint, isort and pyupgrade +- !275, #499: Support Poetry v2 syntax +- !274, #498: pip container does no longer include `g1_monetary_license` +- !252, #480: Update `.gitignore` +- [duniterpy#205](https://git.duniter.org/clients/python/duniterpy/-/issues/205): `gitlab-ci-linter` is broken since GitLab v16 +- !259, #454: Set up release feature from gitlab-ci + ## v0.11.2 <small>November 22, 2023</small> { id="0.11.2" } - #484: Support Python v3.12 on v0.11 release diff --git a/docs/usage/account_storage.md b/docs/usage/account_storage.md index 817db0803c0c188c561d6bbf8151e4794e8c2eac..9d4733aa474904c4123286660e417506fb99bb45 100644 --- a/docs/usage/account_storage.md +++ b/docs/usage/account_storage.md @@ -7,17 +7,17 @@ It is recommended to use the storage instead of storing and reading these files They are stored into `$XDG_DATA_HOME/silkaj`, aka `$HOME/.local/share/silkaj/$currency/$account_name` as: - `revocation.txt` -- `authentication_file_ed25519.dewif` for v1 WIF and EWIF formats based on the approved [RFC n°13](https://git.duniter.org/documents/rfcs/-/blob/master/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md?ref_type=heads). +- `authentication_file_ed25519.dewif` for v1 WIF and EWIF formats based on the approved [RFC n°13](https://git.duniter.org/documents/rfcs/-/blob/master/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md). - `authentication_file_sr25519.json` for v2 encrypted json format The account name is a local name given to a wallet. -It does not necessarily need to be the same identity nickname/alias stored into the blockchain. +It does not necessarily need to be the same identity username stored into the blockchain. No verification what so ever is performed to check any correspondence between the local name stored into Silkaj account storage and the one stored on the blockchain or the indexer. ## Per currency storage The storage is organized per currencies. -Depending on the specified endpoint with the endpoint options (`--endpoint`, `--gtest`) the currency will be determined. Based on the latter, it will stored into `g1` or `g1-test` directory. +Depending on the specified endpoint with the endpoint options (`--endpoint`, `--gtest`) the currency will be determined. Based on the latter, it will be stored into `g1` or `g1-test` directory. ## Authentication @@ -32,7 +32,7 @@ Next command will store the authentication file in `$HOME/.local/share/silkaj/g1 silkaj --account test authentication <authentication option> ``` -Note: `g1` and `test` folders comes respectively from the default Ğ1 endpoint and `test` from the account passed. +Note: `g1` and `test` folders come respectively from the default Ğ1 endpoint and `test` from the name of the passed account. ### Reading diff --git a/pyproject.toml b/pyproject.toml index 1846302548a0469fb4ede927620ca93ecc4076cc..9c306c67fa9219c5aa37033d7079215330b45bc4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "silkaj" -version = "0.11.0" +version = "0.12.0" description = "Command line client for Ğ1 libre-currency powered by Duniter" license = { text = "AGPL-3.0-or-later" } readme = "README.md" diff --git a/silkaj/constants.py b/silkaj/constants.py index 01a762b02e526f45f1bf72f5a5a482fbb58e6acd..f2eff130ce7103029a31c1a6d4f8b111d7b3eb41 100644 --- a/silkaj/constants.py +++ b/silkaj/constants.py @@ -13,7 +13,7 @@ # You should have received a copy of the GNU Affero General Public License # along with Silkaj. If not, see <https://www.gnu.org/licenses/>. -SILKAJ_VERSION = "0.11.0" +SILKAJ_VERSION = "0.12.0" G1_SYMBOL = "Ğ1" GTEST_SYMBOL = "ĞTest"