(self,
                 cfg,
                 cfg_dir,
                 dest_addr,
                 hostname=None,
                 tls_cert=None,
                 tls_key=None,
                 gnupghome=None,
                 passphrase=None)
Reporter Constructor

        Args:
            cfg       : User configuration
            cfg_dir   : Configuration directory
            dest_addr : Remote server address
            hostname  : Hostname used to identify the reports
            tls_cert  : Optional client side certificate for TLS authentication
            tls_key   : Key associated with the client side certificate
            gnupghome : GnuPG home directory used when reporting to
                        Blockstream's monitoring API
            passphrase : Passphrase to the private key used when reporting to
                         Blockstream's monitoring API. If None, it will be
                         obtained by prompting the user.
Reporter Constructor
Reporter Constructor
def __init__(self,
                 cfg,
                 cfg_dir,
                 dest_addr,
                 hostname=None,
                 tls_cert=None,
                 tls_key=None,
                 gnupghome=None,
                 passphrase=None):
        """Reporter Constructor

        Args:
            cfg       : User configuration
            cfg_dir   : Configuration directory
            dest_addr : Remote server address
            hostname  : Hostname used to identify the reports
            tls_cert  : Optional client side certificate for TLS authentication
            tls_key   : Key associated with the client side certificate
            gnupghome : GnuPG home directory used when reporting to
                        Blockstream's monitoring API
            passphrase : Passphrase to the private key used when reporting to
                         Blockstream's monitoring API. If None, it will be
                         obtained by prompting the user.

        """
        info = config.read_cfg_file(cfg, cfg_dir)
        assert (info is not None)

        # Validate the satellite
        satellite = info['sat']['alias']
        assert (satellite is not None), "Reporting satellite undefined"
        assert (satellite in sats), "Invalid satellite"
        self.satellite = satellite

        # Destination address, hostname, and client side cert
        self.dest_addr = dest_addr
        self.hostname = hostname
        self.tls_cert = tls_cert
        self.tls_key = tls_key

        # If the report destination address corresponds to Blockstream's
        # Monitoring API (the default), create the object to handle the
        # interaction with this API (e.g., registration).
        if (dest_addr == monitoring_api.metric_endpoint):
            self.bs_monitoring = monitoring_api.BsMonitoring(
                cfg, cfg_dir, gnupghome, passphrase)
        else:
            self.bs_monitoring = None

        logger.info("Reporting Rx status to {} ".format(self.dest_addr))
def __init__ ( self , cfg , cfg_dir , dest_addr , hostname = None , tls_cert = None , tls_key = None , gnupghome = None , passphrase = None ) : info = config . read_cfg_file ( cfg , cfg_dir ) assert ( info is not None ) # Validate the satellite satellite = info [ 'sat' ] [ 'alias' ] assert ( satellite is not None ) , "Reporting satellite undefined" assert ( satellite in sats ) , "Invalid satellite" self . satellite = satellite # Destination address, hostname, and client side cert self . dest_addr = dest_addr self . hostname = hostname self . tls_cert = tls_cert self . tls_key = tls_key # If the report destination address corresponds to Blockstream's # Monitoring API (the default), create the object to handle the # interaction with this API (e.g., registration). if ( dest_addr == monitoring_api . metric_endpoint ) : self . bs_monitoring = monitoring_api . BsMonitoring ( cfg , cfg_dir , gnupghome , passphrase ) else : self . bs_monitoring = None logger . info ( "Reporting Rx status to {} " . format ( self . dest_addr ) )