Ejemplo n.º 1
0
        public static WorkDataLogProcessor InitialiseWorkDataLogProcessor(CloudTable workTable, CloudTable workRegistryTable,
                                                                          ICollector <string> ipfsImageProcesssinQueue)
        {
            var web3 = new Web3(ConfigurationSettings.GetEthereumRpcUrl());
            var workSearchService      = InitialiseWorkSearchService();
            var workRepository         = new WorkRepository(workTable);
            var workRegistryRepository = new WorkRegistryRepository(workRegistryTable);
            var ipfsQueue = new IpfsImageQueue(ipfsImageProcesssinQueue);

            Ujo.Repository.MappingBootstrapper.Initialise();
            var musicRecordingService = new MusicRecordingService(new UnitOfWork(new UjoContext(ConfigurationSettings.GetRepositoryConnectionString())));

            return(WorkDataLogProcessor.Create(web3, workRegistryRepository, ipfsQueue, workRepository, workSearchService, musicRecordingService));
        }
Ejemplo n.º 2
0
        public static async Task ProcessWorks([TimerTrigger("00:00:05")] TimerInfo timer,
                                              [Table("Work")] CloudTable workTable, [Table("WorkRegistry")] CloudTable workRegistryTable, TextWriter log,
                                              [Queue("IpfsCoverImageProcessingQueue")] ICollector <string> ipfsImageProcesssinQueue
                                              )
        {
            log.WriteLine("Start job");
            var web3               = new Web3(ConfigurationSettings.GetEthereumRpcUrl());
            var workProcessor      = Bootstrap.InitialiseWorkDataLogProcessor(workTable, workRegistryTable, ipfsImageProcesssinQueue);
            var workBlockProcessor = Bootstrap.InitialiseBlockchainBatchProcessorService(workTable, workRegistryTable, workProcessor, log, web3);

            await workBlockProcessor.ProcessLatestBlocks();

            log.WriteLine("Finished job");
        }