def create_network_interface(port, initial_peers=None): if initial_peers is None: initial_peers = {} return ServerNetworkInterface(JsonRpcClient(), initial_peers, MockCryptoHelper(), empty_function, on_transaction_received, empty_function, empty_function, get_transaction, port)
def create_client(wallet_file, node_ip, node_port): crypto_helper = CryptoHelper.instance() network_interface = ClientNetworkInterface(JsonRpcClient(), {node_ip: { node_port: {} }}) return BlockchainClient(Wallet(wallet_file), network_interface, crypto_helper)
def create_network_interface(self, port, initial_peers=None): """Initialize the network interface""" if initial_peers is None: initial_peers = {} return ServerNetworkInterface( JsonRpcClient(), initial_peers, self.crypto_helper_obj, self.on_new_block_received, self.on_new_transaction_received, self.on_get_block_by_id, self.on_get_block_by_hash, self.on_get_transaction, self.on_get_blocks_by_range, port)