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

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)[source]

Bases: object

add_node(node_id)[source]
get_nodes()[source]
remove_entry(query_entry)[source]
class p2p_domain0.NetworkDomain(network=None, config=None, domain_id=None, node_id=None, loglevel='all', logname=None)[source]

Bases: bbc1.core.simple_cluster.NetworkDomain

Compose a simple core node cluster

advertise_asset_group_info()[source]

Advertise domain information in domain_global_0

Returns:
delete_asset_group_from_info(asset_group_id)[source]

(internal use) delete asset_group_id

Parameters:asset_group_id
Returns:
domain_manager_loop()[source]

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

Returns:
periodic_advertising_asset_group_info(query_entry=None)[source]
print_asset_group_info()[source]
process_ADVERTISE_ASSET_GROUP(msg)[source]
process_message(ip4, from_addr, msg)[source]

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)[source]

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

Parameters:
  • source_node_id
  • asset_group_id
Returns: