Have a common way to make requests to the network
As far as BMA is concerned, we have 2 ways of communications:
- HTTP server listening for requests (push)
- requests made by the node itself to the network (pull)
The push is OK today, the server just has to listen for network requests. But the pull mechanism, used for pulling data from the network or to share documents (which is a push for other nodes, but pull for us even when we send documents) has no common code for doing the job.
Today the pull requests are made by request/request-promise, using an automatic HTTP connection. But some people may want Duniter to use a proxy for every pulling request a node makes. We cannot follow this behavior unless a method is defined in Duniter to make such requests, letting Duniter decide the way to make these requests.
The best place is probably in duniter-bma module for defining such methods (bma.httpGet()
for example), because all the HTTP stuff is only due to BMA as of today.