Esempio n. 1
0
File: app.py Progetto: duniter/sakia
    async def remove_connection(self, connection):
        connections_processor = ConnectionsProcessor.instanciate(self)
        connections_processor.remove_connections(connection)

        CertificationsProcessor.instanciate(self).cleanup_connection(connection, connections_processor.pubkeys())
        IdentitiesProcessor.instanciate(self).cleanup_connection(connection)

        SourcesProcessor.instanciate(self).drop_all_of(currency=connection.currency, pubkey=connection.pubkey)

        DividendsProcessor.instanciate(self).cleanup_connection(connection)

        TransactionsProcessor.instanciate(self).cleanup_connection(connection, connections_processor.pubkeys())

        self.db.commit()
        self.connection_removed.emit(connection)
Esempio n. 2
0
    async def remove_connection(self, connection):
        connections_processor = ConnectionsProcessor.instanciate(self)
        connections_processor.remove_connections(connection)

        CertificationsProcessor.instanciate(self).cleanup_connection(
            connection, connections_processor.pubkeys())
        IdentitiesProcessor.instanciate(self).cleanup_connection(connection)

        SourcesProcessor.instanciate(self).drop_all_of(
            currency=connection.currency, pubkey=connection.pubkey)

        DividendsProcessor.instanciate(self).cleanup_connection(connection)

        TransactionsProcessor.instanciate(self).cleanup_connection(
            connection, connections_processor.pubkeys())

        self.db.commit()
Esempio n. 3
0
 async def initialize_dividends(self, identity, transactions, log_stream):
     """
     Download certifications information locally
     :param sakia.data.entities.Identity identity: the identity to initialize
     :param List[sakia.data.entities.Transaction] transactions: the list of transactions found by tx processor
     :param function log_stream: a method to log data in the screen
     :return:
     """
     dividends_processor = DividendsProcessor.instanciate(self.app)
     return await dividends_processor.initialize_dividends(
         identity, transactions, log_stream)
Esempio n. 4
0
File: app.py Progetto: eliadem/sakia
    async def remove_connection(self, connection):
        await self.stop_current_profile()
        connections_processor = ConnectionsProcessor.instanciate(self)
        connections_processor.remove_connections(connection)

        IdentitiesProcessor.instanciate(self).cleanup_connection(connection)

        CertificationsProcessor.instanciate(self).cleanup_connection(connection, connections_processor.pubkeys())

        SourcesProcessor.instanciate(self).drop_all_of(currency=connection.currency, pubkey=connection.pubkey)

        DividendsProcessor.instanciate(self).cleanup_connection(connection)

        TransactionsProcessor.instanciate(self).cleanup_connection(connection, connections_processor.pubkeys())

        if not connections_processor.connections():
            NodesProcessor.instanciate(self).drop_all(self.currency)

        self.db.commit()
        self.start_coroutines()
Esempio n. 5
0
    def instanciate_services(self):
        nodes_processor = NodesProcessor(self.db.nodes_repo)
        bma_connector = BmaConnector(nodes_processor, self.parameters)
        connections_processor = ConnectionsProcessor(self.db.connections_repo)
        identities_processor = IdentitiesProcessor(self.db.identities_repo,
                                                   self.db.certifications_repo,
                                                   self.db.blockchains_repo,
                                                   bma_connector)
        certs_processor = CertificationsProcessor(self.db.certifications_repo,
                                                  self.db.identities_repo,
                                                  bma_connector)
        blockchain_processor = BlockchainProcessor.instanciate(self)
        sources_processor = SourcesProcessor.instanciate(self)
        transactions_processor = TransactionsProcessor.instanciate(self)
        dividends_processor = DividendsProcessor.instanciate(self)
        nodes_processor.initialize_root_nodes(self.currency)
        self.db.commit()

        self.documents_service = DocumentsService.instanciate(self)
        self.identities_service = IdentitiesService(
            self.currency, connections_processor, identities_processor,
            certs_processor, blockchain_processor, bma_connector)

        self.transactions_service = TransactionsService(
            self.currency, transactions_processor, dividends_processor,
            identities_processor, connections_processor, bma_connector)

        self.sources_service = SourcesServices(
            self.currency, sources_processor, connections_processor,
            transactions_processor, blockchain_processor, bma_connector)

        self.blockchain_service = BlockchainService(self, self.currency,
                                                    blockchain_processor,
                                                    bma_connector,
                                                    self.identities_service,
                                                    self.transactions_service,
                                                    self.sources_service)

        self.network_service = NetworkService.load(self, self.currency,
                                                   nodes_processor,
                                                   self.blockchain_service,
                                                   self.identities_service)
Esempio n. 6
0
File: app.py Progetto: duniter/sakia
    def instanciate_services(self):
        nodes_processor = NodesProcessor(self.db.nodes_repo)
        bma_connector = BmaConnector(nodes_processor, self.parameters)
        connections_processor = ConnectionsProcessor(self.db.connections_repo)
        identities_processor = IdentitiesProcessor(self.db.identities_repo, self.db.certifications_repo, self.db.blockchains_repo, bma_connector)
        certs_processor = CertificationsProcessor(self.db.certifications_repo, self.db.identities_repo, bma_connector)
        blockchain_processor = BlockchainProcessor.instanciate(self)
        sources_processor = SourcesProcessor.instanciate(self)
        transactions_processor = TransactionsProcessor.instanciate(self)
        dividends_processor = DividendsProcessor.instanciate(self)
        nodes_processor.initialize_root_nodes(self.currency)
        self.db.commit()

        self.documents_service = DocumentsService.instanciate(self)
        self.identities_service = IdentitiesService(self.currency, connections_processor,
                                                    identities_processor,
                                                    certs_processor, blockchain_processor,
                                                    bma_connector)

        self.transactions_service = TransactionsService(self.currency, transactions_processor,
                                                                   dividends_processor,
                                                                   identities_processor, connections_processor,
                                                                   bma_connector)

        self.sources_service = SourcesServices(self.currency, sources_processor,
                                               connections_processor, transactions_processor,
                                               blockchain_processor, bma_connector)

        self.blockchain_service = BlockchainService(self, self.currency, blockchain_processor, connections_processor,
                                                    bma_connector,
                                                    self.identities_service,
                                                    self.transactions_service,
                                                    self.sources_service)

        self.network_service = NetworkService.load(self, self.currency, nodes_processor,
                                                    self.blockchain_service,
                                                    self.identities_service)