Add capabilities
Discussing with @jeffallen we thought that we need a way for services to announce capabilities on a network level. This could be:
- when registering a service, he can add a slice of strings that is store in the router
- when connecting for the first time, this map[service_name]slice of strings is exchanged between the conodes, together with the public key, so that the other end knows what to expect from that node
Then a service can do Router.CommonCapabilities(roster, service_name) and get a slice of strings that represent the capabilities all the nodes have in common. I put this as a method to Router, so that it can be correctly cached.
Example use case:
In service Skipchain, there might be a newer more efficient way to request forward links. The service would say ask the router to look at a roster and tell it which nodes were capable of this new technique. If enough of them are, then the new technique can go forward. If not, then the old code has to be used.
Like this, we can incrementally roll out new ways of doing things without requiring that the whole network is restarted at once.
The information "what this service can do" is directly correlated with the "what version this conode is running". With the "capability" approach, I'm afraid it's gonna run into problems to keep these two informations consistent. Why not just relying on version number to derive the functionalities available at a given conode ?
Regardless of this, I think "functionality" may be a better term for that. Wiki definition
the range of operations that can be run on a computer or other electronic system. "new software with additional functionality"