diff --git a/squeaknode/common/blockchain_client.py b/squeaknode/common/blockchain_client.py deleted file mode 100644 index c9293b4b..00000000 --- a/squeaknode/common/blockchain_client.py +++ /dev/null @@ -1,14 +0,0 @@ -from abc import ABC, abstractmethod -from typing import Optional - - -class BlockchainClient(ABC): - """Used to get info from the blockchain.""" - - @abstractmethod - def get_latest_block_height(self) -> int: - pass - - @abstractmethod - def get_block_hash(self, block_height: int) -> Optional[bytes]: - pass diff --git a/squeaknode/common/dummy_blockchain_client.py b/squeaknode/common/dummy_blockchain_client.py deleted file mode 100644 index d09d002b..00000000 --- a/squeaknode/common/dummy_blockchain_client.py +++ /dev/null @@ -1,23 +0,0 @@ -from typing import Optional - -from bitcoin.core import lx - -from squeaknode.common.blockchain_client import BlockchainClient - - -class DummyBlockchainClient(BlockchainClient): - """Gets only the genesis block of the main chain.""" - - def __init__(self) -> None: - pass - - def get_latest_block_height(self) -> int: - return 0 - - def get_block_hash(self, block_height: int) -> Optional[bytes]: - # return the genesis block hash - if block_height == 0: - return lx( - "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b" - ) - return None diff --git a/squeaknode/common/greeting.py b/squeaknode/common/greeting.py deleted file mode 100644 index 4fca84ae..00000000 --- a/squeaknode/common/greeting.py +++ /dev/null @@ -1,3 +0,0 @@ -def greet(): - """Return a greeting.""" - return "hello" diff --git a/squeaknode/node/peer_upload.py b/squeaknode/node/peer_upload.py deleted file mode 100644 index 614f50d9..00000000 --- a/squeaknode/node/peer_upload.py +++ /dev/null @@ -1,57 +0,0 @@ -import logging -import threading - -from squeaknode.network.peer_client import PeerClient -from squeaknode.node.peer_task import PeerSyncTask - -logger = logging.getLogger(__name__) - - -LOOKUP_BLOCK_INTERVAL = 1008 # 1 week - - -# class PeerUpload(PeerSyncTask): -# def __init__( -# self, -# peer, -# squeak_store, -# postgres_db, -# lightning_client, -# ): -# super().__init__(peer, squeak_store, postgres_db, lightning_client) - -# def upload( -# self, -# block_height, -# lookup_block_interval=LOOKUP_BLOCK_INTERVAL, -# ): -# # Get list of sharing addresses. -# addresses = self._get_sharing_addresses() -# logger.debug("Sharing addresses: {}".format(addresses)) -# min_block = block_height - lookup_block_interval -# max_block = block_height - -# # Get remote hashes -# remote_hashes = self._get_remote_hashes(addresses, min_block, max_block) -# logger.debug("Got remote hashes: {}".format(len(remote_hashes))) -# for hash in remote_hashes: -# logger.debug("remote hash: {}".format(hash.hex())) - -# # Get local hashes -# local_hashes = self._get_local_hashes(addresses, min_block, max_block) -# logger.debug("Got local hashes: {}".format(len(local_hashes))) -# for hash in local_hashes: -# logger.debug("local hash: {}".format(hash.hex())) - -# # Get hashes to upload -# hashes_to_upload = set(local_hashes) - set(remote_hashes) -# logger.debug("Hashes to upload: {}".format(len(hashes_to_upload))) -# for hash in hashes_to_upload: -# logger.debug("hash to upload: {}".format(hash.hex())) - -# # Upload squeaks for the hashes -# # TODO: catch exception uploading individual squeak -# for hash in hashes_to_upload: -# if self.stopped(): -# return -# self._upload_squeak(hash) diff --git a/squeaknode/node/squeak_maker.py b/squeaknode/node/squeak_maker.py index fa91cb5b..bbdc8851 100644 --- a/squeaknode/node/squeak_maker.py +++ b/squeaknode/node/squeak_maker.py @@ -21,8 +21,6 @@ class SqueakMaker: block_height = block_info.block_height block_hash = bytes.fromhex(block_info.block_hash) timestamp = self._get_current_time_s() - logger.info("Creating squeak with block height: {}".format(block_height)) - logger.info("Creating squeak with block hash: {}".format(block_hash)) if replyto_hash is None or len(replyto_hash) == 0: return MakeSqueakFromStr( signing_key,