Exemplo n.º 1
0
        public BroadcastProvider(IUnitOfWork unitOfWork, IHttpService httpService, IOptions <BlockmainiaOptions> blockmainiaOptions, ILogger <BroadcastProvider> logger)
        {
            this.unitOfWork         = unitOfWork;
            this.httpService        = httpService;
            this.blockmainiaOptions = blockmainiaOptions.Value;
            this.logger             = logger;

            broadcasts = new ConcurrentDictionary <ulong, CancellationTokenSource>();
        }
Exemplo n.º 2
0
        public HttpService(IMembershipServiceClient membershipServiceClient, IOnionServiceClient onionServiceClient,
                           ITorClient torClient, ISigningActorProvider signingActorProvider, IConfiguration configuration,
                           IOptions <BlockmainiaOptions> blockmainiaOptions, ILogger <HttpService> logger)
        {
            this.membershipServiceClient = membershipServiceClient;
            this.onionServiceClient      = onionServiceClient;
            this.torClient            = torClient;
            this.signingActorProvider = signingActorProvider;
            this.blockmainiaOptions   = blockmainiaOptions.Value;
            this.logger = logger;

            var gatewaySection = configuration.GetSection("Gateway");

            GatewayUrl = gatewaySection.GetValue <string>("Url");

            Members = new ConcurrentDictionary <ulong, string>();

            SetNodeIdentity();

            cancellationTokenSource = new CancellationTokenSource();

            MaintainMembers(cancellationTokenSource.Token);
        }