コード例 #1
0
        public MothraPeeringWorker(ILogger <MothraPeeringWorker> logger,
                                   IOptionsMonitor <MothraConfiguration> mothraConfigurationOptions,
                                   IHostEnvironment environment,
                                   IClientVersion clientVersion,
                                   IStore store,
                                   IMothraLibp2p mothraLibp2P,
                                   DataDirectory dataDirectory,
                                   PeerManager peerManager,
                                   PeerDiscoveredProcessor peerDiscoveredProcessor,
                                   RpcPeeringStatusProcessor rpcPeeringStatusProcessor,
                                   RpcBeaconBlocksByRangeProcessor rpcBeaconBlocksByRangeProcessor,
                                   SignedBeaconBlockProcessor signedBeaconBlockProcessor)
        {
            _logger        = logger;
            _environment   = environment;
            _clientVersion = clientVersion;
            _dataDirectory = dataDirectory;
            _mothraConfigurationOptions = mothraConfigurationOptions;
            _mothraLibp2P                    = mothraLibp2P;
            _peerManager                     = peerManager;
            _peerDiscoveredProcessor         = peerDiscoveredProcessor;
            _rpcPeeringStatusProcessor       = rpcPeeringStatusProcessor;
            _rpcBeaconBlocksByRangeProcessor = rpcBeaconBlocksByRangeProcessor;
            _signedBeaconBlockProcessor      = signedBeaconBlockProcessor;
            _store = store;

            // 396 bytes
            _minimumSignedBeaconBlockLength = Ssz.Ssz.SignedBeaconBlockLength(
                new SignedBeaconBlock(new BeaconBlock(Slot.Zero, Root.Zero, Root.Zero, BeaconBlockBody.Zero),
                                      BlsSignature.Zero));
        }
コード例 #2
0
 public static void SendRpcResponse(this IMothraLibp2p mothraLibp2p, string method, string peer,
                                    ReadOnlySpan <byte> data)
 {
     byte[] methodUtf8 = Encoding.UTF8.GetBytes(method);
     byte[] peerUtf8   = Encoding.UTF8.GetBytes(peer);
     mothraLibp2p.SendRpcResponse(methodUtf8, peerUtf8, data);
 }
コード例 #3
0
 public MothraNetworkPeering(ILogger <MothraNetworkPeering> logger, IMothraLibp2p mothraLibp2p,
                             PeerManager peerManager)
 {
     _logger       = logger;
     _mothraLibp2p = mothraLibp2p;
     _peerManager  = peerManager;
 }
コード例 #4
0
 public MothraNetworkPeering(ILogger <MothraNetworkPeering> logger,
                             IOptionsMonitor <NetworkingConfiguration> networkingConfigurationOptions, IMothraLibp2p mothraLibp2p,
                             PeerManager peerManager)
 {
     _logger = logger;
     _networkingConfigurationOptions = networkingConfigurationOptions;
     _mothraLibp2p = mothraLibp2p;
     _peerManager  = peerManager;
 }
コード例 #5
0
 public static void SendGossip(this IMothraLibp2p mothraLibp2p, string topic, ReadOnlySpan <byte> data)
 {
     byte[] topicUtf8 = Encoding.UTF8.GetBytes(topic);
     mothraLibp2p.SendGossip(topicUtf8, data);
 }