-
Notifications
You must be signed in to change notification settings - Fork 35
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
Full Node Endpoints #261
Full Node Endpoints #261
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| REST | ✅ | ✖ | | ||
| RPC | ✖ | ✅ | |
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.
Is it worth distinguishing between REST and (Comet's) RPC? Both are JSON over HTTP. I think it's technically correct to separate them but might be confusing.
|
||
|| Full Node API | CometBFT API | | ||
| ------ | ------------- | ------------ | | ||
| gRPC | `grpcurl --plaintext <url>.dydxprotocol` | ✖ | |
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 don't think this is right:
❯ grpcurl dydx-ops-grpc.kingnodes.com:443.dydxprotocol
Too few arguments.
Try 'grpcurl -help' for more details.
❯ grpcurl dydx-ops-grpc.kingnodes.com:443 list
cosmos.auth.v1beta1.Query
cosmos.authz.v1beta1.Query
cosmos.autocli.v1.Query
...
# this one just hangs, can't use --plaintext with SSL
❯ grpcurl --plaintext dydx-ops-grpc.kingnodes.com:443 list
^C
| ------ | ------------- | ------------ | | ||
| gRPC | `grpcurl --plaintext <url>.dydxprotocol` | ✖ | | ||
| REST | `curl <url>/dydxprotocol/` | ✖ | | ||
| RPC | ✖ | `grpcurl --plaintext <url>.status` | |
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.
RPC should be checked through CURL not gRPC
|| Full Node API | CometBFT API | | ||
| ------ | ------------- | ------------ | | ||
| gRPC | `grpcurl --plaintext <url>.dydxprotocol` | ✖ | | ||
| REST | `curl <url>/dydxprotocol/` | ✖ | |
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.
Note that the expected response is "Not Implemented"
❯ curl https://dydx-ops-rest.kingnodes.com/dydxprotocol/
{"code":12, "message":"Not Implemented", "details":[]}%
[gRPC endpoints](#grpc) and | ||
[REST endpoints](#rest-grpc-gateway). You can use either framework. Generally, [gRPC](https://grpc.io/) provides a faster connection. | ||
|
||
### gRPC Endpoints |
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.
Given that gRPC and REST endpoints are the same, just with different protocols for access, I'd think it makes more sense to combine the gRPC and REST sections into "Full Node Endpoints", and then show the example requests for both gRPC and REST.
|
||
See the [CometBFT RPC v0.38 API specification](https://docs.cometbft.com/v0.38/rpc) for CometBFT endpoints. | ||
|
||
**Examples** |
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 "stream the height of the network" (rather than query) is the most important one
@@ -1,3 +1,3 @@ | |||
# Full Node gRPC Streaming | |||
|
|||
This page has moved to [API Integration > Full Node Streaming API](../api_integration-full-node-streaming.md). | |||
This page has moved to [API Integration > Full Node Streaming](../api_integration-full-node-streaming.md). |
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.
This page has moved to [API Integration > Full Node Streaming](../api_integration-full-node-streaming.md). | |
This page has moved to [API Integration > Full Node Streaming](../../api_integration-full-node-streaming.md). |
|
||
See the [API specification]() for gRPC endpoints. | ||
|
||
**Examples** |
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.
IMO examples would be clearer if they used a live node URL from a specific deployment, like https://dydx-ops-rest.kingnodes.com/ directly, so you can link e.g. straight to https://dydx-ops-rest.kingnodes.com/dydxprotocol/vault/params, and have a separate section explaining that you can substitute your node's address for the base URL.
### REST Endpoints | ||
You can interact with the Full Node API using `curl` or your own tool to send RESTful requests. Nodes provide support for REST through [gRPC-Gateway](https://grpc-ecosystem.github.io/grpc-gateway/). The gRPC-Gateway server is available on port `1317` by default. | ||
|
||
See the [Silk Nodes API specification](https://dydx.api.silknodes.io/swagger/#/) for REST endpoints. |
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.
Makes sense to link the swagger spec, but having it hosted elsewhere could be confusing (what is silknodes?)
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.
In the same vein, I think it makes sense to link to the gRPC query service definitions underlying the gRPC endpoints. Maybe just have a quick paragraph explaining how to find the source code for a given endpoint. One of the cool things about DC, for an API user, is that you can just "read the code".
Thanks for the review @matthewdowney, I'll let you know on slack when I've addressed everything |
I'm reworking and expanding the page. I expect it to take a few more days |
Work in progress:
This page introduces infrastructure provider users to full node APIs. After reading the intro, a user should understand which API they want to use and find the right query method. After reading a section on their preferred query method, a user should be able to connect to a node and use the linked spec.
@matthewdowney, could you please fact-check what's here and call out missing information? Including additional examples you'd like to see, if any
Preview - Full Node Endpoints