Top-level interface to a DHT server
Author(s): Arsen Kostenko.Usage and interface
- Library usage:
:- use_module(library(dht_server)). - Exports:
- Predicates:
dht_server/1, dht_prolog/1.
- Predicates:
- Imports:
- System library modules:
sockets/sockets, system, format, dht/dht_config, dht/dht_logic_misc, dht/dht_s2s, dht/dht_s2c. - Packages:
prelude, nonpure, assertions, regtypes, isomodes.
- System library modules:
Documentation on exports
PREDICATE
main/1: start the DHT server. Here is a step-by-step bahavior:
- set all values of dht_config.pl module to default.
- modify those, for which command-line arguments were supplied.
- modify server number separately, since it depends on two command-line arguments : --server-id and --hash-power.
- output resulting values to terminal.
- start client side communication by executing dht_s2c:dht_s2c_mian/0.
- start server side communication by executing dht_s2s:dht_s2s_mian/0.
Usage:dht_server(Arguments)
- The following properties should hold at call time:
(dht_server:dht_arguments_list/1)Arguments is associated with simple list, that represents pairs of command line arguments (argument and its value). Possible values are: --join-host, --hash-power, --server-id, --s2c-port, --s2c-threads, --s2s-port, --s2s-threads. All of the arguments (except --join-host) accept integer values. In case of --join-host value of argument should be equal to IP/DNS address of host running a copy of DHT.
PREDICATE
Another style to launch the DHT server. All the parameters are passed in the list. Members of the list are of type prameter_name(parameter_value), where parameter_name corresponds to name of the command line argument without two leading dashes (--) and with internal dash replaced by the underscore (_). All the values are of integer type, except the value of join_host, which should be an atom.