Websockets, GraphQL, and More
When Rivet first launched, we just supported HTTPS based RPC calls on the Ethereum mainnet. In the weeks that followed, we added support for Goerli, Ropsten, and Rinkeby. Now we’re ready to announce a handful of new features.
Websockets
The feature we’re most excited to announce is websockets, which comes with several benefits. In addition to being able to send all of your standard RPC requests through a long-lived websockets connection, you also get filters and subscriptions.
Our HTTP offering doesn’t support eth_newFilter
, eth_newBlockFilter
, eth_getFilterChanges
, or eth_getFilterLogs
, because with load-balanced requests we can’t guarantee that your eth_getFilterChanges
request will go to the same server as your eth_newFilter
request. But with websockets you have a stateful session that allows you to use filter related RPC Calls.
Our websockets implementation also supports eth_subscribe
, so you can subscribe to a feed of information without having to poll for updates. When you subscribe to something using eth_subscribe
, you will get charged 1 RPC request every time we send you something on your subscription. In most cases this will mean you use fewer RPC requests than you would if you had to poll for the same information.
You’ll find your websockets URL on the rivet.cloud dashboard, but the general pattern is wss://YOUR_API_KEY.eth.ws.rivet.cloud
GraphQL
The next feature we’re happy to announce is GraphQL support. This is based on the Geth implementation of GraphQL that was added in Geth v1.9. GraphQL provides an interface that is, in many ways, cleaner than the conventional RPC interface. It also enables developers to write more complex queries for information, that can potentially grab more data in a single request.
Again, you’ll find your GraphQL URL on the rivet.cloud dashboard, but the scheme is https://YOUR_API_KEY.eth.graphql.rivet.cloud
In addition to being able to run GraphQL queries, you’ll also find the GraphiQL console served from that URL.
New Endpoint URLs
Historically, you’ve been able to run RPC calls at https://eth.rpc.rivet.cloud/YOUR_API_KEY
. Those aren’t going away, but we’ve added the option of https://YOUR_API_KEY.eth.rpc.rivet.cloud
. This has been a request from customers who wanted to stick their RPC endpoint behind their own CDN, letting you set up https://eth.example.com
or https://example.com/eth
backed by Rivet, but served under your own domain. This can help reduce the chattiness of Cross-Origin-Resource-Sharing protocols, and gives you greater control over your users’ experience.
Sign Up Now
If you’re not already a Rivet subscriber, you can sign up at rivet.cloud. Sign up for a free BUIDL plan to get 500,000 requests per month. Upgrade to a SCAEL plan to unlock all you can use at $1 per 100,000 requests.