WebSockets
Last updated
Last updated
WebSocket RPC (Remote Procedure Call) is a communication protocol that allows clients (such as wallets or dApps) to interact with a blockchain node in real-time. It establishes a persistent, bi-directional connection between the client and the node, enabling the client to send requests and receive responses instantly.
WebSocket RPC is commonly used for tasks such as
submitting transactions
querying blockchain data,
subscribing to event notifications.
By leveraging WebSocket RPC, blockchain applications can provide a more responsive and interactive user experience compared to traditional HTTP-based communication.
WebSocket RPC and REST (Representational State Transfer) are two different approaches to client-server communication. The main differences between them are:
Protocol: WebSocket RPC uses the WebSocket protocol, which enables full-duplex, bi-directional communication over a single, persistent connection. REST, on the other hand, typically uses the HTTP protocol and follows a request-response model.
Communication Style: WebSocket RPC allows for real-time, event-driven communication, where the server can push updates to the client as soon as they occur. REST is based on a request-response cycle, where the client sends a request and waits for the server's response.
Read more