ffdo / node-informant

Small utility to collect node information in a Freifunk network via announced
7 stars 4 forks source link

nodes.json version 2 support #5

Closed ghost closed 8 years ago

ghost commented 8 years ago

Support for meshviewer dev branch

See https://github.com/ffnord/meshviewer/commit/9a0b5ac672a97e75100f0fac1af209ebef2115ad

dereulenspiegel commented 8 years ago

Is there a good example of version 2 of the nodes.json specification?

ghost commented 8 years ago

https://github.com/ffnord/ffmap-backend/commit/abc84e9fc98e9ac437cf5e8f0e1a0656cfee442e I think the quotation marks were just wrong in the previous description so forget about them: The main difference is that 'nodes' is an array instead of an object in v2. It should be fairly easy to do that. I just don't have the required go skills :(

dereulenspiegel commented 8 years ago

Please test the current implementation for a nodes.json version 2. I am currently not really sure what # copied from node's nodeinfo announcement actually means, but my guess is that we need to use the unmodified information retrieved from announced.

ghost commented 8 years ago

How do I build updated code?

dereulenspiegel commented 8 years ago

https://github.com/ffdo/node-informant/blob/nodesjsonv2/README.md

ghost commented 8 years ago

I have already built it. So I fetch and checkout on that branch. Is gb build sufficient to update the binary?

dereulenspiegel commented 8 years ago

Simply execute gb build and all changed packages will be rebuild and a new binary will be linked together from these packages.

ghost commented 8 years ago

Thanks, that should be stated like that in the readme..

dereulenspiegel commented 8 years ago

The How to build section is generally targeted at developers. For users I create executable binaries via Travis CI. I like to keep the README slim so there is a higher chance of people actually reading it. So repeating golang basics there feels for me kinda counterproductive.

ghost commented 8 years ago

Where is the v2 json served? The one in /v2/nodes.json is exactly the same for me. Compare: http://gl.wupper.ffrl.de:8080/v2/nodes.json http://gl.wupper.ffrl.de:8080/nodes.json

dereulenspiegel commented 8 years ago

Sorry, my bad. Forgot to hookup the new rest endpoint to the correct rest method. This should be fixed now.

ghost commented 8 years ago

Can we serve the graph.json in the same directory? Meshviewer doesn't allow nodes and graph jsons in different directories. I did this myself to get this running: http://gl.wupper.ffrl.de/meshviewer/

dereulenspiegel commented 8 years ago

Oh god, I wish we could retire meshviewer right now. Yeah, I forgot that meshviewer doesn't let you configure the exact URL of your datasources. But this implementation is currently only for testing. If i actually implemented a valid nodes.json V2 I will see that I make this nice and clean and usable.

ghost commented 8 years ago

So yes it works but is not usable right now

dereulenspiegel commented 8 years ago

This implementation should be much more usable. You can now configure which nodes.json version should served, and the endpoint is just /nodes.json in either case. I guess parallel support for both versions is not necessary.

ghost commented 8 years ago

That works for me If you don't have anything else about this you can close the issue.

dereulenspiegel commented 8 years ago

Thanks for testing. The changes have been merged.