# p2p_domain0 module

Copyright (c) 2017 beyond-blockchain.org.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

> http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

`NetworkDomain`([network, config, domain_id, …]) | Compose a simple core node cluster

class `p2p_domain0.``DomainInfo`(domain_id, del_func)

  Bases: `object`

  `add_node`(node_id)
  `get_nodes`()
  `remove_entry`(query_entry)

class `p2p_domain0.``NetworkDomain`(network=None, config=None, domain_id=None, node_id=None, loglevel='all', logname=None)

  Bases: `bbc1.core.simple_cluster.NetworkDomain`

  Compose a simple core node cluster

  `advertise_domain_info`()

    Advertise domain information in domain_global_0

    Returns: |

  `delete_domain_from_info`(domain_id)

    (internal use) delete asset_group_id

    Parameters: | domain_id –
    Returns: |

  `domain_manager_loop`()

    (internal use) maintain domain (e.g., updating peer list and topology)

    Returns: |

  `periodic_advertising_domain_info`(query_entry=None)
  `print_domain_info`()
  `process_ADVERTISE_DOMAIN_INFO`(msg)
  `process_message`(ip4, from_addr, msg)

    process received message

    Parameters: | ip4 – True (from IPv4) / False (from IPv6) from_addr – sender address and port (None if TCP) msg – the message body (already deserialized)
    Returns: |

  `update_domain_info`(source_node_id, domain_id)

    (internal use) update asset_group info (self.domain_list)

    Parameters: | source_node_id – domain_id –
    Returns: |