def issue(app_config, certificate_batch_handler, transaction_handler): unsigned_certs_dir = app_config.unsigned_certificates_dir signed_certs_dir = app_config.signed_certificates_dir blockchain_certificates_dir = app_config.blockchain_certificates_dir work_dir = app_config.work_dir certificates_metadata = helpers.prepare_issuance_batch( unsigned_certs_dir, signed_certs_dir, blockchain_certificates_dir, work_dir) num_certificates = len(certificates_metadata) if num_certificates < 1: logging.warning('No certificates to process') return None logging.info('Processing %d certificates under work path=%s', num_certificates, work_dir) certificate_batch_handler.set_certificates_in_batch(certificates_metadata) transaction_handler.ensure_balance() issuer = Issuer(certificate_batch_handler=certificate_batch_handler, transaction_handler=transaction_handler, max_retry=app_config.max_retry) tx_id = issuer.issue(app_config.bitcoin_chain) helpers.copy_output(certificates_metadata) logging.info('Your Blockchain Certificates are in %s', blockchain_certificates_dir) return tx_id
def issue(app_config, certificate_batch_handler, transaction_handler): unsigned_certs_dir = app_config.unsigned_certificates_dir signed_certs_dir = app_config.signed_certificates_dir blockchain_certificates_dir = app_config.blockchain_certificates_dir work_dir = app_config.work_dir certificates_metadata = helpers.prepare_issuance_batch(unsigned_certs_dir, signed_certs_dir, blockchain_certificates_dir, work_dir) num_certificates = len(certificates_metadata) if num_certificates < 1: logging.warning('No certificates to process') return None logging.info('Processing %d certificates under work path=%s', num_certificates, work_dir) certificate_batch_handler.set_certificates_in_batch(certificates_metadata) transaction_handler.ensure_balance() issuer = Issuer( certificate_batch_handler=certificate_batch_handler, transaction_handler=transaction_handler, max_retry=app_config.max_retry) tx_id = issuer.issue(app_config.bitcoin_chain) helpers.copy_output(certificates_metadata) logging.info('Your Blockchain Certificates are in %s', blockchain_certificates_dir) return tx_id
def post_batch_actions(self, config): helpers.copy_output(self.certificates_to_issue) logging.info('Your Blockchain Certificates are in %s', config.blockchain_certificates_dir)
def post_batch_actions(self, config): helpers.copy_output(self.certificates_to_issue) logging.info('Your Blockchain Certificates are in %s', config.blockchain_certificates_dir)