Search in sources :

Example 1 with SyncNotificationEmitter

use of co.rsk.rpc.modules.eth.subscribe.SyncNotificationEmitter in project rskj by rsksmart.

the class RskContext method getWeb3WebSocketServer.

private Web3WebSocketServer getWeb3WebSocketServer() {
    if (web3WebSocketServer == null) {
        RskSystemProperties rskSystemProperties = getRskSystemProperties();
        JsonRpcSerializer jsonRpcSerializer = getJsonRpcSerializer();
        Ethereum rsk = getRsk();
        SyncProcessor syncProcessor = getSyncProcessor();
        EthSubscriptionNotificationEmitter emitter = new EthSubscriptionNotificationEmitter(new BlockHeaderNotificationEmitter(rsk, jsonRpcSerializer), new LogsNotificationEmitter(rsk, jsonRpcSerializer, getReceiptStore(), new BlockchainBranchComparator(getBlockStore())), new PendingTransactionsNotificationEmitter(rsk, jsonRpcSerializer), new SyncNotificationEmitter(rsk, jsonRpcSerializer, blockchain, syncProcessor));
        RskWebSocketJsonRpcHandler jsonRpcHandler = new RskWebSocketJsonRpcHandler(emitter);
        web3WebSocketServer = new Web3WebSocketServer(rskSystemProperties.rpcWebSocketBindAddress(), rskSystemProperties.rpcWebSocketPort(), jsonRpcHandler, getJsonRpcWeb3ServerHandler(), rskSystemProperties.rpcWebSocketServerWriteTimeoutSeconds(), rskSystemProperties.rpcWebSocketMaxFrameSize(), rskSystemProperties.rpcWebSocketMaxAggregatedFrameSize());
    }
    return web3WebSocketServer;
}
Also used : LogsNotificationEmitter(co.rsk.rpc.modules.eth.subscribe.LogsNotificationEmitter) SyncNotificationEmitter(co.rsk.rpc.modules.eth.subscribe.SyncNotificationEmitter) PendingTransactionsNotificationEmitter(co.rsk.rpc.modules.eth.subscribe.PendingTransactionsNotificationEmitter) Ethereum(org.ethereum.facade.Ethereum) BlockHeaderNotificationEmitter(co.rsk.rpc.modules.eth.subscribe.BlockHeaderNotificationEmitter)

Aggregations

BlockHeaderNotificationEmitter (co.rsk.rpc.modules.eth.subscribe.BlockHeaderNotificationEmitter)1 LogsNotificationEmitter (co.rsk.rpc.modules.eth.subscribe.LogsNotificationEmitter)1 PendingTransactionsNotificationEmitter (co.rsk.rpc.modules.eth.subscribe.PendingTransactionsNotificationEmitter)1 SyncNotificationEmitter (co.rsk.rpc.modules.eth.subscribe.SyncNotificationEmitter)1 Ethereum (org.ethereum.facade.Ethereum)1