Node Interface Services
This service is responsible for handling and routing requests to and from the p2p node network.
All the package information is in HiPRC format.
The Node interface services relays the HiRPC between three services (EpochCreator, Replicator, DART) depended on the HiRPC(Method) or the services deriven key.
All HiRPC should be signed and contain a public key.
There are two implementation of the nodeinterface. The mode0 nodeinterface which uses D's thread message passing from the std.concurrency library. This is used for testing and development.
And the socket nodeinterface which can use a TCP or UNIX socket.
The nodeinterface interacts with other services by passing messages. The service handling the hirpc depends on if the connection established is outgoing or incoming and which hirpc method is used.
Obviously when using the mode0 nodeinterface there is no connecting or accepting of connections, but the same relationship is still kept.
When establishing an outgoing connection to another node, the service is whichever makes the outgoing request to the node
When an incoming requests is accepted, the service to handle the request is determined by a lookup table based on the rpc method.
When establishing an outgoing connection the initial state is set to send and when accepting an incoming connection it is set to receive. The node may keep toggling between sending and receiving until a result or an error is exchanged. Where the nodes will then close the connection