Skip to content

Commit 3bb8e24

Browse files
committed
improve some explanations
1 parent 28c11d5 commit 3bb8e24

File tree

4 files changed

+21
-22
lines changed

4 files changed

+21
-22
lines changed

docs/networks/node-ops/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/list-subscriptions-message.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ If there are no active subscriptions, `subscriptions` array will be empty.
4343

4444
### Request fields
4545

46-
| Name | Type | Mandatory | Description |
47-
|----------|--------|-----------|-----------------------------------------------------------------------------------------|
48-
| `action` | STRING | YES | Action to perform. Must be `list_subscriptions` to initiate a list subscription request |
46+
| Name | Type | Required | Description |
47+
|----------|--------|----------|-----------------------------------------------------------------------------------------|
48+
| `action` | STRING | YES | Action to perform. Must be `list_subscriptions` to initiate a list subscription request |

docs/networks/node-ops/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/overview.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ data.
1616

1717
- **Endpoint**: The WebSocket server is available at:
1818
```
19-
wss://api.flow.com/ws
19+
wss://rest-mainnet.onflow.org/ws
2020
```
2121
- **Limits**:
22-
- Each connection supports up to 10 concurrent subscriptions. Exceeding this limit will result in an error.
23-
- Each subscription may provide up to 5 responses per second.
22+
- Each connection supports up to 20 concurrent subscriptions. Exceeding this limit will result in an error.
23+
- Each subscription may provide up to 20 responses per second.
2424
- After 1 minute of inactivity (no data is sent to/read from connection) connection is closed.
2525
- **Supported Topics**:
2626
- `blocks`
@@ -38,7 +38,7 @@ data.
3838
Use any WebSocket client library to connect to the endpoint. Below is an example using JavaScript:
3939

4040
```javascript
41-
const ws = new WebSocket('wss://api.flow.com/ws');
41+
const ws = new WebSocket('wss://rest-mainnet.onflow.org/ws');
4242

4343
ws.onopen = () => {
4444
console.log('Connected to WebSocket server');
@@ -184,7 +184,8 @@ If a request is invalid or cannot be processed, the server responds with an erro
184184

185185
### Asynchronous environments
186186

187-
If you're working in an asynchronous environment, our Stream API ensures **in-order message delivery**.
187+
If you're working in an asynchronous environment, the Streaming API ensures **first-in first-out** message processing,
188+
so responses will be returned in the same order the requests were received over the connection.
188189
You can leverage this feature to simplify your code and maintain consistency.
189190

190-
Additionally, you can use the `subscription_id` as a message identifier to manage subscriptions effectively.
191+
Additionally, you can specify your own `subscription_id` in the subscribe request to easily identify the correct response.

docs/networks/node-ops/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/subscribe-message.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,19 @@ Subscribe requests must be sent as JSON in text frames, one request per frame.
6262
"subscription_id": "some-id-1",
6363
"error": {
6464
"code": 500,
65-
"message": "access node is not responsible"
65+
"message": "internal error"
6666
}
6767
}
6868
```
6969

7070
### Request fields:
7171

72-
| Name | Type | Mandatory | Description |
73-
|-------------------|--------|-----------|-----------------------------------------------------------------------------------------------------------------------------------|
74-
| `subscription_id` | STRING | NO | Optional unique identifier for the subscription. Max length of ID generated by client is 20. Server will generate UUID if omitted |
75-
| `action` | STRING | YES | Action to perform. Must be `subscribe` to initiate a subscription |
76-
| `topic` | STRING | YES | The topic to subscribe to, such as `blocks`, `block_digests`, etc. |
77-
| `arguments` | STRING | NO | Additional parameters for the subscription, such as `start_block_id`, `start_block_height` or other. |
72+
| Name | Type | Required | Description |
73+
|-------------------|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------|
74+
| `subscription_id` | STRING | NO | Optional unique identifier for the subscription. Max length of ID generated by client is 20. Server will generate UUID if omitted |
75+
| `action` | STRING | YES | Action to perform. Must be `subscribe` to initiate a subscription |
76+
| `topic` | STRING | YES | The topic to subscribe to, such as `blocks`, `block_digests`, etc. |
77+
| `arguments` | STRING | NO | Additional topic specific parameters for the subscription, such as `start_block_id`, `start_block_height` or other. |
7878

7979
You can use `subscription_id` as a client-generated identifier to track responses asynchronously.
8080
If you don't provide `subscription_id`, the server will generate one and include it in the response.
81-
82-
The order of params is not significant.

docs/networks/node-ops/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/unsubscribe-message.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Unsubscribe requests must be sent as JSON in text frames, one request per frame.
3939

4040
### Request fields
4141

42-
| Name | Type | Mandatory | Description |
43-
|-------------------|--------|-----------|-----------------------------------------------------------------------|
44-
| `subscription_id` | STRING | YES | Unique identifier of the subscription |
45-
| `action` | STRING | YES | Action to perform. Must be `unsubscribe` to initiate a unsubscription |
42+
| Name | Type | Required | Description |
43+
|-------------------|--------|----------|-----------------------------------------------------------------------|
44+
| `subscription_id` | STRING | YES | Unique identifier of the subscription |
45+
| `action` | STRING | YES | Action to perform. Must be `unsubscribe` to initiate a unsubscription |

0 commit comments

Comments
 (0)