public SwimProtocolProvider(ITorClient torClient, IOnionServiceClient onionServiceClient, ISwimNode node, ILogger <SwimProtocolProvider> logger) { Node = node; _torClient = torClient; _onionServiceClient = onionServiceClient; _logger = logger; }
public ActorService(IOnionServiceClient onionService, IWalletService walletService, ICoinService coinService, IConfiguration configuration, ILogger logger, IUnitOfWork unitOfWork) { this.onionService = onionService; this.walletService = walletService; this.coinService = coinService; this.logger = logger; this.unitOfWork = unitOfWork; Client = onionService.OnionEnabled.Equals(1) ? new Client(configuration, logger, new DotNetTor.SocksPort.SocksPortHandler(onionService.SocksHost, onionService.SocksPort)) : new Client(configuration, logger); Sessions = new ConcurrentDictionary <Guid, Session>(); machine = new StateMachine <State, Trigger>(State.New); verifyTrigger = machine.SetTriggerParameters <Guid>(Trigger.Verify); unlockTrigger = machine.SetTriggerParameters <Guid>(Trigger.Unlock); burnTrigger = machine.SetTriggerParameters <Guid>(Trigger.Torch); commitReceiverTrigger = machine.SetTriggerParameters <Guid>(Trigger.Commit); redemptionKeyTrigger = machine.SetTriggerParameters <Guid>(Trigger.PrepareRedemptionKey); publicKeyAgreementTrgger = machine.SetTriggerParameters <Guid>(Trigger.PublicKeyAgreement); paymentTrgger = machine.SetTriggerParameters <Guid>(Trigger.PaymentAgreement); reversedTrgger = machine.SetTriggerParameters <Guid>(Trigger.RollBack); Configure(); // Test().GetAwaiter().GetResult(); }
public MessagePoolService(IOnionServiceClient onionServiceClient, IUnitOfWork unitOfWork, ITorClient torClient, IMembershipServiceClient membershipServiceClient, ILogger <MessagePoolService> logger) { this.onionServiceClient = onionServiceClient; this.unitOfWork = unitOfWork; this.torClient = torClient; this.membershipServiceClient = membershipServiceClient; this.logger = logger; }
public ActorService(IOnionServiceClient onionService, IWalletService walletService, ICoinService coinService, IConfiguration configuration, ILogger logger) { this.onionService = onionService; this.walletService = walletService; this.coinService = coinService; this.logger = logger; client = onionService.OnionEnabled.Equals(1) ? new Client(logger, new DotNetTor.SocksPort.SocksPortHandler(onionService.SocksHost, onionService.SocksPort)) : new Client(logger); apiRestSection = configuration.GetSection(Constant.ApiGateway); }
public SigningActor(IOnionServiceClient onionServiceClient) { this.onionServiceClient = onionServiceClient; logger = Context.GetLogger(); Receive <ValidateCoinRuleMessage>(message => Sender.Tell(ValidateCoinRule(message))); Receive <VerifiyBlockSignatureMessage>(message => Sender.Tell(VerifiyBlockSignature(message))); Receive <VerifiySignatureMessage>(message => Sender.Tell(VerifiySignature(message))); Receive <VerifiyHashChainMessage>(message => Sender.Tell(VerifiyHashChain(message))); ReceiveAsync <SignedHashMessage>(async message => Sender.Tell(await Sign(message))); ReceiveAsync <SignedBlockGraphMessage>(async message => Sender.Tell(await Sign(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); }
public TorRunningCommand(IServiceProvider serviceProvider) { console = serviceProvider.GetService <IConsole>(); onionServiceClient = serviceProvider.GetService <IOnionServiceClient>(); }
public SigningActorProvider(ActorSystem actorSystem, IOnionServiceClient onionServiceClient, ILogger <SigningActor> logger) { var actorProps = SigningActor.Props(onionServiceClient).WithRouter(new RoundRobinPool(5)); actor = actorSystem.ActorOf(actorProps, "signing-actor"); }
public static async Task <SignedSwimMessage> CreateAsync(MessageBase message, IOnionServiceClient client) { var serialized = JsonConvert.SerializeObject(message); var hash = Cryptography.GenericHashNoKey(serialized); var signatureResponse = await client.SignHashAsync(hash); return(new SignedSwimMessage { Hash = hash, Message = message, Signature = signatureResponse.Signature, PublicKey = signatureResponse.PublicKey }); }
public LotteryService(IOnionServiceClient onionServiceClient) { OnionServiceClient = onionServiceClient; }
/// <summary> /// /// </summary> /// <param name="onionServiceClient"></param> /// <returns></returns> public static Props Props(IOnionServiceClient onionServiceClient) => Akka.Actor.Props.Create(() => new SigningActor(onionServiceClient));