From f424a731a53f263068eaacd5fd73495faab6b64d Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Wed, 20 Apr 2022 08:46:18 +0200 Subject: [PATCH] [mod] #428: Apply mdformat --- CHANGELOG.md | 131 ++++++++++++++++-- CONTRIBUTING.md | 44 ++++++ README.md | 24 ++++ doc/argos.md | 2 + doc/docker.md | 11 ++ ..._automate_transactions_and_multi-output.md | 34 +++-- doc/install_pip.md | 23 ++- doc/install_poetry.md | 10 ++ doc/test_and_coverage.md | 18 ++- release_notes/v0.10.0.md | 16 +++ release_notes/v0.10.0rc.md | 19 ++- release_notes/v0.8.md | 41 ++++-- release_notes/v0.9.0rc.md | 63 +++++---- release_notes/v0.9.md | 12 ++ 14 files changed, 375 insertions(+), 73 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e91bb55..daa9d138 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### [Milestone v0.10.0](https://git.duniter.org/clients/python/silkaj/milestones/9) ## v0.10.0rc1 (6th April 2022) + - #426, !207: Äž1 Monetary License refactoring: - Drop display in a browser - Discover available languages @@ -15,21 +16,27 @@ - #216 `diffi`: Catch WS disconnection exception ## v0.10.0rc0 (21st March 2022) + ### Code + #### Features + - #89, !170: Manage the revocation document - #134, !202: Read transaction recipients and amounts from a file #### Äž1 Monetary license + - #221, !181: Research about Äž1 monetary license integration and refactor of its handling in Silkaj - #308, !181: Äž1 license display on a workstation: give the choice how to display it - #392, !181: Äž1 monetary license files not included into the Python package - !181: subtree updated bringing new translations: Esperanto, Espagnol, and Portuguese #### DeathReaper + - #256: Implement `excluded` command to report excluded identities from the WoT / DeathReaper #### Network + - #373, #396, #410, !182, !194: Drop asynchronous property - #390, !182, !196: Implement generic `network_tools.send_document()` - #177, !188: Clean no longer used network layer functions @@ -38,18 +45,21 @@ - #260: Disconnection bug when sending a document to a local node #### Other changes + - #407, !182: Support DuniterPy v1.0 Breaking Backward compatible changes in `Documents` classes - #344, !177: Fix import loop issue - !177: Generalize `pendulum` usage - #416, !170: Move `wot_lookup()` exceptions handling in higher level functions #### Minor impact changes + - #194, !195: Convert strings to `f-strings` - #376, !195: Replace `tools.message_exit()` with `sys.exit()` - #413, !170: Create `get_currency()` helper - #264, !178: Remove unmaintained and commented `network` command ### Meta + - !200: Bump DuniterPy to v1.1.0 - #332, !200: Drop Python v3.6 support - #374, !197: Add support for Python v3.10 @@ -58,13 +68,16 @@ - #365, !201: Update the copyright date to 2022 in the headers of every source files ### Documentation + - #384: Document how to release pre-releases - !180: `README` and `CONTRIBUTING` enhancements ### Installation/Continuous Delivery + - #388, !198: Set up Silkaj Docker images build automation ### Development Environment/Continuous Integration + - #326, !189: Integrate coverage in GitLab coverage feature - #355, !183: Set `Py:3.8` as default image and move coverage to `Py:3.9` - #355, !185: Move the coverage and the badge generations to v3.9 test job @@ -72,15 +85,16 @@ - !175: `pyproject.toml` and `release.sh` clean-ups, Pyinstaller removal #### Introduce and generalize `pre-commit` usage + - #401, !183: Introduce `isort` and `gitlab-ci-linter` `pre-commit` hooks - #403, !192: Introduce `pyupgrade`, Remove dev dep tools - #406, !191: Set up `pre-commit` hooks CI jobs - !179: Bump `black` to v21.4b2 and allow to install as pre-release - !190: Update `pre-commit` doc. Document CI linter hook usage ---- -Thanks @moul, @matograine +______________________________________________________________________ +Thanks @moul, @matograine ## v0.9.0 (17th April 2021) @@ -94,22 +108,26 @@ Thanks @moul, @matograine Plus what can be found bellow in v0.9.0rc - ## v0.9.0rc (24th March 2021) + ### Code + #### `tx` + - #281, !129: Handle transaction size limit properly - #257, #312, #356: Handle chained transactions/Change txs lost while sending big amount - #296, #362, !154, !157: Prevent sending transaction with 0 as amounts - #172, !165: Refactor tx confirmation, by using `click.confirm()` #### `balance` + - #300, !164: `balance`: Display corresponding member identity uid - #366, !159: Fix wrong `DuniterError` exception handling in `wot.identity_of` - #377, !166: `balance`: Document `money.show_amount_from_pubkey()` - #342, !151: Don’t allow to pass multiple times the same pubkey to the `balance` command #### Others + - #218, !160: `history`: Add option to display the complete pubkeys - #314, !165: Display option for `cert`, `membership` commands - !165: Make `--dry-run` option a generic one @@ -119,6 +137,7 @@ Plus what can be found bellow in v0.9.0rc - #208: `argos`: Remove duplicate call to `CurrencySymbol` #### Tests + - #213, !130: Write unit tests for the `tx` command - #282, !130: Split `patched.py` into files - #335, !130: Merge the two functions testing `transaction_amount()` @@ -127,6 +146,7 @@ Plus what can be found bellow in v0.9.0rc - #362, !156: Change "moul" id in tests ### Meta + - #240, !150: Drop Python 3.5 support - #294, !150, docker/python3/poetry!1: Add support and set-up Python 3.9 test job - #270: Silkaj v0.8.1 package for Debian Bullseye (v11) @@ -137,10 +157,12 @@ Plus what can be found bellow in v0.9.0rc - #313, !148: Be compatible with and handle new features from Poetry v1.1 - #299, !147: Introduce dev version suffix ---- +______________________________________________________________________ + Thanks @matograine, @moul, @atrax ## v0.8.1 (30th November 2020) + - #358, !152: Update DuniterPy to v0.58.1, to support `libnacl` v1.7.2 Thanks @matograine @@ -150,35 +172,48 @@ Thanks @matograine ### [Milestone v0.8.0](https://git.duniter.org/clients/python/silkaj/milestones/8) ### Code + #### Transaction + - #111, !108: Support passing different amounts on multi-recipients tx + - **Breaking change**: Rename `--output` option to `--recipient` + - Add extra small options to ease passing multiple amounts and recipients: + - `-a/--amount` - `-d/--amountUD` - `-r/--recipient` - `-c/--comment` + - Add possibility to pass multiple options: + - **Breaking change**: recipients public keys are no longer `:` separated: `-r A -r B` - #232, !131, !132: Identities not retrieved for tx with several issuers, and to display the tx history + - #236, !107: Improve the confirmation display + - !144: Rework confirmation fields titles + - #235: Make sure only one option is passed to retrieve the amount of the transaction #### Membership, WoT + - #88, !140: Add `membership` command - #88, !144: Rework table fields names - #140, !140: Ability to pass an `uid` or a `pubkey` to `wot`, and `cert`, `membership` commands - Implement identity choice selector #### Checksum + - #237, !132: **Breaking change**: Switch back the checksum delimiter from `!` to `:` - #323, !132: Handle pubkey's checksum in the tx code - #301, !143: Generalize pubkey checksum display and verifiction, Add `chekcsum` command - #320, !143: Incorrect use of `check_public_key()` in `id` command #### Others + - #262, !123: Add new `verify` command to check blocks’ signatures - #264, !133: Disable the broken `net` command - !131: Display `powMin` in a row in the `blocks` explorer @@ -190,13 +225,16 @@ Thanks @matograine - #336, !141: `history`: Pubkeys display issue with multisig txs ### Dev Env + #### Poetry migration + - #182: Migrate from Pipenv and `setup.py` to Poetry - #249: Install Poetry stable when v1 is released - #263, !127: Post migration tasks (black, poetry) - #276, !120: Pip installation do not install `silkaj` executalbe into `$HOME/.local/bin` #### CI/CD set-up + - #245: Automated containers builds with Poetry installed for Python versions 3.5, 3.6, 3.7, and 3.8 - #149: CI/CD set up - #105: Deploy on PyPI from GitLab CD @@ -206,9 +244,11 @@ Thanks @matograine - !131: Use `rules` instead of `only/except` #### Tests + - #241: Can not run test with Click utility ### Dependencies + - #259: `attr` error while installing with `pip` - !121, !131, !142: Update DuniterPy from v0.55.1 to v0.58.0 - #251, !140: Introduce `pendulum` date utility @@ -218,11 +258,13 @@ Thanks @matograine - #338, !140: Update black to v20 ### Python versions support + We added the support for Python 3.8. #240: It is planned that v0.8.x versions are going to be the last releases with Python 3.5 support since [its support from the Python project has been dropped September 30th of 2020](https://pythoninsider.blogspot.com/2020/10/python-35-is-no-longer-supported.html). ### Documentation + - #202: Document contribution process in `CONTRIBUTING.md` - #182: Document Poetry installation and usage - !109: Add Poetry installation on Debian Buster @@ -232,47 +274,59 @@ since [its support from the Python project has been dropped September 30th of 20 - #207: Create Silkaj SVG logo ### Project + - #252, !118: Create a script to update and update the copyright date to 2020 - #285, !132: Add copyright and license statements in tests source files ### Thanks + @moul, @matograine ---- +______________________________________________________________________ ## v0.7.6 (24th January 2020) + - Update DuniterPy to v0.55.1 in order to have the PubSec regex fixed ## v0.7.5 (23th January 2020) + - #276: Publish on PyPI with previous method: `wheel`, `twine`, and `setup.py`. - `silkaj` binary does not get installed to `$HOME/.local/bin` via Poetry ## v0.7.4 (22th January 2020) + - #273, !119: Fix broken PubSec authfile importation regex Thanks to @matograine for this bugfix and the release! ## v0.7.3 (25th July 2019) + #239: Bug fix release for broken successives transactions due to wrongly calculated pending inputs: + - remove already used inputs: restore previous behaviour which haven’t been kept the same during the migration - `enumerate()` wrongly moved to the non appropriate for loop ## v0.7.2 (25th June 2019) + - #233: fix round passed amount and amoundUD floats × by 100 ## v0.7.1 (29th May 2019) + - Fix transaction document generation from DuniterPy ## v0.7.0 (22th May 2019) + ### [Milestone v0.7.0](https://git.duniter.org/clients/python/silkaj/milestones/10) #### DuniterPy + - #7, !97: Migrate to DuniterPy - #200: Freeze DuniterPy dependency version - #206: Set a sleep for async requests - #178: Select different sources for intermediaries tx #### CLI + - #77, !98: Migrate command line tool from commandline to Click - #67, #76, #116, #117, #123: fixed by previous issue - #167: Rename `amount` command to `balance` @@ -280,6 +334,7 @@ Thanks to @matograine for this bugfix and the release! - With `-p` option: when the port of the node is 443, it’s not necessary to specify the port #### Transaction + - #22: Display transactions history in a table - #184: Rework transaction functions (Part 3) - #152: fix `--allSources` option which was not working @@ -287,40 +342,49 @@ Thanks to @matograine for this bugfix and the release! - #131: Prevent sending too small amount #### Certification + - #170: Change process: only propose license display - #198: Display identity’s blockstamp and date into confirmation message #### Difficulty level + - #93: Difficulties fails / use websocket to be informed about new block - #190: Display the date when the head block has been generated #### Balance + - !96, #122: display balance in comparison to the average of money share #### Blocks + - Display the full dates of blocks’ generation and mediantime #### WoT + - #141: Crash on membership status - Add legend to explain `✔` - #189: Handle wot requests exceptions - #135 :is_member() requests all members to know if an identity is member will explose #### Authentication + - #130: Prevent erasing authfile - Use `pathlib.Path` instead of `os.path` #### Tests + - !83, #85: Create test structure - #225: Install `pytest-asyncio` #### Other + - #161: Singleton improvement - #157, !100: Use `for` loops - #169, !100: type issue - #113: Many small improvements #### Website / Doc + - #82: Update website and readme about new features - #136: Link directly the installation documentation on the website - #159: Update website @@ -328,6 +392,7 @@ Thanks to @matograine for this bugfix and the release! - List Silkaj wrappers en the README ##### Installation documentation + - Add instructions on installing libsodium which is required by pylibscrypt since DuniterPy migration - #142: Improve pip installation documentation - Improve Pipenv installation documentation @@ -335,17 +400,20 @@ Thanks to @matograine for this bugfix and the release! - #215: Conflict between pyproject.toml and pipenv install #### Windows + - #153: Install on Windows, Scrypt issue - #154: net: can’t get screen size on Windows - !92: Document Windows installation with pip #### Project + - #132: Add a license notice as a header of every source files - #158: Add CHANGELOG.md file - #186: Fix firsts two tags - Pypi: add classifiers #### Thanks + @Attilax, @Bernard, @cebash, @matograine, @vtexier ## v0.6.5 Debian (8th January 2019) @@ -357,6 +425,7 @@ v0.6.5 fork for Debian package without DuniterPy migration but with Click CLI mo - #132: Add a license notice as a header of every source files #### Thanks + @jonas ## v0.6.1 (10th December 2018) @@ -369,33 +438,37 @@ v0.6.5 fork for Debian package without DuniterPy migration but with Click CLI mo - #141: Crash on membership status - #166: Shell completion - ## v0.6.0 (18th November 2018) ### [Milestone v0.6.0](https://git.duniter.org/clients/python/silkaj/milestones/7) #### Installation + - #86: Move from `pyenv+pip` to Pipenv as the new development environment solution - #100, !80: New installation method with `pip` now set as default - #100: Documentation on how to publish on Pypi #### Authentication + - #78: Use Scrypt as default authentication method - #102: Display a confirmation message after using `generate_auth_file` command - #103: More explicit usage about the authentication file mechanism storage #### Certification + - #96, !82: Certification fails for non-members identities - Prevent certifying ourself - Code refactoring: simplification, duplicate code removal #### Wot + - Display certification stock - #73: Display identity status: - Display membership expiration due to membership expiration and certifications expiration - #127: fix: display human readable date for 'revoked on' attribute #### Transaction + - #83, !78: Allow multi-output transactions - #72: Check the pubkey’s balance is enough before processing the transaction - #72: Minors transaction refactoring @@ -405,34 +478,42 @@ v0.6.5 fork for Debian package without DuniterPy migration but with Click CLI mo - #125: Fix wrong amount transferred #### New commands + - #91: `about`: displays information about silkaj - #95: `license`: displays Äž1’s license #### Äž1-test + - #87: Add `--gtest` option to specify official Äž1-test node - #109, !84: Improve gtest usage message - #112: Amount: fix authentication option with `--gtest` option #### Python 3.7 + - #98: Test with Python 3.7: silkaj is compatible with Python from version 3.4 to 3.7 - #98: Set Python 3.7 for Pipenv #### Network performances + - #42, !85: Thanks to singleton, requests are made once for `head_block`, blockchain parameters, endpoint, `ud_value`, and `currency_symbol` retrieval - #32: request the domain first instead of the IP (to handle https certificates) (this avoid `network` view to crash) - #32, !79: Add timeouts on GET and POST requests - #128, !88: Fix POST request timeout #### Black: code formatting + - #94, !76: move from `pep8` to `black` code formatting. Set pre-commit hook and CI worker #### Bug fixes and refactoring + - #121: Move cryptographic related functions into `crypto_tools.py` #### Logo + - #92: Silkaj logo publication under GNU APGLv3 after a successful crowdfunding #### Wrappers + - #107: Document silkaj wrappers usages ### [Forum post](https://forum.duniter.org/t/silkaj-v0-6-0-release/4858) @@ -442,26 +523,32 @@ v0.6.5 fork for Debian package without DuniterPy migration but with Click CLI mo ### [Milestone v0.5.0](https://git.duniter.org/clients/python/silkaj/milestones/2) #### Certification + - #61: sending certification document: - check that current identity is member - check that the certification has not already been sent - prompt Äž1’s license and ask for acceptance in web browser or in pager (a `less`-like) if no web browser is available #### Wot + - #84: display certifications’ expiration date - #81: bugfix, nothing displayed when there is two identities with same id #### Amount + - remove necessity to prepend with `--pubkey` option: `silkaj amount pubkey1:pubkey2:pubkey3` #### Issuers + - display the hash’s ten first characters as Äž1’s global difficulty has increased - display blocks in current window: `silkaj issuers 0` #### Build + - #6: Automate releases using a script #### Other + - display `Äž1` and `ÄžTest` currencies symbols - Aliases commands `id`: `identities`, `tx`: `transaction`, `net`: `network` - `import` rework to improve loading performances @@ -469,69 +556,84 @@ v0.6.5 fork for Debian package without DuniterPy migration but with Click CLI mo ### [Forum post](https://forum.duniter.org/t/silkaj-v0-5-0/4712) - ## v0.4.0 (28th January 2018) + ### [Milestone v0.4.0](https://git.duniter.org/clients/python/silkaj/milestones/5) #### New `wot` command which displays received and sent certification of an identity + - !50, !66 #### Transaction + - #41: Rework/refactoring of transaction code (part 1) - !55: Add check condition for sources - !57: Exit if wrong pubkey’s output formats #### Amount + - #46, !68: Add ability to display the amount of many pubkey with same command - Total amount of pubkeys displayed at the end (nice to know how much units you own) #### Authentication + - !56: Add [Äžannonce](https://gannonce.duniter.org/) (aka PubSec) file format import - #60: Hide salt at scrypt authentication #### Difficulties + - !58: Reload/refresh in a loop PoW difficulty level - Display in same order as [Remuniter](http://remuniter.cgeek.fr/) #### Id + - #49: Display if pubkey is member - #59: Bug fix with `id` command #### Build + - Build published with sha256 checksum #### Other + - Change default endpoint #### Thanks + Thanks to @Tortue95, @jytou, @mmuman, and @cuckooland ### [Forum post](https://forum.duniter.org/t/silkaj-0-4-0/4071) - ## v0.3.0 (17th April 2017) + ### [Milestone v0.3.0](https://git.duniter.org/clients/python/silkaj/milestones/5) #### Transactions + - enhance transaction command: - #27, #30: ask for confirmation - !38: new confirmation chart containing transaction informations - don’t prompt `scrypt` parameters. See `Auth` § #### New command `id` to search for pubkey/identity + - !29: new command `id` to search identities with pubkey or id #### Tutorial to install a Python environment + - #23, !40: Pyenv installation tutorial #### Authentication + - !45: new authentication method: WIF. For future paper wallet feature - #39, #43: Don’t prompt scrypt parameters at authentication. Use default ones #### Builds + - #5: with Pyinstaller #### Other + - !33, !37: Ability to sort network view - Change license from GNU GPLv3 to GNU AGPLv3 - !31: Code formatting with `pep8` @@ -541,33 +643,36 @@ Thanks to @Tortue95 and @jytou ### [Forum post](https://forum.duniter.org/t/lets-send-your-money-silkaj-v0-3-0/2404/1) ## v0.2.0 (27th March 2017) + ### Features + - [Transaction feature](https://github.com/duniter/silkaj/pull/21) - [Output information on the drop-down menu with Argos (GNOME Shell extension)](https://github.com/duniter/silkaj/pull/20) ### [Milestone v0.2.0](https://git.duniter.org/clients/python/silkaj/milestones/4) ### Announcement -- [Diaspora* post](https://framasphere.org/posts/3055642) + +- [Diaspora\* post](https://framasphere.org/posts/3055642) Big thanks to @Tortue95, and @mmuman. ## v0.1.0 (23th September 2016) ### Public release -- [Duniter forum post](https://forum.duniter.org/t/silkaj-new-cli-duniter-client/1278) -- [Diaspora* post](https://framasphere.org/posts/2226277) +- [Duniter forum post](https://forum.duniter.org/t/silkaj-new-cli-duniter-client/1278) +- [Diaspora\* post](https://framasphere.org/posts/2226277) ### [Milestone v0.1.0](https://git.duniter.org/clients/python/silkaj/milestones/1) - ### Features + Sub-commands: + - `info` - `difficulties` - `network` - `issuers` - Thanks to @c-geek. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3945c3dd..88afe276 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,27 +1,33 @@ # Contributing ## Goals + Part of the Duniter project running the Äž1 currency, Silkaj project is aiming to create a generic tool to manage his account and wallets, and to monitor the currency. ## Install the development environment + We are using [Poetry](https://python-poetry.org/) as a development environment solution. Start [installing Poetry](doc/install_poetry.md). This will install a sandboxed Python environment. Dependencies will be installed in it in order to have Silkaj running and to have pre-installed developement tools. ## Workflow + - We use branches for merge requests - We prefer fast-forward and rebase method than having a merge commit. This in order to have a clean history. ## Branches + - `main`: development and stable branch - maintainance branches, to maintain a stable version while developing future version with breaking changes. For instance: `0.10` ## Developing with DuniterPy + [DuniterPy](https://git.duniter.org/clients/python/duniterpy) is a Python library for Duniter clients. It implements a client with multiple APIs, the handling for document signing. As it is coupled with Silkaj, it is oftenly needed to develop in both repositories. ### How to use DuniterPy as editable with Poetry + Clone DuniterPy locally alongside of `silkaj` repository: ```bash @@ -30,13 +36,16 @@ git clone https://git.duniter.org/clients/python/duniterpy ``` Use DuniterPy as a [path dependency](https://python-poetry.org/docs/dependency-specification/#path-dependencies): + ```bash poetry add ../duniterpy ``` ### Developing with modules + Silkaj is using Python modules which shape kind of a framework. Please read their documentations on how to use them the best possible. + - [DuniterPy](https://clients.duniter.io/python/duniterpy/index.html): Autogenerated documentation. - Feel free to contribute upstream to share the code with other Python programs - [Click](https://click.palletsprojects.com/#documentation) @@ -44,17 +53,20 @@ Please read their documentations on how to use them the best possible. - [texttable](https://github.com/foutaise/texttable/#documentation) ## Pre-commit + We are using [`pre-commit`](https://pre-commit.com/) tool to perform checks on staged changes before committing. We are using it for `black` formatting, `isort` imports sorting, `pyupgrade`, and `gitlab-ci` linting. We will use it for `pylint` code linting, `mypy` typing in the future. Install `pre-commit` from your distribution. In case it is an outdated version, install it from `pip`: + ```bash sudo apt install pre-commit pip install --user pre-commit ``` To install the `git-hooks`, run: + ```bash > pre-commit install ``` @@ -62,58 +74,74 @@ To install the `git-hooks`, run: Then each time you commit changes, the hooks will perform checks. To manually run one of the tool above, run (eg for `isort`): + ```bash > pre-commit run --all-files isort ``` + To run all checks on all files: + ```bash > pre-commit run -a ``` ### Authorization for GitLab CI linter hook + `pre-commit run -a (gitlab-ci-linter)` is failing due to authorization required for CI lint API accesses. When running this command, just ignore this failed hook. In case you want to commit a `.gitlab-ci.yml` edition, this hook will prevent the commit creation. You can [skip the hooks](https://stackoverflow.com/a/7230886) with `git commit -m "msg" --no-verify`. This is fine for occasional `.gitlab-ci.yml` editions. In case you would like to edit this file more often and have it checked, ask a maintainer to provide you with `GITLAB_PRIVATE_TOKEN` environment variable that can be set into a shell configuration. With Bash, in `$HOME/.bashrc` add the following: + ```bash export GITLAB_PRIVATE_TOKEN="" ``` With Fish, in `$HOME/.config/fish/config.fish` add the following: + ```fish set -xg GITLAB_PRIVATE_TOKEN "" ``` + Check out duniterpy#169 for more details. ### Black formatting + We are using [Black](https://github.com/psf/black) formatter tool. Run Black on a Python file to format it: + ```bash poetry run black silkaj/cli.py ``` + With `pre-commit`, Black is called on staged files, so the commit should fail in case black would make changes. You will have to `git add` Black changes in order to commit your changes. ## Tests + We are using [Pytest](https://pytest.org) as a tests framework. To know more about how Silkaj implement it read the [project test documentation](doc/test_and_coverage.md). To run tests, within `silkaj` repository: + ```bash poetry run pytest ``` ### How to test a single file + Specifiy the path of the test: + ```bash poetry run pytest tests/test_end_to_end.py ``` ## Version update + We are using the [Semantic Versioning](https://semver.org). To create a release, we use following script which will update the version in different files, and will make a commit and a tag out of it. + ```bash ./release.sh 0.8.1 ``` @@ -121,12 +149,15 @@ To create a release, we use following script which will update the version in di Then, a `git push --tags` is necessary to publish the tag. Git could be configured to publish tags with a simple `push`. ### How to release a pre-release on PyPI + [Append `[{a|b|rc}N]` to the version, it will be automatically detected as pre-release by PyPI](https://pythonpackaging.info/07-Package-Release.html). i.e.: `v0.10.0rc0`. + - install a pre-release from PyPI: ```sh pip install silkaj --user --upgrade --pre ``` + - install `silkaj` from PyPI test and the dependencies (i.e. DuniterPy) from PyPI (have been removed from the documentation): ```sh @@ -134,10 +165,12 @@ pip install silkaj --user --upgrade -i https://test.pypi.org/simple/ --extra-ind ``` ### Update copyright year + Follow [this documentation](https://github.com/Lucas-C/pre-commit-hooks#removing-old-license-and-replacing-it-with-a-new-one) Only difference is to update the year in `license_header.txt` rather than `LICENSE.txt`. ## PyPI and PyPI test distributions + Silkaj is distributed to PyPI, the Python Package Index, for further `pip` installation. Silkaj can be published to [PyPI](https://pypi.org/project/silkaj) or to [PyPI test](https://test.pypi.org/project/silkaj/) for testing purposes. Publishing to PyPI or PyPI test can be directly done from the continuous delivery or from Poetry it-self. @@ -145,18 +178,24 @@ The CD jobs does appear on a tag and have to be triggered manually. Only the project maintainers have the rights to publish tags. ### PyPI + Publishing to PyPI from Poetry: + ```bash poetry publish --build ``` + ### PyPI test + Publishing to PyPI test from Poetry: + ```bash poetry config repositories.pypi_test https://test.pypi.org/legacy/ poetry publish --build --repository pypi_test ``` To install this package: + ```bash pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.python.org/simple/ silkaj ``` @@ -164,13 +203,16 @@ pip install --index-url https://test.pypi.org/simple/ --extra-index-url https:// The `--extra-index-url` is used to retrieve dependencies packages from the official PyPI not to get issues with missing or testing dependencies comming from PyPI test repositories. ## Continuous integration and delivery + ### Own built Docker images + - https://git.duniter.org/docker/python3/poetry - Python images based on Debian Buster - Poetry installed on top - Black installed on v3.8 ### Jobs + - Checks: - Format - Build @@ -182,9 +224,11 @@ The `--extra-index-url` is used to retrieve dependencies packages from the offic - stable ### Äž1 monetary license update + To modify the Äž1 monetary license files, please change them on [its repository](https://git.duniter.org/documents/g1_monetary_license), since it’s integrated in silkaj repository as a `git subtree`. To pull changes from upstream with `git subtree`, add the repository as a remote then pull: + ```bash git remote add g1_monetary_license https://git.duniter.org/documents/g1_monetary_license.git git subtree pull --prefix g1_monetary_license g1_monetary_license master diff --git a/README.md b/README.md index 997a9a1c..7e643c87 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ <img src="https://git.duniter.org/clients/python/silkaj/raw/main/logo/silkaj_logo.svg" width="250" /> # Silkaj + [](https://pypi.python.org/pypi/silkaj) [](https://pypi.python.org/pypi/silkaj) [](https://pypi.python.org/pypi/silkaj) @@ -11,13 +12,17 @@ [](https://git.duniter.org/clients/python/silkaj/) Powerfull, lightweight, and multi-platform command line client written with Python for Äž1 and Äž1-Test currencies + - [Website](https://silkaj.duniter.org) ## Install + ### Distribution + Install with your favorite package manager. See below the [packaging status paragraph](#packaging-status). ### Pip + If you want a more recent version [install with Pip](doc/install_pip.md): ```bash @@ -25,15 +30,20 @@ pip3 install silkaj --user ``` ### Docker images + There is two kind of images. One build with `pip` for user purposes, and one using Poetry for developer purposes. + - [Docker images](doc/docker.md) ### For contributing purposes + - [Install the Poetry development environment](doc/install_poetry.md) - Check out the [contributing guidelines](CONTRIBUTING.md) ## Usage + - Get help usage with `-h` or `--help` options, then run: + ```bash silkaj <sub-command> ``` @@ -41,36 +51,44 @@ silkaj <sub-command> - Will automatically request and post data on `duniter.org 443` main Äž1 node. - Specify a custom node with `-p` option: + ```bash silkaj -ep <hostname>:<port> <sub-command> ``` ## 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 - 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 ### Authentication + - Authentication methods: Scrypt, file, and (E)WIF ### Others + - Display Äž1 monetary license - Public key checksum ## Wrappers + - [Install as a drop-down for GNOME Shell with Argos](doc/argos.md) - [How-to: automate transactions and multi-output](doc/how-to_automate_transactions_and_multi-output.md) - [Transaction generator written in Shell](https://gitlab.com/jytou/tgen) @@ -80,7 +98,9 @@ silkaj -ep <hostname>:<port> <sub-command> - [Äžmixer](https://git.duniter.org/tuxmain/gmixer-py/) ### Dependencies + Silkaj is based on following Python modules: + - [Click](https://click.palletsprojects.com/): Composable command line interface toolkit - [DuniterPy](https://git.duniter.org/clients/python/duniterpy/): Most complete client oriented Python library for Duniter/Äž1 ecosystem - [Pendulum](https://pendulum.eustace.io/): Datetimes made easy @@ -88,7 +108,9 @@ Silkaj is based on following Python modules: - [tabulate](https://github.com/astanin/python-tabulate): Pretty-print tabular data ### Names + I wanted to call that program: + - bamiyan - margouillat - lsociety @@ -97,7 +119,9 @@ I wanted to call that program: I finally called it `Silkaj` as `Silk` in esperanto. ### Website + - [Silkaj website sources](https://git.duniter.org/websites/silkaj_website/) ## Packaging status + [](https://repology.org/project/silkaj/versions) diff --git a/doc/argos.md b/doc/argos.md index 2420ff79..5be04753 100644 --- a/doc/argos.md +++ b/doc/argos.md @@ -1,4 +1,5 @@ ## Install as a drop-down for GNOME Shell with Argos + Under GNOME Shell, with [Argos](https://github.com/p-e-w/argos) extension: - [Install Argos](https://github.com/p-e-w/argos#installation) @@ -10,6 +11,7 @@ Under GNOME Shell, with [Argos](https://github.com/p-e-w/argos) extension: ``` Add execution permission: + ```bash chmod u+x ~/.config/argos/silkaj.30s.sh ``` diff --git a/doc/docker.md b/doc/docker.md index c2dc56c6..51cda1de 100644 --- a/doc/docker.md +++ b/doc/docker.md @@ -1,4 +1,5 @@ ### Docker images + There are two kind of images. The one built with `pip` for user purposes, and the one built with Poetry for developer purposes. We are using `podman` instead of `docker` command for not having to run the command as `root`. @@ -8,16 +9,21 @@ In case you use `docker`, you can [add your user into the `docker` group, so you Feel free to replace `podman` with `sudo docker`. #### User + Pull the image: + ```bash podman pull registry.duniter.org/clients/python/silkaj/release/pip:latest ``` + Run Silkaj from outside the image: + ```bash podman run -it registry.duniter.org/clients/python/silkaj/release/pip:latest silkaj info ``` Go into the image, then run Silkaj: + ```bash podman run -it registry.duniter.org/clients/python/silkaj/release/pip:latest bash silkaj info @@ -27,25 +33,30 @@ The working directory is where Silkaj sources are installed in Python `site-pack This is fine for doing small editions. For bigger editions, it is adviced to use a development environment with Poetry. #### Developer + `git` is installed, so it can be used as a development environment. Pull the image: + ```bash podman pull registry.duniter.org/clients/python/silkaj/release/poetry:latest ``` Run Silkaj from ouside the image: + ```bash podman run -it registry.duniter.org/clients/python/silkaj/release/poetry:latest silkaj info ``` Go into the image, then run Silkaj: + ```bash podman run -it registry.duniter.org/clients/python/silkaj/release/poetry:latest bash silkaj info ``` The working directory contains Silkaj sources. Set up the repository to have it ready for developments: + ```bash git checkout dev git remote set-url origin https://git@git.duniter.org/clients/python/silkaj.git diff --git a/doc/how-to_automate_transactions_and_multi-output.md b/doc/how-to_automate_transactions_and_multi-output.md index 9459bd22..28bc765d 100644 --- a/doc/how-to_automate_transactions_and_multi-output.md +++ b/doc/how-to_automate_transactions_and_multi-output.md @@ -5,6 +5,7 @@ Once silkaj installed. We want to be able to send a transaction to many recipien Tutoriel based on this [forum post (fr)](https://forum.duniter.org/t/silkaj-installation-virements-automatiques-et-multi-destinataires/4836). ### Create a recipient file + You have to create a list of the public keys addresses to the recipients you wants to send money. > Example: here, we want to send money to Duniter’s pubkeys contributors. @@ -13,23 +14,24 @@ Create a `recipients.txt` file containing the list of the recipients keys. You c > Example: > ->```txt ->2ny7YAdmzReQxAayyJZsyVYwYhVyax2thKcGknmQy5nQ ->FEkbc4BfJukSWnCU6Hed6dgwwTuPFTVdgz5LpL4iHr9J ->D9D2zaJoWYWveii1JRYLVK3J4Z7ZH3QczoKrnQeiM6mx ->HbTqJ1Ts3RhJ8Rx4XkNyh1oSKmoZL1kY5U7t9mKTSjAB ->38MEAZN68Pz1DTvT3tqgxx4yQP6snJCQhPqEFxbDk4aE ->5cnvo5bmR8QbtyNVnkDXWq6n5My6oNLd1o6auJApGCsv ->GfKERHnJTYzKhKUma5h1uWhetbA8yHKymhVH2raf2aCP ->7F6oyFQywURCACWZZGtG97Girh9EL1kg2WBwftEZxDoJ ->CRBxCJrTA6tmHsgt9cQh9SHcCc8w8q95YTp38CPHx2Uk ->2sZF6j2PkxBDNAqUde7Dgo5x3crkerZpQ4rBqqJGn8QT ->4FgeWzpWDQ2Vp38wJa2PfShLLKXyFGRLwAHA44koEhQj ->55oM6F9ZE2MGi642GGjhCzHhdDdWwU6KchTjPzW7g3bp ->BH8ZqCsp4sbHeDPPHpto53ukLLA4oMy4fXC5JpLZtB2f ->``` +> ```txt +> 2ny7YAdmzReQxAayyJZsyVYwYhVyax2thKcGknmQy5nQ +> FEkbc4BfJukSWnCU6Hed6dgwwTuPFTVdgz5LpL4iHr9J +> D9D2zaJoWYWveii1JRYLVK3J4Z7ZH3QczoKrnQeiM6mx +> HbTqJ1Ts3RhJ8Rx4XkNyh1oSKmoZL1kY5U7t9mKTSjAB +> 38MEAZN68Pz1DTvT3tqgxx4yQP6snJCQhPqEFxbDk4aE +> 5cnvo5bmR8QbtyNVnkDXWq6n5My6oNLd1o6auJApGCsv +> GfKERHnJTYzKhKUma5h1uWhetbA8yHKymhVH2raf2aCP +> 7F6oyFQywURCACWZZGtG97Girh9EL1kg2WBwftEZxDoJ +> CRBxCJrTA6tmHsgt9cQh9SHcCc8w8q95YTp38CPHx2Uk +> 2sZF6j2PkxBDNAqUde7Dgo5x3crkerZpQ4rBqqJGn8QT +> 4FgeWzpWDQ2Vp38wJa2PfShLLKXyFGRLwAHA44koEhQj +> 55oM6F9ZE2MGi642GGjhCzHhdDdWwU6KchTjPzW7g3bp +> BH8ZqCsp4sbHeDPPHpto53ukLLA4oMy4fXC5JpLZtB2f +> ``` ### Create an authentication file + To process automated transactions, Silkaj needs to have an authentication file allowing to spent money. In order to create this file, with your wallet’s secret credentials, run following command: @@ -45,6 +47,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ``` ### Run the transaction + Finally, you just have to run following command: ```bash @@ -54,6 +57,7 @@ silkaj --auth-file tx --amountUD 20 --output `cat recipients.txt | tr '\n' ':' | Note: Each pubkey will receive 20 UD. ### Automated transaction + If you want to automate a transaction on each first day of the month, you can set a `crontab` on your machine (preferably a server running 7/24): ```bash diff --git a/doc/install_pip.md b/doc/install_pip.md index 3a27e029..64a19fba 100644 --- a/doc/install_pip.md +++ b/doc/install_pip.md @@ -3,6 +3,7 @@ You have to use a shell on GNU/Linux or a command tool (`cmd.exe`) on Windows. ## GNU/Linux + The system must use UTF-8 locales… ### Install libsodium @@ -20,11 +21,13 @@ sudo apt install python3-pip python3-dev python3-wheel libssl-dev ``` On Ubuntu (14.04 and 16.04) and Debian 8, you need this package too: + ```bash sudo apt install libffi-dev ``` Raspbian and Linux Mint are reported to require the installation of this package too: + ```bash sudo apt install python3-dev ``` @@ -32,13 +35,16 @@ sudo apt install python3-dev ### Completing `PATH` After intallation, if you get a `bash: silkaj: command not found` error, you should add `~/.local/bin` to your `PATH`: + ```bash echo "export PATH=$PATH:$HOME/.local/bin" >> $HOME/.bashrc source $HOME/.bashrc ``` ## macOS + To install Python, run the following command: + ```bash brew install python3 ``` @@ -46,6 +52,7 @@ brew install python3 `pip3` will automatically be installed with `python3` installation. Then, install Silkaj with: + ```bash pip3 install silkaj --user ``` @@ -53,6 +60,7 @@ pip3 install silkaj --user ## Windows ### Administrator rights + Please note that the administrator rights might be mandatory for some of these operations. ### The `PATH` variable @@ -62,6 +70,7 @@ The main issue on Windows is about finding where are the requested files. Python must be installed (version 3.5 minimum). For instance https://sourceforge.net/projects/winpython/ You can test that Python is available by opening a command tool (cmd.exe) and running: + ```bash C:\>python --version Python 3.6.7 @@ -72,15 +81,17 @@ When installing Python, take care to specify the good folder (for instance: `C:\ After the installation, you commonly have to add by yourself this folder in the `PATH` environment variable: To make it by command tool (cmd.exe): + ```bash set PATH=%PATH%;C:\WPy-3670\ ``` + Then you have to exit the cmd tool so that `PATH` variable can be updated internally. You may right click on computer, then go to Advanced System Parameters and use in the bottom the button Environment Variables. In order to be able to use silkaj and specifically the OpenSSL binaries, you also have to add the following folder to the `PATH` variable: -C:\WPy-3670\python-3.6.7.amd64\Lib\site-packages\PyQt5\Qt\bin\ +C:\\WPy-3670\\python-3.6.7.amd64\\Lib\\site-packages\\PyQt5\\Qt\\bin\\ ```bash set PATH=%PATH%;C:\WPy-3670\python-3.6.7.amd64\Lib\site-packages\PyQt5\Qt\bin\ @@ -92,12 +103,14 @@ In order to be able to launch silkaj as a Windows command, you have to create a `C:\WPy-3670\python-3.6.7.amd64\Scripts\silkaj.bat` containing: + ```bash rem @echo off python "%~dpn0" %* ``` and then to add this folder into the `PATH` variable: + ```bash set PATH=%PATH%;C:\WPy-3670\python-3.6.7.amd64\Scripts\ ``` @@ -105,6 +118,7 @@ set PATH=%PATH%;C:\WPy-3670\python-3.6.7.amd64\Scripts\ ## Install directly from internet (implicitely uses binaries from website Pypi) Assuming that Python v3 and pip version 3 are installed and available. You can check with: + ```bash pip3 --version ``` @@ -139,11 +153,12 @@ pip3 uninstall silkaj --user silkaj info ``` ---- +______________________________________________________________________ ## Install from original sources from the forge ### Retrieve silkaj sources on linux + ```bash sudo apt install git git clone https://git.duniter.org/clients/python/silkaj.git @@ -155,6 +170,7 @@ cd silkaj First, you have to install the git tool from https://git-scm.com/download/win Then change directory to where you want to download the sources, for instance: + ```bash cd ~/appdata/Roaming/ ``` @@ -167,6 +183,7 @@ which will create a folder silkaj ``` Then change directory to the downloaded folder + ```bash cd ~/appdata/Roaming/silkaj ``` @@ -174,11 +191,13 @@ Then change directory to the downloaded folder ### Install After being sure you have changed directory to the downloaded folder + ```bash pip3 install . ``` Or install it as "editable", for development: + ```bash pip3 install -e . ``` diff --git a/doc/install_poetry.md b/doc/install_poetry.md index 59bae276..aa20ca66 100644 --- a/doc/install_poetry.md +++ b/doc/install_poetry.md @@ -9,9 +9,11 @@ sudo dnf install libsodium # Fedora ``` ### Install Poetry + - [Installation documentation](https://python-poetry.org/docs/#installation) ### On Debian Buster + ```bash sudo apt install python3-pip python3-venv sudo apt install libffi-dev # Required on ARMbian @@ -19,6 +21,7 @@ pip3 install poetry --user ``` ### Install dependencies and the Python virtual environment + ```bash # Over HTTPS git clone https://git.duniter.org/clients/python/silkaj.git @@ -33,13 +36,17 @@ poetry install ``` ### Run Silkaj + Within `silkaj` repository run Silkaj: + ```bash poetry run silkaj ``` ### Poetry shell + You can access tools (`pytest`, `black`) from within the development environment with `poetry run` or by entering the shell: + ```bash silkaj> poetry run pytest silkaj> poetry run black @@ -52,10 +59,13 @@ silkaj> poetry shell ``` ### Make Silkaj accessible from everywhere + Add following alias to your shell configuration: + ```bash alias silkaj="cd /path/to/silkaj && poetry run silkaj" ``` ### Contribute + Follow the [contributing guide](CONTRIBUTING.md). diff --git a/doc/test_and_coverage.md b/doc/test_and_coverage.md index c8450786..83321a35 100644 --- a/doc/test_and_coverage.md +++ b/doc/test_and_coverage.md @@ -3,6 +3,7 @@ ### Install tests dependencies Using pipenv: + ``` pipenv install --dev ``` @@ -10,28 +11,31 @@ pipenv install --dev ### Runing tests: Simply run: + ``` pytest ``` To have a coverage report: + ``` pytest --cov silkaj --cov-report html:cov_html ``` Where: -* `--cov silkaj` option generates coverage data on the silkaj package -* `--cov-report html:cov_html` generates a browsable report of coverage in cov\_html dir. You can omit this if you just want coverage data to be generated -See [pytest documentation](https://docs.pytest.org/en/latest/usage.html) for more information +- `--cov silkaj` option generates coverage data on the silkaj package +- `--cov-report html:cov_html` generates a browsable report of coverage in cov_html dir. You can omit this if you just want coverage data to be generated +See [pytest documentation](https://docs.pytest.org/en/latest/usage.html) for more information ### Writing tests There should be 3 kinds of test: -* end to end test: uses the real data and the real blockchain. Obviously don't presume the data value as it can change. These test are written in tests/test\_end\_to\_end.py. -* integration test: mock some of the input and/or output classes and shouldn't use the actual blockchain, you should use this when mocking a class (used by your code) is too complicated. -* unit test: for functions that don't need mock or mock can me done easily (you should prefer this to integration tests). Are written in tests/test\_unit\_*package*.py + +- end to end test: uses the real data and the real blockchain. Obviously don't presume the data value as it can change. These test are written in tests/test_end_to_end.py. +- integration test: mock some of the input and/or output classes and shouldn't use the actual blockchain, you should use this when mocking a class (used by your code) is too complicated. +- unit test: for functions that don't need mock or mock can me done easily (you should prefer this to integration tests). Are written in tests/test_unit\_*package*.py You should try to write an end to end test first, then if your coverage too bad add some unit tests. If it's still too bad, write an integration test. @@ -41,7 +45,7 @@ A better strategy (TDD) is to write first the End to end test. When it fails, be Test an Exception is raised: https://docs.pytest.org/en/latest/assert.html#assertions-about-expected-exceptions -Test a function with several values: You can use pytest.mark.parametrize as done in tests/test\_unit\_tx.py +Test a function with several values: You can use pytest.mark.parametrize as done in tests/test_unit_tx.py To mock a user input: diff --git a/release_notes/v0.10.0.md b/release_notes/v0.10.0.md index 071f3e08..29bc432e 100644 --- a/release_notes/v0.10.0.md +++ b/release_notes/v0.10.0.md @@ -19,9 +19,11 @@ As always, this release also comes with an emphasis on the development environme with `pre-commit` usage generalization with the introduction of new hooks. ## 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: + ```bash silkaj revocation --help Usage: silkaj revocation [OPTIONS] COMMAND [ARGS]... @@ -45,7 +47,9 @@ 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`: + ```txt <ABSOLUTE|RELATIVE> @@ -55,10 +59,12 @@ You can now define a file following this format. For instance, a file named `rec # 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: + ```bash silkaj --gtest tx -f recipients.txt ``` @@ -66,10 +72,12 @@ 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. + ```bash silkaj license In which language would you like to display Äž1 monetary license? (es, en, eo, it, fr, pt) [en]: fr @@ -78,32 +86,40 @@ In which language would you like to display Äž1 monetary license? (es, en, eo, i 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](doc/docker.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. diff --git a/release_notes/v0.10.0rc.md b/release_notes/v0.10.0rc.md index f8fda4dc..e69ba508 100644 --- a/release_notes/v0.10.0rc.md +++ b/release_notes/v0.10.0rc.md @@ -5,22 +5,28 @@ 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. ## Pre-release installation + You install this pre-release version from PyPI or from a Docker image. To install the Python package, run following command: + ```sh pip3 install silkaj --user --upgrade --pre ``` To [install and run Silkaj from the Docker image](doc/docker.md): + ```bash sudo docker pull registry.duniter.org/clients/python/silkaj/release/pip:v0.10.0rc0 ``` + Run Silkaj from outside the image: + ```bash 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. @@ -29,8 +35,10 @@ 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: + ```bash silkaj revocation --help ``` @@ -46,27 +54,34 @@ silkaj --gtest revocation publish revocation_test.txt ``` Or directly all the previous steps with one command: + ```bash silkaj --gtest revocation revoke ``` ### License + Check Äž1 monetary license get displayed correctly in any language and in any configuration: workstation or headless computers. + ```bash 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. + ```bash 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: + ```txt ABSOLUTE @@ -78,6 +93,7 @@ ABSOLUTE ``` And pass it to `silkaj tx` command as follow: + ```bash silkaj --gtest tx -f recipients.txt ``` @@ -86,10 +102,11 @@ 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. diff --git a/release_notes/v0.8.md b/release_notes/v0.8.md index 9f44c214..438f250b 100644 --- a/release_notes/v0.8.md +++ b/release_notes/v0.8.md @@ -1,23 +1,27 @@ # Silkaj v0.8.0 release ## Introduction + The Silkaj team is pleased to announce the release of Silkaj 0.8.0. A new team member joined us at the beginning of this development cycle: Matograine. We highly appreciate his commitment, his improvements of the transaction code and his work on the checksum. This release comes along with a number of new features and improvements. The most important of them are highlighted in this article, if you are looking for a comprehensive list of changes, check out the [changelog](https://git.duniter.org/clients/python/silkaj/blob/main/CHANGELOG.md). Version 0.8.0 was done in 145 commits, and features seven major improvements: + 1. `membership`: We developed a command to allow users to send membership documents. -2. Identity choice: We can now manually choose the desired identity among other identities. -3. Multi-recipients transactions: Users can simultaneously send a different amount of Äž1 to different recipients. -4. Display improvements for `tx` and `balance`: For a better overview, we modified the `tx` table and added a `balance` table. -5. Public key checksum display and verification: For security purposes, Silkaj displays and verifies the checksum. -6. `verify`: We set up a command to check whether a block is valid. -7. Dev Env: We set up a solid development environment for Poetry, CI/CD, and Tests. - - A. Poetry: We migrated to Poetry. - - B. CI/CD: We set up a pipeline to run automatic jobs. - - C. Tests: We started to write tests. +1. Identity choice: We can now manually choose the desired identity among other identities. +1. Multi-recipients transactions: Users can simultaneously send a different amount of Äž1 to different recipients. +1. Display improvements for `tx` and `balance`: For a better overview, we modified the `tx` table and added a `balance` table. +1. Public key checksum display and verification: For security purposes, Silkaj displays and verifies the checksum. +1. `verify`: We set up a command to check whether a block is valid. +1. Dev Env: We set up a solid development environment for Poetry, CI/CD, and Tests. + +- A. Poetry: We migrated to Poetry. +- B. CI/CD: We set up a pipeline to run automatic jobs. +- C. Tests: We started to write tests. ## 1. Membership + After the transaction and the certification commands, the much awaited `membership` command is now available. Users can send their first membership request to be a certified member of the Äž1 community. As certified members have to renew their membership each year, this command allows to send the renewal application in question. It displays the expiration date of the current membership and indicates the identification blockstamp of the user. In the event a user forgets that they have already sent a membership request, a pop up displays if there is a pending membership request in the mempool. @@ -51,6 +55,7 @@ Do you confirm sending a membership document for this identity? [y/N]: ``` ## 2. Identity choice + When using the commands `wot`, `cert`, and `membership`, Silkaj used to select the first identity on the list. As this can lead to fishing, we added a new feature to pick the identity of your choice. Now, you can use the `uid` and the `pubkey` to certify an identity and study its status in the Web of Trust. Please note that identities can have the same user identifier and the same public key. @@ -66,12 +71,14 @@ Which identity would you like to select (id)?: ``` ## 3. Transactions: multi-recipients & different amounts of Äž1 + Thanks to Matograine, users can now send different amounts of Äž1 to multiple recipients in the same document. Working on this feature offered us the opportunity to rethink and clean up the CLI and the code related to the `tx` command. However, further efforts are required to build a more solid code base foundation. <br /> v0.8.0 comes with three **breaking changes** and four small options: + - `--output` was renamed to `--recipient` - recipients public key are splits with the option `--recipient` instead of a colon character. - The public key's checksum separator `!` is being replaced by the colon. @@ -80,7 +87,7 @@ v0.8.0 comes with three **breaking changes** and four small options: - `-d/--amountUD` - `-r/--recipient` - `-c/--comment` -<br /> + <br /> The follow examples illustrates the change operated on the CLI. With the previous version of Silkaj, the following procedure was operated to send one unit to `pubkey1` and `pubkey2`: @@ -90,11 +97,13 @@ silkaj tx --amount 1 --output <pubkey>1!<checksum1>:<pubkey2>!<checksum2> ``` With the current version of Silkaj, the following procedures are operated to send one unit to `pubkey1` and two units to `pubkey2`: + ```bash silkaj tx --amount 1 --recipient <pubkey1>:<checksum1> --amount 2 --recipient <pubkey2>:<checksum2> ``` With small options: + ```bash silkaj tx -a 1 -r <pubkey1>:<checksum1> -a 2 -r <pubkey2>:<checksum2> ``` @@ -102,9 +111,11 @@ silkaj tx -a 1 -r <pubkey1>:<checksum1> -a 2 -r <pubkey2>:<checksum2> In the case one amount is passed, the same amount will be send to the passed recipients. The `--allSources` option is only working with one recipient. ## 4. Display improvements for `tx` and `balance` + We merged the relative and absolute amounts into one cell. This applies to the cells: initial balance, total transaction amount, balance after the transaction, and individual amounts. To send a different amount of Äž1 to multi-recipient proceed following: + ```bash silkaj tx -d 1 -d 2 \ -r CrznBiyq8G4RVUprH9jHmAw1n1iuzw8y9FdJbrESnaX7 \ @@ -156,10 +167,12 @@ silkaj balance 78ZwwgpgdH5uLZLbThUQH7LKwPgjMunYfLiCfUCySkM8 ``` ## 5. Pubic key checksum display, verification, and checksum command + For security purposes, Silkaj now displays the checksum associated with the public key, and verifies it when passed to a command. If a public key or an authentication method is passed to the newly introduced `checksum` command, the later generates the associated checksum to the public key. if a public key and a checksum are passed, Silkaj displays whether the checksum is valid or not. ## 6. `verify` + We introduced the new `verify` command to check whether the signatures of the blocks of the blockchain are valid since there was a bug in the cryptography library of Duniter. Cf [Forum topic](https://forum.duniter.org/t/duniter-utilise-une-ancienne-version-buggee-de-tweetnacl-que-faire/6633) and [Duniter ticket](https://git.duniter.org/nodes/typescript/duniter/-/issues/1390) @@ -172,6 +185,7 @@ Within 0-342803 range, blocks with a wrong signature: 15144 31202 85448 87566 90 ``` ## 7. Development Environment + ### A. Poetry <img src="images/poetry-logo.svg" width="7%" alt="Poetry logo"> @@ -183,10 +197,13 @@ In comparison, [Poetry](https://python-poetry.org/) is a well thought and stable If you would like to install Silkaj for development purposes, please follow [this tutorial](https://git.duniter.org/clients/python/silkaj/-/blob/main/doc/install_poetry.md). You may also interested by checking the newly introduced [contribution process documentation `CONTRIBUTING.md`](https://git.duniter.org/clients/python/silkaj/-/blob/main/CONTRIBUTING.md). ### B. Automatic container generation + We set up an [automated pipeline to generate containers](https://git.duniter.org/docker/python3/poetry/) for all supported Python versions: 3.5, 3.6, 3.7, and 3.8. These containers are based on official Python containers, which use Debian Buster Slim. On top of that, Poetry, `libsodium`, and other development tools are installed to continually check and test Silkaj in its pipeline. Since DuniterPy uses the same containers, it also profits from this automated container generation. ### C. CI/CD pipelines + Based on the containers set out above, a continuous integration and delivery pipeline has been set up to automatically run: + - Checks: format, build, - Tests on all supported Python versions, - Release publication automation on PyPI and PyPI test. @@ -194,11 +211,13 @@ Based on the containers set out above, a continuous integration and delivery pip  ## 7. Tests + We started to write tests to ensure that all features of Silkaj are still functional when changing the code. However, in order to have all Silkaj commands fully tested, further efforts are required. During this development cycle, the test coverage raised from 37% to 69% and Silkaj is now covered by more than hundred tests. ## Outlook + Silkaj is compatible with a range of Python versions. Currently, it can be used with Python 3.5, 3.6, 3.7, and 3.8. v0.8.x will be the last releases with Python 3.5 support. In v0.9.0, we will support Python 3.6, 3.7, 3.8, and 3.9. Since there is a deadline for packaging Silkaj and DuniterPy into Debian Bullseye (v11), we are putting all our efforts into the upcoming packaging. As for the coming version, DeathReaper, the `excluded` command, for which the crowdfunding has been completed, and the newly revamped `info` command will be stabilized and automatic tests will be written. @@ -206,8 +225,10 @@ Since there is a deadline for packaging Silkaj and DuniterPy into Debian Bullsey @ManUtopiK revamped the [website of Silkaj](https://mystifying-nobel-66ae54.netlify.app) in which you can look up all the presentations, the major features and documentations related to Silkaj. We are working on integrating the website into the project. For further details check out the presentations of the [RML14](https://rml14.monnaielibreoccitanie.org/). The oral presentations are in French and the slides in English: + - [Moul's: How to contribute to Silkaj](https://git.duniter.org/moul/slides/#rml14-toulouse-28th-november-2019) - [Matograine's: Envoyer des transactions exotiques avec Silkaj](https://www.youtube.com/watch?v=Fbwy5ovEkSg) ### Thanks + @moul, @matograine diff --git a/release_notes/v0.9.0rc.md b/release_notes/v0.9.0rc.md index a4a7429f..3132aec1 100644 --- a/release_notes/v0.9.0rc.md +++ b/release_notes/v0.9.0rc.md @@ -5,66 +5,79 @@ Hello everyone! We are pleased to publish a release candidate of Silkaj v0.9.0, and we would be happy to receive feedback before releasing it as a stable version. To install this pre-release version from PyPI, use this command: + ```sh pip3 install silkaj --user --upgrade --pre ``` + Please test it globally, and check [the changelog](https://git.duniter.org/clients/python/silkaj/-/blob/main/CHANGELOG.md#v090rc-24th-march-2021) which contains the changes which happen during this development cycle. Pay a special attention to the transaction part where a part of the algorithm changed. There are new options on following commands: + ```sh silkaj history --full-pubkey silkaj --dry-run cert silkaj --dry-run/--display membership ``` + Dry-run and display options are defined as general options, and only defined for this three cases for this release. # Tests + Manual tests help us making sure everything works fine for different cases. Here are some tests we think are necessary. Make sure you test on Äž1-Test network to avoid any loss of money. ## `tx` -* send a TX to a unique recipient -* send a TX to multiple recipients - * with one amount - * with multiple amounts -* send a TX to 92 recipients (can be 92 times the same) -* send a TX to 93 recipients (should fail) + +- send a TX to a unique recipient +- send a TX to multiple recipients + - with one amount + - with multiple amounts +- send a TX to 92 recipients (can be 92 times the same) +- send a TX to 93 recipients (should fail) ## `membership` -* renew membership with `--dry-run` global option -* renew membership with `--display` global option -* renew membership without these two options + +- renew membership with `--dry-run` global option +- renew membership with `--display` global option +- renew membership without these two options ## `cert` -* send a certification with `--display` global option -* cert all identities you can on GTest network (thanks for keeping it alive ;-) ) -* cert pubkey `4KEA63RCFF7AXUePPg5Q7JX9RtzXjywai1iKmE7LcoEC:DRz` on Äž1-Test -> you should be suggested two identities -* cert identity `ggg_ggg_2` on Äž1-Test -> you should NOT be proposed many identities + +- send a certification with `--display` global option +- cert all identities you can on GTest network (thanks for keeping it alive ;-) ) +- cert pubkey `4KEA63RCFF7AXUePPg5Q7JX9RtzXjywai1iKmE7LcoEC:DRz` on Äž1-Test -> you should be suggested two identities +- cert identity `ggg_ggg_2` on Äž1-Test -> you should NOT be proposed many identities ## `history` -* check you history -* check you history and display userIDs -* check you history and display pubkeys in full-length -* check you history and display userIDs and pubkeys in full-length + +- check you history +- check you history and display userIDs +- check you history and display pubkeys in full-length +- check you history and display userIDs and pubkeys in full-length ## `wot` -* check your WoT infos are correct with `wot` command + +- check your WoT infos are correct with `wot` command ## `checksum` -* use `checksum` command to compute a checksum for one of your public keys. -* verify it with Silkaj -* verify it with Cesium -* try to change a character in the public key (with the checksum), then verify that it is wrong. + +- use `checksum` command to compute a checksum for one of your public keys. +- verify it with Silkaj +- verify it with Cesium +- try to change a character in the public key (with the checksum), then verify that it is wrong. ## auth -* create an authfile for a Äž1-Test account -* send txs or certs using the authfile + +- create an authfile for a Äž1-Test account +- send txs or certs using the authfile ## Other + Feel free to play! ---- +______________________________________________________________________ The release is planned for the 17th April of 2021, which will contain a detailed announcement of the changes and the new features. diff --git a/release_notes/v0.9.md b/release_notes/v0.9.md index eaf67cc3..8274b110 100644 --- a/release_notes/v0.9.md +++ b/release_notes/v0.9.md @@ -1,10 +1,12 @@ # Silkaj v0.9.0 release ## Introduction + The Silkaj team is pleased to announce the release of Silkaj 0.9.0. The most important changes are highlighted in this article, if you are looking for a comprehensive list of changes, check out the [changelog](https://git.duniter.org/clients/python/silkaj/blob/main/CHANGELOG.md). #### Transaction + Silkaj is now properly handling the transaction document size limit. The 100 lines limit length of the transaction document in the compact format is now properly fulfilled by computing the length of the generated document. @@ -14,6 +16,7 @@ When spending lots of sources (i.e. huge amounts from member wallets), many usel Unit tests have been written on the `tx` command, which comforts us into developing new features. #### Refactored `id`/`lookup` command + The `id` command has been completely refactored. It now offers comprehensive results when looking for an identity by specifying a user identifier or a public key. Now the non-member user identifier are displayed. The command now uses same algorithm as `choose_identity()` which relies exclusively on `/wot/lookup` BMA's path. @@ -58,6 +61,7 @@ Current balance: 9012407.83 ÄžTest, 161.34 UD ÄžTest on the 2021-04-09 15:16:42 ``` #### `balance` command is now displaying corresponding member identity user identifier + ```bash silkaj -gt balance 5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH â•’â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¤â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•• @@ -72,6 +76,7 @@ silkaj -gt balance 5B8iMAzq1dNmFe3ZxFTBQkqhq4fsztg1gZvxHXCk1XYH ``` #### Display option on `cert`, `membership` commands + This general option allows to display the generated document aside of the confirmation prompt before sending the document. It can be used for debugging, safety, or curiosity purposes. This option has only been implemented on the `cert` and the `membership` commands for now. @@ -134,12 +139,15 @@ Membership successfully sent ``` #### Dry Run option is becoming a generic option + Before: + ```bash silkaj membership --dry-run ``` Now: + ```bash silkaj --dry-run membership ``` @@ -151,15 +159,19 @@ For safety reasons, the `--dry-run` option doesn't allow, at the end, to send th On contrary, the `--display` option allows to send the document to the network. #### Python support + Support for Python 3.5 has been dropped and support for Python 3.9 has been added. #### Silkaj v0.8.1 in Debian Bullseye + If you are a user of Debian or its derivatives, you will be able to find Silkaj v0.8.1 available into Debian Bullseye (v11) which is about to be released. Silkaj package has been updated from v0.6.5 to v0.8.1 and DuniterPy v0.60.1 entered Debian repository for the first time. #### Outlook + In the next developments, we are planning to work on DeathReaper, the implementations of the `revoke` and the `identity` commands. The removal of the asynchronous property, the migration from `tabulate` to `Texttable`, and the migration from BMA to GVA. ### Thanks + @matograine, @moul, @jonas, @atrax -- GitLab