DuniterPy issueshttps://git.duniter.org/clients/python/duniterpy/-/issues2021-07-03T10:27:48+02:00https://git.duniter.org/clients/python/duniterpy/-/issues/148Deprecate BMA API2021-07-03T10:27:48+02:00MoulDeprecate BMA API- [ ] Set deprecation warnings in earliest possible version
- [ ] Remove BMA related code once major clients (Silkaj) completely migrated away from it. This means GVA provides at least the same requestable datas as BMA has.
- [ ] #135: A...- [ ] Set deprecation warnings in earliest possible version
- [ ] Remove BMA related code once major clients (Silkaj) completely migrated away from it. This means GVA provides at least the same requestable datas as BMA has.
- [ ] #135: Add back `R0801` pylint deactivation which was mostly happening on json schemas2.0.0https://git.duniter.org/clients/python/duniterpy/-/issues/64Add automatic p2p multi-nodes requests to spread the load on nodes2023-07-08T15:27:19+02:00Vincent TexierAdd automatic p2p multi-nodes requests to spread the load on nodesDuniterpy should handle multi-nodes requests to share the write load on nodes and to ensure to have the most valid information of the blockchain consensus.
Client should not care about how and where the requests are sent, and all the co...Duniterpy should handle multi-nodes requests to share the write load on nodes and to ensure to have the most valid information of the blockchain consensus.
Client should not care about how and where the requests are sent, and all the complexity should be in the library.
Then, all clients using Duniterpy, will be really p2p clients.
Sakia implementation : https://git.duniter.org/clients/python/sakia/blob/master/src/sakia/services/network.py#L250Backloghttps://git.duniter.org/clients/python/duniterpy/-/issues/109DuniterPy should not parse the result of a failed request2020-11-30T15:10:40+01:00MoulDuniterPy should not parse the result of a failed requestDuniterPy should not try to parse the result of a request with an HTTP error:
https://forum.duniter.org/t/remuneration-des-contributeurs-au-projet-duniter/4995/52?u=moul
Here, you can see `jsonschema` failing to parse the result of a 4...DuniterPy should not try to parse the result of a request with an HTTP error:
https://forum.duniter.org/t/remuneration-des-contributeurs-au-projet-duniter/4995/52?u=moul
Here, you can see `jsonschema` failing to parse the result of a 429 error:
```bash
Traceback (most recent call last):
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/duniterpy/api/client.py", line 141, in requests_get
error_data = parse_error(await response.text())
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/duniterpy/api/client.py", line 65, in parse_error
raise jsonschema.ValidationError("Could not parse json : {0}".format(str(e)))
jsonschema.exceptions.ValidationError: Could not parse json : Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/inso/.pyenv/versions/silkaj-3.7/bin/silkaj", line 23, in <module>
cli(obj={})
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/silkaj/tools.py", line 70, in wrapper
return loop.run_until_complete(f(*args, **kwargs))
File "/home/inso/.pyenv/versions/3.7.0/lib/python3.7/asyncio/base_events.py", line 568, in run_until_complete
return future.result()
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/silkaj/tx.py", line 99, in send_transaction
key, issuer_pubkey, tx_amount, outputAddresses, comment, outputbackchange
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/silkaj/tx.py", line 237, in handle_intermediaries_transactions
OutputbackChange,
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/silkaj/tx.py", line 277, in generate_and_send_transaction
OutputbackChange,
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/silkaj/tx.py", line 307, in generate_transaction_document
head_block = await HeadBlock().head_block
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/silkaj/network_tools.py", line 244, in get_head
return await client(blockchain.current)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/duniterpy/api/bma/blockchain.py", line 392, in current
return await client.get(MODULE + '/current', schema=BLOCK_SCHEMA)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/duniterpy/api/client.py", line 231, in get
response = await client.requests_get(url_path, **params)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/duniterpy/api/client.py", line 144, in requests_get
raise ValueError('status code != 200 => %d (%s)' % (response.status, (await response.text())))
ValueError: status code != 200 => 429 (Error)
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fd385bca8d0>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7fd385b07888>, 4002.554372885)]']
connector: <aiohttp.connector.TCPConnector object at 0x7fd385bca9e8>
Traceback (most recent call last):
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/duniterpy/api/client.py", line 141, in requests_get
error_data = parse_error(await response.text())
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/duniterpy/api/client.py", line 65, in parse_error
raise jsonschema.ValidationError("Could not parse json : {0}".format(str(e)))
jsonschema.exceptions.ValidationError: Could not parse json : Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/inso/.pyenv/versions/silkaj-3.7/bin/silkaj", line 23, in <module>
cli(obj={})
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/silkaj/tools.py", line 70, in wrapper
return loop.run_until_complete(f(*args, **kwargs))
File "/home/inso/.pyenv/versions/3.7.0/lib/python3.7/asyncio/base_events.py", line 568, in run_until_complete
return future.result()
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/silkaj/tx.py", line 68, in send_transaction
pubkey_amount = await get_amount_from_pubkey(issuer_pubkey)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/silkaj/money.py", line 117, in get_amount_from_pubkey
listinput, amount = await get_sources(pubkey)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/silkaj/money.py", line 128, in get_sources
sources = await client(tx.sources, pubkey)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/duniterpy/api/bma/tx.py", line 236, in sources
return await client.get(MODULE + '/sources/%s' % pubkey, schema=SOURCES_SCHEMA)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/duniterpy/api/client.py", line 231, in get
response = await client.requests_get(url_path, **params)
File "/home/inso/.pyenv/versions/3.7.0/envs/silkaj-3.7/lib/python3.7/site-packages/duniterpy/api/client.py", line 144, in requests_get
raise ValueError('status code != 200 => %d (%s)' % (response.status, (await response.text())))
ValueError: status code != 200 => 429 (Error)
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f51690d3978>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f516900e888>, 4003.371805189)]']
connector: <aiohttp.connector.TCPConnector object at 0x7f51690d38d0>
```Backloghttps://git.duniter.org/clients/python/duniterpy/-/issues/110Block.from_signed_raw() usage is not obvious2020-12-10T21:51:10+01:00MoulBlock.from_signed_raw() usage is not obviousParsing a block is not obvious. You have to append to the raw part, the signature and a `\n` to make it work:
```python
block = await bma_client(bma.blockchain.block, block_number)
block = Block.from_signed_raw(block["raw"] + block["sig...Parsing a block is not obvious. You have to append to the raw part, the signature and a `\n` to make it work:
```python
block = await bma_client(bma.blockchain.block, block_number)
block = Block.from_signed_raw(block["raw"] + block["signature"] + "\n")
```
I thought, `from_signed_raw(block["raw"])` was broken, but I found it used this way in Sakia.
We should address this.
Will it be fixed with GVA?
Do we want to implement a `from_json()` in the meantime?Backloghttps://git.duniter.org/clients/python/duniterpy/-/issues/81Three fields missing in bma.tx.history jsonschema2021-04-08T16:34:03+02:00MoulThree fields missing in bma.tx.history jsonschema`blockstampTime`, `locktime`, `blockstamp` are missing from [`bma.tx.history` `jsonschema`](https://git.duniter.org/clients/python/duniterpy/blob/dev/duniterpy/api/bma/tx.py#L28-166):
```json
{
"version": 10,
"lockt...`blockstampTime`, `locktime`, `blockstamp` are missing from [`bma.tx.history` `jsonschema`](https://git.duniter.org/clients/python/duniterpy/blob/dev/duniterpy/api/bma/tx.py#L28-166):
```json
{
"version": 10,
"locktime": 0,
"blockstamp": "214042-0000012B3AA19F9336AC1C75597257DD2C0BBC434721F5590F5F00A00CC06C09",
"blockstampTime": 1555178948,
```Backloghttps://git.duniter.org/clients/python/duniterpy/-/issues/154Missing /network/ws2p/info BMA path2021-04-26T19:10:58+02:00MoulMissing /network/ws2p/info BMA path[Found here](https://forum.duniter.org/t/manque-de-places-ws2p-sur-le-reseau-g1/4372/35)
For completion purpose. Not really interesting information for a client here. And BMA is planned to be deprecated.
- [ ] Add `/network/ws2p/info`
...[Found here](https://forum.duniter.org/t/manque-de-places-ws2p-sur-le-reseau-g1/4372/35)
For completion purpose. Not really interesting information for a client here. And BMA is planned to be deprecated.
- [ ] Add `/network/ws2p/info`
- [ ] [Should be documented](https://git.duniter.org/nodes/typescript/duniter/-/blob/dev/doc/HTTP_API.md)Backlog