-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add skeleton for new websockets stream api docs #1074
base: main
Are you sure you want to change the base?
Add skeleton for new websockets stream api docs #1074
Conversation
* Added a single page overiview docs * Added a multi-page detailed docs for each message type
@illia-malachyn is attempting to deploy a commit to the Flow Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
docs/networks/node-ops/access-onchain-data/access-nodes/accessing-data/websockets-stream-api.md
Outdated
Show resolved
Hide resolved
@illia-malachyn the deployed vercel from a few days ago is here. With the left nav we probably want a top label that is more readable than "websockets-stream-api". This nav option is also distinct from the written title of 'Websockets Stream API'. My guess is the intention was for the sub pages to be under that root, not the 'websockets-stream-api' one ![]() ![]() |
Nav looks good in latest vercel deployment. Looks like there's still more to be added and we should wait to merge this only once the functionality is deployed and live. |
Use any WebSocket client library to connect to the endpoint. Below is an example using JavaScript: | ||
|
||
```javascript | ||
const ws = new WebSocket('wss://api.flow.com/ws'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use the correct url or an obviously fake one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is it ? wss://rest-mainnet.onflow.org/ws
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's
wss://rest-mainnet.onflow.org/v1/ws
- Each connection supports up to 10 concurrent subscriptions. Exceeding this limit will result in an error. | ||
- Each subscription may provide up to 5 responses per second. | ||
- After 1 minute of inactivity (no data is sent to/read from connection) connection is closed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should make all of these configurable, and just list the values used on the public access nodes here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I use up-to-date values here, or provide a link to the code where the defaults are set, or maybe scrap the values from the flow-go
repo ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put the current defaults here. we can update them later if they are changed
...s/node-ops/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/overview.md
Outdated
Show resolved
Hide resolved
...s/node-ops/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/overview.md
Outdated
Show resolved
Hide resolved
...s/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/subscribe-message.md
Outdated
Show resolved
Hide resolved
...s/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/subscribe-message.md
Outdated
Show resolved
Hide resolved
...access-onchain-data/access-nodes/accessing-data/websockets-stream-api/unsubscribe-message.md
Outdated
Show resolved
Hide resolved
...onchain-data/access-nodes/accessing-data/websockets-stream-api/list-subscriptions-message.md
Outdated
Show resolved
Hide resolved
...s/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/subscribe-message.md
Outdated
Show resolved
Hide resolved
...s/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/subscribe-message.md
Outdated
Show resolved
Hide resolved
@illia-malachyn you will need to merge from main since the project structure for the docs in this area changed. Also, we need to make sure this section is also updated: https://developers.flow.com/networks/access-onchain-data#subscriptions |
Created separate issue #1150 to fix the last part you mentioned, as I see we do not have any description of new gRPC subscriptions and do not mark the old implementation as deprecated. |
|
||
If neither `start_block_id` nor `start_block_height` is set, the subscription will start from the latest block based on its status. | ||
|
||
### Example Responce |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Responce => Response. here and in other places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we should correct those spelling errors thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a few more comments. otherwise this is good
...onchain-data/access-nodes/accessing-data/websockets-stream-api/list-subscriptions-message.md
Outdated
Show resolved
Hide resolved
...s/node-ops/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/overview.md
Outdated
Show resolved
Hide resolved
...s/node-ops/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/overview.md
Outdated
Show resolved
Hide resolved
...s/node-ops/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/overview.md
Outdated
Show resolved
Hide resolved
...s/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/subscribe-message.md
Outdated
Show resolved
Hide resolved
...ps/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/subscribe-topics.md
Outdated
Show resolved
Hide resolved
"subscription_id": "some-id-4", | ||
"topic": "events", | ||
"payload": { | ||
"block_id": "0385...", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does blockID include a 0x
prefix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it does not
...ps/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/subscribe-topics.md
Outdated
Show resolved
Hide resolved
...ps/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/subscribe-topics.md
Outdated
Show resolved
Hide resolved
...ps/access-onchain-data/access-nodes/accessing-data/websockets-stream-api/subscribe-topics.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Peter Argue <[email protected]>
@peterargue fixed all remarks. |
@illia-malachyn fyi vercel threw an error on deployment:
|
Closes onflow/flow-go#6644
This is in progress and is postponed till we finish with websockets epic. However, you can review it and write notes about it.
What to add to: