simple_cluster 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
simple_cluster.
NetworkDomain
(network=None, config=None, domain_id=None, node_id=None, loglevel='all', logname=None)[source]¶ Bases:
bbc1.core.bbc_network.DomainBase
Compose a simple core node cluster
-
add_peer_node
(node_id, ip4, addr_info)[source]¶ (internal use) add node as a peer node
Parameters: - node_id –
- ip4 –
- addr_info –
Returns:
-
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:
-
random_send
(msg, count)[source]¶ (internal use) send data to randomly selected nodes
Parameters: - msg –
- count – number of nodes to send
Returns:
-
resolve_accommodating_core_node
(query_entry)[source]¶ Resolve which node the user connects to
Parameters: query_entry – Returns:
-
respond_find_value
(target_id, nonce, asset_group_id=None, resource_id=None, resource=None, resource_type=None)[source]¶
-