示例#1
0
        public ProcessBlockActor(ISigningActorProvider signingActorProvider)
        {
            this.signingActorProvider = signingActorProvider;

            logger = Context.GetLogger();

            ReceiveAsync <BlockGraphMessage>(async message => Sender.Tell(await ProcessBlock(message)));
        }
        public InterpretActor(IUnitOfWork unitOfWork, ISigningActorProvider signingActorProvider)
        {
            this.unitOfWork           = unitOfWork;
            this.signingActorProvider = signingActorProvider;

            logger = Context.GetLogger();

            ReceiveAsync <InterpretBlocksMessage>(async msg => Sender.Tell(await Interpret(msg)));
        }
示例#3
0
        public SipActor(IUnitOfWork unitOfWork, IHttpService httpService, IInterpretActorProvider interpretActorProvider,
                        IProcessBlockActorProvider processBlockActorProvider, ISigningActorProvider signingActorProvider)
        {
            this.unitOfWork                = unitOfWork;
            this.httpService               = httpService;
            this.interpretActorProvider    = interpretActorProvider;
            this.processBlockActorProvider = processBlockActorProvider;
            this.signingActorProvider      = signingActorProvider;

            logger = Context.GetLogger();

            BoostGraphs = new Dictionary <string, IActorRef>();

            Receive <HashedMessage>(Register);
            ReceiveAsync <GracefulStopMessge>(async message => await GracefulStop(message));
        }
示例#4
0
        public BoostGraphActor(IUnitOfWork unitOfWork, IHttpService httpService, IInterpretActorProvider interpretActorProvider,
                               IProcessBlockActorProvider processBlockActorProvider, ISigningActorProvider signingActorProvider)
        {
            this.unitOfWork                = unitOfWork;
            this.httpService               = httpService;
            this.interpretActorProvider    = interpretActorProvider;
            this.processBlockActorProvider = processBlockActorProvider;
            this.signingActorProvider      = signingActorProvider;

            logger = Context.GetLogger();

            totalNodes = httpService.Members.Count + 1;
            if (totalNodes < requiredNodeCount)
            {
                logger.Warning($"<<< BoostGraph >>>: Minimum number of nodes required (4). Total number of nodes ({totalNodes})");
            }

            ReceiveAsync <HashedMessage>(async message => await Register(message));
            ReceiveAsync <ProcessBlockMessage>(async message => await Process(message));
        }
        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);
        }
示例#6
0
        public ProcessBlockActorProvider(ActorSystem actotSystem, ISigningActorProvider signingActorProvider, ILogger <ProcessBlockActorProvider> logger)
        {
            var actorProps = ProcessBlockActor.Props(signingActorProvider).WithRouter(new RoundRobinPool(5));

            actor = actotSystem.ActorOf(actorProps, "process-actor");
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="signingActorProvider"></param>
 /// <returns></returns>
 public static Props Props(IUnitOfWork unitOfWork, ISigningActorProvider signingActorProvider) =>
 Akka.Actor.Props.Create(() => new InterpretActor(unitOfWork, signingActorProvider));
示例#8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="signingActorProvider"></param>
 /// <returns></returns>
 public static Props Props(ISigningActorProvider signingActorProvider) =>
 Akka.Actor.Props.Create(() => new ProcessBlockActor(signingActorProvider));
 public BoostGraphActorProvider(ActorSystem actotSystem, IUnitOfWork unitOfWork, IHttpService httpService, IInterpretActorProvider interpretActorProvider,
                                IProcessBlockActorProvider processBlockActorProvider, ISigningActorProvider signingActorProvider)
 {
     actor = actotSystem.ActorOf(Props.Create(() => new BoostGraphActor
                                              (
                                                  unitOfWork,
                                                  httpService,
                                                  interpretActorProvider,
                                                  processBlockActorProvider,
                                                  signingActorProvider
                                              )), "boostgraph-actor");
 }
示例#10
0
        public SipActorProvider(ActorSystem actorSystem, IUnitOfWork unitOfWork, IHttpService httpService, IInterpretActorProvider interpretActorProvider,
                                IProcessBlockActorProvider processBlockActorProvider, ISigningActorProvider signingActorProvider, ILogger <SipActorProvider> logger)
        {
            this.logger = logger;

            actor = actorSystem.ActorOf(SipActor.Props(unitOfWork, httpService, interpretActorProvider, processBlockActorProvider, signingActorProvider), "sip-actor");
        }
示例#11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="unitOfWork"></param>
 /// <param name="httpService"></param>
 /// <param name="interpretActorProvider"></param>
 /// <param name="processBlockActorProvider"></param>
 /// <param name="signingActorProvider"></param>
 /// <returns></returns>
 public static Props Props(IUnitOfWork unitOfWork, IHttpService httpService, IInterpretActorProvider interpretActorProvider,
                           IProcessBlockActorProvider processBlockActorProvider, ISigningActorProvider signingActorProvider) =>
 Akka.Actor.Props.Create(() => new SipActor(unitOfWork, httpService, interpretActorProvider, processBlockActorProvider, signingActorProvider));
示例#12
0
        public InterpretActorProvider(ActorSystem actorSystem, IUnitOfWork unitOfWork, ISigningActorProvider signingActorProvider, ILogger <InterpretActorProvider> logger)
        {
            var actorProps = InterpretActor.Props(unitOfWork, signingActorProvider).WithRouter(new RoundRobinPool(5));

            actor = actorSystem.ActorOf(actorProps, "interpret-actor");
        }