public VaspCodesServiceTest() { var ethereumRpcUrl = "https://ropsten.infura.io/v3/fb49e892176d413d85f993d0352a0971"; var indexAddress = "0x4988a15D3CA2AEBd2Dfd02629E759492E6e29BfE"; _vaspCodesService = new VaspCodesService(new Web3(ethereumRpcUrl), indexAddress); }
public TransportClient( string vaspId, string privateTransportKey, IWhisperService whisperRpc, IVaspCodesService vaspCodesService, IOutboundEnvelopeService outboundEnvelopeService, ILoggerFactory loggerFactory) { _vaspId = vaspId; _privateTransportKey = privateTransportKey; _whisperRpc = whisperRpc; _vaspCodesService = vaspCodesService; _outboundEnvelopeService = outboundEnvelopeService; _connections = new ConcurrentDictionary <string, Connection>(); _openVaspPayloads = new ConcurrentDictionary <string, OpenVaspPayloadBase>(); _activeTopics = new HashSet <string>(); _logger = loggerFactory?.CreateLogger <TransportClient>(); _outboundEnvelopeService.OutboundEnvelopeReachedMaxResends += OnOutboundEnvelopeReachedMaxResends; _timer = new Timer(5 * 100); _timer.Elapsed += async delegate { await TimerOnElapsed(); }; StartAsync().GetAwaiter().GetResult(); }
public SessionsService( IMessageFormatterService messageFormatterService, IVaspCodesService vaspCodesService, ITransportService transportService, string privateMessageKey, ILoggerFactory loggerFactory) { _messageFormatterService = messageFormatterService; _vaspCodesService = vaspCodesService; _transportService = transportService; _sessions = new ConcurrentDictionary <string, Session>(); _privateMessageKey = privateMessageKey; _logger = loggerFactory?.CreateLogger <SessionsService>(); _transportService.TransportMessageReceived += TransportClientOnTransportMessageReceived; }