silkaj issueshttps://git.duniter.org/clients/python/silkaj/-/issues2023-12-06T16:54:13+01:00https://git.duniter.org/clients/python/silkaj/-/issues/429Migrate to Substrate2023-12-06T16:54:13+01:00MoulMigrate to SubstrateDuniter v2 Substrate support with `substrate-interface`:
- APIs: RPC, and GraphQL Hasura
---
- [`substrate-interface` repository](https://github.com/polkascan/py-substrate-interface)
- [`SubstrateInterface` documentation](https://polkas...Duniter v2 Substrate support with `substrate-interface`:
- APIs: RPC, and GraphQL Hasura
---
- [`substrate-interface` repository](https://github.com/polkascan/py-substrate-interface)
- [`SubstrateInterface` documentation](https://polkascan.github.io/py-substrate-interface/)
- [Extrinsincs: Runtime calls](https://duniter.org/wiki/duniter-v2/runtime-calls/)
- [Runtime events](https://duniter.org/wiki/duniter-v2/runtime-events/)
---
### Transition plan
- Release and maintain v0.12.0 as BMA-only
- v0.20.0dev as Substrate-only
Allow non-related developments/experimentation to happen in parallel?: Which would not create much git conflicts:
- #433+
- #79+: Seems the best candidate, the class development it-self, not the integration in the commands
- #18+, #440+: PyGObject3, Textual TUI console: Just experimentation of the possibilities, interface design, no integration
---
### Consider Hexagonal architecture
- duniterpy#117
- https://blog.octo.com/architecture-hexagonale-trois-principes-et-un-exemple-dimplementation/ [en](https://blog.octo.com/en/hexagonal-architecture-three-principles-and-an-implementation-example/)
---
### Set up Duniter v2s and indexer on ĞDev
- [x] [Set-up Duniter-v2s](https://duniter.org/wiki/duniter-v2/run-smith/)
- [ ] [Become smith](https://duniter.org/wiki/duniter-v2/become-smith/)
- [ ] Set-up Indexer: [Subsquid](https://forum.duniter.org/t/subsquid-for-gdev/10684), [duniter-indexer](https://git.duniter.org/manutopik/duniter-indexer)
### Plan
> - Split changes in child items/sub-tickets. Put them in the Kanban board and/or milestone.
> - Ideas from [Tikka roadmap](https://forum.duniter.org/t/feuille-de-route-de-tikka/8977)
> - [Matograine’s plan](https://git.duniter.org/matograine/silkaj/-/blob/ef232fb934249a15e2bb49580c2a8c8462b47a43/PLAN_TRANSITION_V2S.md)
- ~~Delete code of commands which will be rewritten, keep structure, pick code in git history for the reimplementation~~
- Delete step-by-step commands, functions which have been rewritten
#### Delete features which don’t make sense anymore and which are not very coupled
- [x] Delete `blockchain diffi`, since the PoW is no longer a thing with BABE/Grandpa consensus algorithm
- [x] Delete `blockchain verify` cmd, doesn’t make sense anymore, algorithm can be retrieved in the git history for next `blocks` implementation (#283)
- [x] Delete `checksum` command since the address integrity (checksum) and currency is integrated into the address.
#### Set up network layers
- [x] Introduce [`substrate-interface`](https://pypi.org/project/substrate-interface/) dependency
- [x] Set up RPC API network layer
- [ ] Set up GraphQL API network layer
#### Pre-requisites
- [ ] #477+
##### Authentication
###### v1/v2 methods handling
- [ ] Function to use v1/ED25519 or v2/SR25519 authentication to all commands depending on what has been passed
- [ ] save v1 auth files into config/auth directory
- [ ] Priority: v2 auth file, v1 methods. default?
- [ ] ~~Warn in the release note (and from TUI?) that v1 auth methods are deprecated and will be dropped in next release (after migration to Duniter v2s). Please convert your `authfiles` to v2 format.~~
- [ ] ~~Allow commands authentication only from encrypted json v2 format~~
- [ ] Not very useful feature. Delete ~~Command to [convert v2 pubkey v1 → ss58 v2s address](https://forum.duniter.org/t/python-script-to-generate-g1v2-genesis-json/9795/2)~~
###### v2 method
- [x] Implement Substrate authentication method: [create](https://polkascan.github.io/py-substrate-interface/reference/keypair/#substrateinterface.keypair.Keypair.export_to_encrypted_json), [read](https://polkascan.github.io/py-substrate-interface/reference/keypair/#substrateinterface.keypair.Keypair.create_from_encrypted_json)
- [ ] `save-authfile` command: ~~`Convert v1 authentication methods to encrypted v2 authentication json file format`~~
- Can’t save encrypted authfile from v1 authentication methods (ED25519)
- [ ] Encrypted json v2 format creation from `mnemonic` (#90+)
###### Status
- Having both (v1) ed25519 and (v2) sr25519 authentication methods makes things more complex
- Substrate interface does not support to save this cryptography into the json encrypted file format
###### Options
- [Will substrate-interface provide ed25519 to be save as json encrypted file format?](https://github.com/polkascan/py-substrate-interface/blob/40f255cbca1b32c429c3eb7f8d35fcd46e83efee/substrateinterface/keypair.py#L412-L417) Do we wait for it? Try to overwrite `Keypair.export_to_encrypted_json()` with `ed25519` support if it works (`super()`).
- Get rid of ed25519 auth methods from silkaj:
- transfer Ğ1 units from a ed25519 to an sr25519 (this transfer still requires v1 auth)
- Can we convert at the conversion stage from Nd.js to Substrate [with this migrator](https://git.duniter.org/tools/py-g1-migrator/-/blob/master/custom/addresses_switches.json)?
##### Others
- [ ] Get currency code/name from RPC
- [ ] Display fees per transaction and ask for confirmation (some are reimbursed, so mention the fees are reimbursed)
- [ ] Request `uids` from the indexer to set the link between the identity index and the identity nickname/alias
#### Migrate existing features
> (I): requires the indexer
- Get information from displaying commands from RPC queries:
- [x] `money balance`
- [ ] (I?) `info`
- [ ] (I?) `wot status`
- Adapt commands which send RPC calls extrinsics:
- [ ] `money transfer`: basic transfer, multi-recipients
- [ ] `wot certify`
- [ ] `wot membership`
- [ ] `wot revocation`
- Get information from displaying commands from the indexer:
- [ ] (I) `wot lookup`
- [ ] (I) `money history`
- [ ] `blockchain blocks`
#### Important features to be migrated
Only implemented by Silkaj, so once we switch the Ğ1 on Duniter-v2s, following features will stop serving:
- multi-recipients transfers to Ğ1 technical ecosystem remunerations
- DeathReaper: notifying the exclusions on the forums
#### Implement new features
- [ ] [UD creation](https://forum.duniter.org/t/implementation-creation-manuelle-du-du-et-guide-pour-dev-clients-wallet/9544)
- [ ] Display UDs in `history` command
- [ ] [Blacksmith sub-WoT](https://forum.duniter.org/t/la-sous-toile-forgerons/9047) handling
- [ ] Commands similar to normal wot?: `smith-wot`: `certify`, `lookup`, `membership`, `revocation`, `status`
- [ ] [Integrate Smith license](https://git.duniter.org/1000i100/g1_monetary_license/-/blob/master/smith_license/g1_smith_license_fr.adoc)
- [Becoming Smith diagram](https://forum.duniter.org/t/becoming-smith-as-a-bpmn-diagram/10980)
- [ ] Node administration via Unsafe RPC: `smith`: `rotate-key`, `go-offline`, `go-online`
- [ ] Check whether the RPC API connected to is in `Unsafe`, `Safe` mode
- [ ] Technical Committee: `tech-committee`: `list-members`, `list-proposals`, `vote`
#### Later
- [ ] #90+
- [ ] Change owner_key
- [ ] DeathReaper: Keep it similar listening to the blockchain events. Listen to exclusions from the indexer. Could be replaced with a feature onchain to report via email the exclusion. The indexer could store the email addresses. Having the emails accessible to everyone would be an issue for spam purposes. A private service/indexer should keep the emails.
- [ ] [Schedule transfer support](https://forum.duniter.org/t/gdev-virements-reguliers/9459)0.20.0MoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/378Create and use generic send_doc_confirmation()2022-06-05T15:27:47+02:00MoulCreate and use generic send_doc_confirmation()- [x] Create generic `send_doc_confirmation()`
- [x] Use it in send-document commands
- [x] `cert`
- [x] `membership`
- [ ] other cmds
- [ ] Adapt tx tests
- [ ] Create `patched_send_doc_confirmation()`
#379: Would allow to run `t...- [x] Create generic `send_doc_confirmation()`
- [x] Use it in send-document commands
- [x] `cert`
- [x] `membership`
- [ ] other cmds
- [ ] Adapt tx tests
- [ ] Create `patched_send_doc_confirmation()`
#379: Would allow to run `test_membership_cmd()` without sending the document by running `patched_send_doc_confirmation.assert_awaited_once_with()`BacklogMoulMoulhttps://git.duniter.org/clients/python/silkaj/-/issues/370Check if the node requested is up to date2021-07-27T13:33:36+02:00MoulCheck if the node requested is up to dateFor each network-command, calculate the difference between last block’s time and current time.
If the difference it too big, print a warning message.
Or, check the block numbers between different nodes.For each network-command, calculate the difference between last block’s time and current time.
If the difference it too big, print a warning message.
Or, check the block numbers between different nodes.Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/209Improve balance command performance when multiple pubkeys are specified2023-05-31T12:47:46+02:00MoulImprove balance command performance when multiple pubkeys are specifiedMake it go faster.
Once #161 will be solved, try to request every pubkeys tx sources and history at the same time.Make it go faster.
Once #161 will be solved, try to request every pubkeys tx sources and history at the same time.Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/129Find a way to display on which endpoint requests are made2021-05-18T14:51:59+02:00MoulFind a way to display on which endpoint requests are madeSince singleton refactoring, the:
```python
print("Requested node: <{}:{}>".format(ep["domain"], ep["port"]))
```
node requested information is displayed twice if put in `EndPoint` class.
We should find a way to display it back again, o...Since singleton refactoring, the:
```python
print("Requested node: <{}:{}>".format(ep["domain"], ep["port"]))
```
node requested information is displayed twice if put in `EndPoint` class.
We should find a way to display it back again, or at least with the logging tool.
---
With DuniterPy `ConnectionHandler.__str__()`, with some improvements (adding the path…)Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/74Add a fallback node processus2022-03-16T09:15:52+01:00MoulAdd a fallback node processusAdd second default node.
In case first one is not responding, request on second default.Add second default node.
In case first one is not responding, request on second default.Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/14IPv6-only nodes are not handled2022-06-25T11:51:20+02:00MoulIPv6-only nodes are not handled```bash
2a01:e35:8ae7:8bb0:7b0a:b4ec:ad04:dd57
Traceback (most recent call last):
File "./silkaj", line 50, in <module>
manage_cmd(ep, c)
File "./silkaj", line 25, in manage_cmd
network_info(ep, c.contains_switches("discover"...```bash
2a01:e35:8ae7:8bb0:7b0a:b4ec:ad04:dd57
Traceback (most recent call last):
File "./silkaj", line 50, in <module>
manage_cmd(ep, c)
File "./silkaj", line 25, in manage_cmd
network_info(ep, c.contains_switches("discover"))
File "/home/moul/projects/silkaj/src/commands.py", line 67, in network_info
endpoints = discover_peers(ep, discover)
File "/home/moul/projects/silkaj/src/network_tools.py", line 18, in discover_peers
if best_node(ep, 0) is None: endpoints.remove(ep)
File "/home/moul/projects/silkaj/src/network_tools.py", line 101, in best_node
s.connect((ep[address], port))
socket.gaierror: [Errno -9] Address family for hostname not supported
```
- It [seems it doesn't works as it's a local IP6 address](https://stackoverflow.com/questions/30790075/ipv6-python-sockets-not-working/30790206#30790206)
- Remote nodes with only IP6 are not here: may be as there are not know by non IPv6 nodes.
- [Socket documentation](https://docs.python.org/3/library/socket.html)Backloghttps://git.duniter.org/clients/python/silkaj/-/issues/16Add options to force connections to use version 4 or 6 of IP protocol2019-08-01T14:07:09+02:00MoulAdd options to force connections to use version 4 or 6 of IP protocolAdd options to force connections to use version 4 or 6 of IP protocol.
Options could be `-4` and `-6` and/or `--ip4` and `--ip6`.
That could permit to bypass #14 for now.Add options to force connections to use version 4 or 6 of IP protocol.
Options could be `-4` and `-6` and/or `--ip4` and `--ip6`.
That could permit to bypass #14 for now.Backlog