[GVA] Add request to get network peers with enough info to make a real p2p client
I have made a python helper to help client keep a list of consensus blockchain nodes.
See : https://forum.duniter.org/t/fonction-daide-pour-avoir-un-vrai-client-python-p2p/7821
The BMA API needs two requests to get all info of nodes (network/ws2p/heads
, network/peers
).
GVA should be able to provide one request only.
Response should be a paginated list of nodes, a Node
is an object with Head
document and Peer
document together.
Node {
Head: {
version: int,
signature: str,
api: str,
pubkey: str,
blockstamp: BlockUID {
number: int,
hash: str
},
ws2pid: str,
software: str,
software_version: str,
pow_prefix: str,
free_member_room: int,
free_mirror_room: int
},
Peer: {
version: int,
currency: str,
pubkey: str,
block_uid: BlockUID {
number: int,
hash: str
},
endpoints: [str, ...],
signature: str
}
}
To not bind the Node
object to the ws2p protocol Head
document, we can put Head
relevant information directly in the Node
properties:
Node {
pubkey: str,
blockstamp: BlockUID {
number: int,
hash: str
},
software: str,
software_version: str,
Peer: {
version: int,
currency: str,
pubkey: str,
block_uid: BlockUID {
number: int,
hash: str
},
endpoints: [str, ...],
signature: str
}
}
With the drawback that we do not have the Head
signature anymore.
Edited by Vincent Texier