예제 #1
0
 /// <summary>
 /// Constructs the AzureIndexerLoop.
 /// </summary>
 /// <param name="fullNode">The full node that will be indexed.</param>
 /// <param name="loggerFactory">The logger factory.</param>
 public AzureIndexerLoop(FullNode fullNode, ILoggerFactory loggerFactory)
 {
     this.asyncLoopFactory = fullNode.AsyncLoopFactory;
     this.FullNode         = fullNode;
     this.Chain            = fullNode.Chain;
     this.nodeLifetime     = fullNode.NodeLifetime;
     this.indexerSettings  = fullNode.NodeService <AzureIndexerSettings>();
     this.logger           = loggerFactory.CreateLogger(GetType().FullName);
 }
 /// <summary>
 /// Constructs the Azure Indexer feature.
 /// </summary>
 /// <param name="azureIndexerLoop">The loop responsible for indexing blocks to azure.</param>
 /// <param name="nodeSettings">The settings of the full node.</param>
 /// <param name="loggerFactory">The logger factory.</param>
 /// <param name="indexerSettings">The Azure Indexer settings.</param>
 /// <param name="name">The name of this feature.</param>
 public AzureIndexerFeature(
     AzureIndexerLoop azureIndexerLoop,
     NodeSettings nodeSettings,
     ILoggerFactory loggerFactory,
     AzureIndexerSettings indexerSettings,
     string name = "AzureIndex")
 {
     this.name            = name;
     this.indexerLoop     = azureIndexerLoop;
     this.logger          = loggerFactory.CreateLogger(this.GetType().FullName);
     this.nodeSettings    = nodeSettings;
     this.indexerSettings = indexerSettings;
 }
예제 #3
0
        /// <summary>
        /// Derives an IndexerConfiguration object from the proviced AzureIndexerSettings object and network.
        /// </summary>
        /// <param name="indexerSettings">The AzureIndexerSettings object to use.</param>
        /// <param name="network">The network to use.</param>
        /// <returns>An IndexerConfiguration object derived from the AzureIndexerSettings object and network.</returns>
        public static IndexerConfiguration IndexerConfigFromSettings(AzureIndexerSettings indexerSettings, Network network)
        {
            IndexerConfiguration indexerConfig = new IndexerConfiguration();

            indexerConfig.StorageCredentials = new StorageCredentials(
                indexerSettings.AzureAccountName, indexerSettings.AzureKey);
            indexerConfig.StorageNamespace         = indexerSettings.StorageNamespace;
            indexerConfig.Network                  = network;
            indexerConfig.CheckpointSetName        = indexerSettings.CheckpointsetName;
            indexerConfig.AzureStorageEmulatorUsed = indexerSettings.AzureEmulatorUsed;

            return(indexerConfig);
        }
예제 #4
0
        /// <summary>
        /// Derives an IndexerConfiguration object from the proviced AzureIndexerSettings object and network.
        /// </summary>
        /// <param name="indexerSettings">The AzureIndexerSettings object to use.</param>
        /// <param name="network">The network to use.</param>
        /// <returns>An IndexerConfiguration object derived from the AzureIndexerSettings object and network.</returns>
        public static IndexerConfiguration IndexerConfigFromSettings(AzureIndexerSettings indexerSettings, Network network, ILoggerFactory loggerFactory)
        {
            IndexerConfiguration indexerConfig = new IndexerConfiguration(loggerFactory)
            {
                StorageNamespace         = indexerSettings.StorageNamespace,
                Network                  = network,
                CheckpointSetName        = indexerSettings.CheckpointsetName,
                AzureStorageEmulatorUsed = indexerSettings.AzureEmulatorUsed,
                StorageCredentials       = indexerSettings.AzureEmulatorUsed ? null : new StorageCredentials(indexerSettings.AzureAccountName, indexerSettings.AzureKey)
            };

            return(indexerConfig);
        }
 public static void PrintHelp(Network network)
 {
     AzureIndexerSettings.PrintHelp(network);
 }