# Websocket

### Installation Guide

The WebSocket API is very similar to the RPC API, the only difference is the way you connect to the Node.\
\
The method we recommend is to use [wscat ](https://www.npmjs.com/package/wscat)as a client for connecting to websockets.\
\
wscat can be installed using npm:<br>

```bash
$ sudo npm install -g wscat 
```

### Connect using the Bware Generated Endpoint

To connect to the endpoint, we will use the following command:

```bash
$ wscat -c wss://moonbeam-api.bwarelabs.com/ws/<your-endpoint-id>
Connected (press CTRL+C to quit)
>   
```

### Simple Request Example

After Connected is shown, you can make a simple query like the following:

```bash
Connected (press CTRL+C to quit)

//Request
> {"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":53}

//Response
< {"jsonrpc": "2.0", "id": 1, "result": false}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bwarelabs.com/api-docs/moonbeam/websocket.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
