use of co.rsk.rpc.modules.eth.subscribe.BlockHeaderNotificationEmitter 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;
}
Aggregations