p2p_domain0 module — BBc1 0.7 documentation

# 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.` `AssetGroupInfo`(asset_group_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_asset_group_info`()

    Advertise domain information in domain_global_0

    Returns: |

  `delete_asset_group_from_info`(asset_group_id)

    (internal use) delete asset_group_id

    Parameters: | asset_group_id –
    Returns: |

  `domain_manager_loop`()

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

    Returns: |

  `periodic_advertising_asset_group_info`(query_entry=None)
  `print_asset_group_info`()
  `process_ADVERTISE_ASSET_GROUP`(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_asset_group_info`(source_node_id, asset_group_id)

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

    Parameters: | source_node_id – asset_group_id –
    Returns: |