Silkaj v0.7.x releases: DuniterPy, click, history, Debian, website

Six months after the previous major release, I am pleased to announce the release of Silkaj v0.7.0 for the thirteenth Free Currency Meeting.

This release comes with 157 commits, the migration to DuniterPy and Click, the display of transaction history, the packaging into Debian Buster and Ubuntu 19.04, and the update of the website.

Those two migrations do not bring much new features for now as the goal was to migrate to better libraries while keeping the same functionalities.

Highlights

DuniterPy migration

DuniterPy_logo

DuniterPy is a Python library which implements methods to request from and send information to the Duniter nodes. It also has authentication methods that sign documents such as transactions and certifications. DuniterPy was written for the Sakia client. Silkaj and Sakia are now sharing the same code. The migration to DuniterPy was tough, but it was worth it: It allows to implement new features for future versions.

There were many challenges: keeping the same functionalities, making Silkaj’s code asynchronous, and replacing the authentication and the network code by the ones implemented in DuniterPy. One struggling issue was that the intermediaries transactions were no longer working, because, the equality method of the transaction outputs was no longer working, as they used to be stored in a string and are now stored into an OutputSource object. So, the equality had to be implemented.

Check-out DuniterPy versions from v0.50.0 to v0.54.1 to follow the evolution of DuniterPy. These versions were made for Silkaj. In the future, following functionalities are planned: to send identity, membership, and revocation documents, to fully employ the authentication methods implemented in DuniterPy, and to use the planned GVA API.

Click migration

Since Debian Buster freeze was very soon and commandlines library wasn’t packaged into Debian, the migration to ClickCommand Line Interface Creation Kit” had to be done very fast. I decided to migrate to this really nice library, since it is much more maintained, comes with a better code, and has no bugs.

Usage: silkaj [OPTIONS] COMMAND [ARGS]...

Options:
  -h, --help               Show this message and exit.
  -v, --version            Show the version and exit.
  -p, --peer TEXT          Default endpoint will reach Ğ1 currency with
                           `https://g1.duniter.org` endpoint. Custom endpoint
                           can be specified with `-p` option followed by
                           <domain>:<port>
  -gt, --gtest             ĞTest: `https://g1-test.duniter.org` endpoint
  --auth-scrypt, --scrypt  Scrypt authentication: default method
  --nrp TEXT               Scrypt parameters: defaults N,r,p: "4096,16,1"
  -af, --auth-file         Authentication file. Defaults to: './authfile'
  --file TEXT              Path file specification with '--auth-file'
                           [default: authfile]
  --auth-seed, --seed      Seed hexadecimal authentication
  --auth-wif, --wif        WIF and EWIF authentication methods

Commands:
  about     Display program information
  argos     Display currency information formatted for Argos or BitBar
  authfile  Generate authentication file
  balance   Get wallet balance
  blocks    Display blocks: default: 0 for current window size
  cert      Send certification
  diffi     Display the current Proof of Work difficulty level to generate...
  history   Display transaction history
  id        Find corresponding identity or pubkey from pubkey or identity
  info      Display information about currency
  license   Display Ğ1 license
  net       Display network view
  tx        Send transaction
  wot       Check received and sent certifications and consult the...

The command line interface has changed. General parameters (options and arguments) should be placed in between the command and the sub-command. Specific parameters should be placed after the sub-command.

For instance
In the following command --gtest, and --auth-file are general parameters and --amount, and --output specific parameters separated by the tx sub-command.

silkaj --gtest --auth-file tx --amount 5 --output <pubkey>

You can display general parameters with silkaj --help and specific parameters with silkaj tx --help for instance.

CLI changes

  • issuers, amount, and generate_auth_file commands have been respectively renamed to blocks, balance, and authfile.
  • The long sub-commands certification, transaction, network, identities were removed. Now you have to use the small ones: cert, tx, net, id.
  • blocks defaults to 0 which stands for the current windows size and now has a limit of 5.000 blocks as set by BMA.
  • balance: public keys separator does no longer use colons :, it uses spaces instead.
  • Additionally, there are the new smaller authentication options: --scrypt, -af, --seed, --wif, without the --auth prefix.

You might discover other breaking changes. To know more about those changes read this.

Transaction history

It is now possible to display the transactions history of a wallet:

silkaj history GfKERHnJTYzKhKUma5h1uWhetbA8yHKymhVH2raf2aCP --uids

Transactions history from: moul GfKERHnJTYzKhKUma5h1uWhetbA8yHKymhVH2raf2aCP
Current balance: 17296.86 Ğ1, 1717.66 UD Ğ1 on the 2019-05-12 13:32:30
+---------------------+------------------------+------------+--------------+-----------------------+
|        Date         |   Issuers/Recipients   | Amounts Ğ1 | Amounts UDĞ1 |        Comment        |
+=====================+========================+============+==============+=======================+
| 2019-04-23 21:31:27 | CvrMiUhAJpNyX5sdAy     | 100.700    | 10           | Silkaj sur Ubuntu c   |
|                     |                        |            |              | est une tres belle    |
|                     |                        |            |              | surprise. Merci !     |
+---------------------+------------------------+------------+--------------+-----------------------+
| 2019-04-22 18:59:34 | HugoTrentesaux -       | 100.700    | 10           | Merci pour Duniter    |
|                     | 55oM6F9ZE2MGi          |            |              | v1.7.16 !             |
+---------------------+------------------------+------------+--------------+-----------------------+
| 2019-04-15 14:35:15 | ArthurLutz -           | 200        | 19.861       | pour les paquets      |
|                     | 4C4jsvxmFQBoH          |            |              | yunohost !            |
+---------------------+------------------------+------------+--------------+-----------------------+
| 2019-04-15 10:40:11 | SonqoZEfZXHDBxi4Kx     | 30.210     | 3            | [G1SMS] VIREMENT 300  |
|                     |                        |            |              | LOVE (30.21 G1)       |
+---------------------+------------------------+------------+--------------+-----------------------+
| 2019-04-15 08:04:58 | fbuland -              | 200        | 19.861       | merci resolution bug  |
|                     | 4bD7J3uA5pH2N          |            |              |                       |
+---------------------+------------------------+------------+--------------+-----------------------+
| 2019-04-13 16:37:20 | Vivakvo -              | 100.700    | 10           | Merci pour Duniter    |
|                     | 4wUdA1dx1NCZU          |            |              | v1.7.16 !             |
+---------------------+------------------------+------------+--------------+-----------------------+
| 2019-04-12 08:59:04 | C4pUj26pVgPVPLEZ96     | 50         | 4.965        | Bravo pour le bug     |
+---------------------+------------------------+------------+--------------+-----------------------+
| 2019-04-08 16:48:04 | 73ArdqtsQScypV35H4     | 100.700    | 10           | Merci pour Duniter    |
|                     |                        |            |              | v1.7.16 !             |
+---------------------+------------------------+------------+--------------+-----------------------+
| 2019-04-08 15:58:06 | Lucas - HY2nJUyxpzyrw  | 100.700    | 10           | Merci pour Duniter    |
|                     |                        |            |              | v1.7.16 !             |
+---------------------+------------------------+------------+--------------+-----------------------+
| 2019-04-08 15:10:25 | BenoitLavenier -       | 100.700    | 10           | Merci pour Duniter    |
|                     | 38MEAZN68Pz1D          |            |              | v1.7.16 !             |
+---------------------+------------------------+------------+--------------+-----------------------+
| 2019-04-08 14:11:00 | 4sfQWXBBy811CCDV6J     | 100.700    | 10           | 1.7.16                |
+---------------------+------------------------+------------+--------------+-----------------------+
| 2019-04-07 22:59:00 | elois - D9D2zaJoWYWve  | 100        | 9.930        | merci pour le debug   |
|                     |                        |            |              | de duniter et du      |
|                     |                        |            |              | process de release    |
|                     |                        |            |              | aussi                 |
+---------------------+------------------------+------------+--------------+-----------------------+
| 2019-04-07 21:51:41 | Matograine -           | 100.700    | 10           | V1.7.16               |
|                     | CmFKubyqbmJWb          |            |              |                       |
+---------------------+------------------------+------------+--------------+-----------------------+
| 2019-04-07 01:18:44 | cgeek - 2ny7YAdmzReQx  | 1007       | 100          | Duniter v1.7.16       |
+---------------------+------------------------+------------+--------------+-----------------------+

Debian and Ubuntu package

Silkaj v0.6.5 was packaged for Debian Buster v10, which is planned te be release for July 6th 2019. This package greatly benefits all Debian-based distributions. Moreover, Silkaj was incorporated in the repository of Ubuntu 19.04, published in March 2019. For more details check-out where Silkaj was included into the Debian-based distributions. Silkaj v0.6.5 now comes with Click migration, auto-completion, and bug fixes, however it does not include DuniterPy migration and v0.7.0 features.

You can install Silkaj with following command:

sudo apt install silkaj

This work have been made possible thanks to @jonas, a Debian developer.

Difficulty level

Since we are using DuniterPy which includes WebSocket, this latter can be used to improve the network connection. Previously, Silkaj was sending queries every five seconds to check if a new block was added to the blockchain. Now, Silkaj gets a notification every time a new block is appended to the blockchain. This improvement dramatically reduces the network traffic.

To better monitor the network, the header was improved and now displays the current block’s number and its date of generation:

Current block: n°219981, generated on the 2019-05-12 14:36:35
Generation of next block n°219982 possible by at least 31/44 members
Common Proof-of-Work difficulty level: 89, hash starting with `00000[0-6]*`

New website

silkaj_website_screenshot

A simple website was made at the beginning of the project.
Since then, Silkaj evolved and have brought new features.

More content was added to the website, which now has three pages: a main one, one for the features and the other one for the installation.

@Attilax worked to give the website a new black style, to make it looks like a terminal.
He also translated it in French which makes the website available in two languages.

Changelog

For further details, please check out the changelog.

Thanks

@Attilax, @Bernard, @cebash, @jonas, @matograine, @vit


Install and upgrade

Future development cycles

Future releases will add new features based on DuniterPy such as new authentication methods as well as being able to send WoT documents: identity publication, membership publication and renewal, and revocation. It is also planned to use features brought by Click usage, to set-up CI/CD pipeline, and locking the code with tests.

Contribute

If you are pleased with the achievement, please contribute by reporting bugs, contributing to the code or giving to Duniter developers libre units to improve our little world.

Share on social networks

7 Likes

Silkaj v0.7.1 release (29th May 2019)

  • Bug fix transaction generation
1 Like

Silkaj v0.7.2 release (25th June 2019)

  • Fix result of the multiplication of the amount passed as float for the transaction command

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
3 Likes

v0.7.4 (22th January 2020)

  • #273: Fix broken PubSec authfile importation regex

Thanks to @matograine for this bugfix and the release!

2 Likes

v0.7.5 (23th January 2020)

  • #276: Publish on PyPI with the previous method: setup.py, wheel, and twine.
  • silkaj binary does not get installed to $HOME/.local/bin via Poetry
3 Likes

v0.7.6 (24th January 2020)

  • Update DuniterPy to v0.55.1 in order to have the PubSec regex fixed
2 Likes