s_b_
19 October 2015 10:25
1
Hello,
I want to use the uCoin Python API, so I tried this:
But in the print(data), I get that:
< generator object get at 0x7f86483b24c8>
or that:
< ucoinpyapi.ucoinpy.api.bma.node.Summary object at 0x7f52685cfa90>
The print(endpointBMA.conn_handler().str ()) , gets the correct endpoint , the initial one.
https://sbhosting.me/zerobin/?10f5b2038c6ffc13#X7CXUfwl6PgIkvVrhToU+FAJ0/MBzLudlGUNAoGamFI=
To the following URL , the node send the correct data.
http://sbhosting.me:8999/node/summary
I use the browser Midori because, Firefox redirects to https, the node can’t handle HTTPS with my uCoin installation.
Inso
19 October 2015 14:09
2
Latest ucoin-python-api is asynchronous and you have to use asyncio, an asyncio loop and a yield from on the data.
You have to use asyncio ( https://docs.python.org/3/library/asyncio.html )
For example (pseucode) :
import asyncio
import ucoinpy
@asyncio.coroutine
def get_node(loop):
endpoint = Endpoint( ... )
data = yield from Summaryk(endpoint.conn_handler()).get()
print(data)
loop = asyncio.get_event_loop()
loop.run_until_complete(get_node(loop))
1 Like
s_b_
19 October 2015 19:14
3
2 Likes
Inso
30 October 2015 09:56
5
Ca ne me choque pas outre mesure personellement. Surtout que rien n’empeche le client d’être porté en tant qu’application sur un media center local par exemple
1 Like
Inso
30 October 2015 14:59
7
Un truc qui serait vraiment sympa, c’est un visualiseur du WoT, animé dans le temps.
Ya pas mal de librairies en JS pour faire ça : http://d3js.org/
Tu pourrais par exemple analyser le WoT par la requete sur les membres de la communauté puis des certifiers-of sur chaque pubkey, placer ça dans un graph via networkx ( http://networkx.github.io/ ) puis rendre tout ça dans le navigateur grace à d3js.
Sacré challenge je suppose mais qui aurait vraiment une valeur ajoutée dans le cadre de ucoin Le must serait d’afficher le WoT(t) !
1 Like
s_b_
14 November 2015 12:10
9
For developers who want to read JSON files / requests in the browser
I recommend to use a JSON viewer for a readable JSON
For example -> http://jsonview.com
; )
1 Like
Moul
5 October 2016 08:07
10
Thanks for this documentation, I will read it with care.
I could also contribute to it as it’s old now.
Where could I found sources ?
We should a link to this tutorial on the readme of the repository duniter-python-api.