WebSocket real-time updates: faster polling + network events
- Reduce polling interval to 5 seconds for faster updates - Add network update events (peer count changes) - Include block type (PoS/PoW) in newBlock events - Track connected WebSocket clients - Emit networkUpdate when peer count changes This enables real-time live feed on the explorer frontend.
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
import { Transport } from "../transport";
|
||||
export declare class WebSocket extends Transport {
|
||||
protected perMessageDeflate: any;
|
||||
private socket;
|
||||
/**
|
||||
* WebSocket transport
|
||||
*
|
||||
* @param req
|
||||
*/
|
||||
constructor(req: any);
|
||||
/**
|
||||
* Transport name
|
||||
*/
|
||||
get name(): string;
|
||||
/**
|
||||
* Advertise upgrade support.
|
||||
*/
|
||||
get handlesUpgrades(): boolean;
|
||||
/**
|
||||
* Writes a packet payload.
|
||||
*
|
||||
* @param {Array} packets
|
||||
* @private
|
||||
*/
|
||||
send(packets: any): void;
|
||||
/**
|
||||
* Closes the transport.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
doClose(fn: any): void;
|
||||
}
|
||||
Reference in New Issue
Block a user