Closed qstokkink closed 7 years ago
The configuration of the service should be done with a dict
structure. It should contain generic IPv8 settings which can be overwritten per overlay and overlay specific settings. Something like:
[IPv8]
port = 8090
key_gen = u"high"
key_file = None # Generate a new key every run
loglevel = "INFO"
walker_strategy = "Random"
walker_interval = 0.5 # seconds
walker_target_peers = 20
[Tunnel]
key_gen = u"curve25519"
key_file = ".keyfile"
walker_target_peers = 100
walker_custom_intro = True
community_init = ("build_tunnels", 1)
max_circuits = 1
min_circuits = 1
[TrustChain]
key_gen = u"curve25519"
key_file = ".keyfile"
walker_strategy = "Edge"
db_name = "trustchain"
working_directory = "sqlite"
The dict
settings allows for reading these from a config file (like above) or from a json file.
The (for now) complete list of settings looks as follows:
default = {
'port': 8090,
'keys': [
{
'alias': "my peer",
'generation': u"medium",
'file': u"ec.pem"
},
{
'alias': "anonymous id",
'generation': u"curve25519",
'file': u"ec_multichain.pem"
}
],
'logger': {
'level': "INFO"
},
'walker_interval': 0.5,
'overlays': [
{
'class': 'DiscoveryCommunity',
'key': "my peer",
'walkers': [
{
'strategy': "RandomWalk",
'peers': 20,
'init': {
'timeout': 3.0
}
},
{
'strategy': "RandomChurn",
'peers': -1,
'init': {
'sample_size': 8,
'ping_interval': 10.0,
'inactive_time': 27.5,
'drop_time': 57.5
}
}
],
'piggyback_intro': False,
'initialize': {},
'on_start': [
('resolve_dns_bootstrap_addresses')
]
},
{
'class': 'HiddenTunnelCommunity',
'key': "anonymous id",
'walkers': [],
'piggyback_intro': True,
'initialize': {
'settings': {
'min_circuits': 1,
'max_circuits': 1,
'max_relays_or_exits': 100,
'max_time': 10 * 60,
'max_time_inactive': 20,
'max_traffic': 250 * 1024 * 1024,
'max_packets_without_reply': 50,
'dht_lookup_interval': 30,
'become_exitnode': False
}
},
'on_start': [
('build_tunnels', 1)
]
},
{
'class': 'TrustChainCommunity',
'key': "anonymous id",
'walkers': [{
'strategy': "EdgeWalk",
'peers': 20,
'localized': True,
'init': {
'edge_length': 4,
'neighborhood_size': 6,
'edge_timeout': 3.0
}
}],
'piggyback_intro': False,
'initialize': {},
'on_start': []
},
{
'class': 'AttestationCommunity',
'key': "my peer",
'walkers': [],
'piggyback_intro': False,
'initialize': {},
'on_start': []
},
{
'class': 'IdentityCommunity',
'key': "my peer",
'walkers': [],
'piggyback_intro': False,
'initialize': {},
'on_start': []
}
]
}
Right now
ipv8.py
is and example file to invoke the modular framework.ipv8.py
could be offered as a full-fledged modular service instead.