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)
def insert_or_update_connection(self): ConnectionsProcessor(self.app.db.connections_repo).commit_connection( self.connection)