Skip to content

Commit

Permalink
Merge pull request #422 from subsquid/misc-fixes-by-abernatskiy-aug30
Browse files Browse the repository at this point in the history
Misc fixes by abernatskiy aug30
  • Loading branch information
abernatskiy authored Aug 30, 2024
2 parents da22850 + a4a9d41 commit 227fe01
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/cloud/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Subsquid provides RPC and database addons that can be used with your squid deplo

For real time data you can use the [`rpc` addon](/cloud/resources/rpc-proxy). First, open the `RPC endpoints` tab in the Subsquid cloud sidebar and copy the URL of the chosen endpoint.

![RPC proxy tab](./overview-rpc-page.png)
![RPC addon tab](./overview-rpc-page.png)

Add it to the `.env` file:

Expand Down
4 changes: 2 additions & 2 deletions docs/cloud/pricing.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Subsquid bills [organizations](/cloud/resources/organizations) for the resources
- unmetered GraphQL API requests
- deploying any number of pay-as-you-go [dedicated](/cloud/reference/scale/#dedicated) squids
- deploying any number of pay-as-you-go [collocated](/cloud/reference/scale/#dedicated) squids
- free 2M [RPC proxy](/cloud/resources/rpc-proxy) requests monthly + just `$2/1M` afterwards
- free 2M [RPC addon](/cloud/resources/rpc-proxy) requests monthly + just `$2/1M` afterwards
- priority support

Other resources used by squids are priced as described below. Billing typically occurs on the first day of each month.
Expand Down Expand Up @@ -181,5 +181,5 @@ While we do our best to ensure that the resources are shared fairly, we strongly

**Q**: How can I use the provided RPC package? How do I set the rate limits for it?

**A**: Please look at the [RPC proxy docs](/cloud/resources/rpc-proxy/).
**A**: Please look at the [RPC addon docs](/cloud/resources/rpc-proxy/).

2 changes: 1 addition & 1 deletion docs/cloud/reference/manifest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ See [Postgres add-on](/cloud/reference/pg).

- **`rpc`**

See [RPC proxy](/cloud/resources/rpc-proxy).
See [RPC add-on](/cloud/resources/rpc-proxy).

### `migrate:`

Expand Down
4 changes: 3 additions & 1 deletion docs/cloud/reference/rpc-proxy-networks.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ deploy:
rpc:
- eth-goerli.http
```
See the [RPC proxy guide](/cloud/resources/rpc-proxy) for details.
See the [RPC addon guide](/cloud/resources/rpc-proxy) for details.
<details>
Expand Down Expand Up @@ -85,6 +85,8 @@ See the [RPC proxy guide](/cloud/resources/rpc-proxy) for details.
| Asset Hub Westend | `asset-hub-westend.http` |
| Astar | `astar-substrate.http` |
| Basilisk | `basilisk.http` |
| Bittensor | `bittensor.http` |
| Bittensor Testnet | `bittensor-testnet.http` |
| Bridge Hub Kusama | `bridge-hub-kusama.http` |
| Bridge Hub Polkadot | `bridge-hub-polkadot.http` |
| Bridge Hub Rococo | `bridge-hub-rococo.http` |
Expand Down
2 changes: 1 addition & 1 deletion docs/cloud/resources/organizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A playground organization is created for each account on its first login. There,

Playground squids cannot be used in production, as they are [collocated](/cloud/reference/scale/#dedicated) and run on [spot VMs](https://cloud.google.com/spot-vms). Expect 3-5 minutes of downtime once every few days. Other limitations include:
- 10 GB of database storage;
- 500k monthly requests to the [RPC proxy](/cloud/resources/rpc-proxy) service.
- 500k monthly requests to the [built-in RPC service](/cloud/resources/rpc-proxy).

Unlike other organizations, playgrounds cannot be shared or billed.

Expand Down
18 changes: 9 additions & 9 deletions docs/cloud/resources/rpc-proxy.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
sidebar_position: 70
title: RPC proxy service
title: RPC addon
description: Built-in RPC endpoints
---

# RPC proxy service
# RPC addon

[List of available networks](/cloud/reference/rpc-proxy-networks) and their aliases is available on the reference page.

Subsquid Cloud provides a built-in RPC proxy service. The service is available to all squids deployed to the Cloud, although [playground](/cloud/resources/organizations/#playgrounds) squids only have access to a limited number of calls.
Subsquid Cloud provides a built-in RPC service. The service is available as an addon to all squids deployed to the Cloud, although [playground](/cloud/resources/organizations/#playgrounds) squids only have access to a limited number of calls.

[Professional organizations](/cloud/resources/organizations/#professional-organizations) do not have that limitation and [can access](#external-access) their RPC proxy endpoints from outside of the Cloud.
[Professional organizations](/cloud/resources/organizations/#professional-organizations) do not have that limitation and [can access](#external-access) their RPC endpoints from outside of the Cloud.

Enable the RPC add-on in the [manifest](/cloud/reference/manifest) like this:
```yaml
Expand All @@ -22,7 +22,7 @@ deploy:
## Processor configuration
With the add-on successfully enabled, your squid will get a unique proxied endpoint to the requested network. Subsquid Cloud will make its URL available to the deployed squid at the `RPC_${Upper(network)}_${Upper(protocol)}` environment variable. Assert it to avoid compilation errors. We also recommend rate limiting RPC proxy requests on the processor side to the same rate as was used in the manifest:
With the add-on successfully enabled, your squid will get a unique proxied endpoint to the requested network. Subsquid Cloud will make its URL available to the deployed squid at the `RPC_${Upper(network)}_${Upper(protocol)}` environment variable. Assert it to avoid compilation errors. We also recommend rate limiting RPC addon requests on the processor side to the same rate as was used in the manifest:
```ts
import {assertNotNull} from '@subsquid/util-internal'
Expand All @@ -37,7 +37,7 @@ processor.setRpcEndpoint({

[Professional organizations](/cloud/resources/organizations/#professional-organizations) can [access their RPC proxies from outside](https://app.subsquid.io/rpc) of the Subsquid Cloud.

Among other things, this enables a development process that uses the proxy for both local and Cloud runs transparently. Here an example configuration for Ethereum Mainnet:
Among other things, this enables a development process that uses the service for both local and Cloud runs transparently. Here an example configuration for Ethereum Mainnet:

<details>

Expand All @@ -46,10 +46,10 @@ Among other things, this enables a development process that uses the proxy for b
1. Add the following variable to `.env`:
```bash
# get the url from https://app.subsquid.io/rpc/chains/eth
RPC_ETH_HTTP=<your_external_proxy_url>
RPC_ETH_HTTP=<your_rpc_url_for_external_use>
```

2. Enable the RPC proxy in squid.yaml:
2. Enable the RPC addon in squid.yaml:
```yaml
deploy:
addons:
Expand All @@ -73,4 +73,4 @@ Among other things, this enables a development process that uses the proxy for b

## Pricing

RPC proxy requests are priced [at a flat rate](/cloud/pricing/#rpc-requests), with substantial packages included for free for all [organization types](/cloud/resources/organizations). Pricing does not depend on the call method.
RPC addon requests are priced [at a flat rate](/cloud/pricing/#rpc-requests), with substantial packages included for free for all [organization types](/cloud/resources/organizations). Pricing does not depend on the call method.
2 changes: 1 addition & 1 deletion docs/sdk/reference/processors/evm-batch/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type ChainRpc = string | {
Setting `maxBatchCallSize` to `1` disables batching completely.
:::tip
We recommend using private endpoints for better performance and stability of your squids. For Subsquid Cloud deployments you can use the [RPC proxy](/cloud/resources/rpc-proxy). If you use an external private RPC, keep the endpoint URL in a [Cloud secret](/cloud/resources/env-variables#secrets).
We recommend using private endpoints for better performance and stability of your squids. For Subsquid Cloud deployments you can use the [RPC addon](/cloud/resources/rpc-proxy). If you use an external private RPC, keep the endpoint URL in a [Cloud secret](/cloud/resources/env-variables#secrets).
:::
### `setDataSource(ds: {archive?: string, chain?: ChainRpc})` (deprecated) {#set-data-source}
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/reference/processors/evm-batch/state-diffs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: >-
# Storage state diffs

:::tip
State diffs for historical blocks are [currently available](/subsquid-network/reference/evm-networks) from [Subsquid Network](/subsquid-network) on the same basis as all other data stored there: for free. If you deploy a squid that indexes traces [in real-time](/sdk/resources/basics/unfinalized-blocks) to Subsquid Cloud and use our [RPC proxy](/cloud/resources/rpc-proxy), the necessary `trace_` or `debug_` RPC calls made will be counted alongside all other calls and [the price](/cloud/pricing/#rpc-requests) will be computed for the total count. There are no surcharges for traces or state diffs.
State diffs for historical blocks are [currently available](/subsquid-network/reference/evm-networks) from [Subsquid Network](/subsquid-network) on the same basis as all other data stored there: for free. If you deploy a squid that indexes traces [in real-time](/sdk/resources/basics/unfinalized-blocks) to Subsquid Cloud and use our [RPC addon](/cloud/resources/rpc-proxy), the necessary `trace_` or `debug_` RPC calls made will be counted alongside all other calls and [the price](/cloud/pricing/#rpc-requests) will be computed for the total count. There are no surcharges for traces or state diffs.
:::

#### `addStateDiff(options)` {#add-state-diff}
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/reference/processors/evm-batch/traces.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: >-
# Traces

:::tip
Traces for historical blocks are [currently available](/subsquid-network/reference/evm-networks) from [Subsquid Network](/subsquid-network) on the same basis as all other data stored there: for free. If you deploy a squid that indexes traces [in real-time](/sdk/resources/basics/unfinalized-blocks) to Subsquid Cloud and use our [RPC proxy](/cloud/resources/rpc-proxy), the necessary `trace_` or `debug_` RPC calls made will be counted alongside all other calls and [the price](/cloud/pricing/#rpc-requests) will be computed for the total count. There are no surcharges for traces or state diffs.
Traces for historical blocks are [currently available](/subsquid-network/reference/evm-networks) from [Subsquid Network](/subsquid-network) on the same basis as all other data stored there: for free. If you deploy a squid that indexes traces [in real-time](/sdk/resources/basics/unfinalized-blocks) to Subsquid Cloud and use our [RPC addon](/cloud/resources/rpc-proxy), the necessary `trace_` or `debug_` RPC calls made will be counted alongside all other calls and [the price](/cloud/pricing/#rpc-requests) will be computed for the total count. There are no surcharges for traces or state diffs.
:::

#### `addTrace(options)` {#add-trace}
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/reference/processors/substrate-batch/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type ChainRpc = string | {
Setting `maxBatchCallSize` to `1` disables batching completely.
:::tip
We recommend using private endpoints for better performance and stability of your squids. For Subsquid Cloud deployments you can use the [RPC proxy](/cloud/resources/rpc-proxy). If you use an external private RPC, keep the endpoint URL in a [Cloud secret](/cloud/resources/env-variables#secrets).
We recommend using private endpoints for better performance and stability of your squids. For Subsquid Cloud deployments you can use the [RPC addon](/cloud/resources/rpc-proxy). If you use an external private RPC, keep the endpoint URL in a [Cloud secret](/cloud/resources/env-variables#secrets).
:::
### `setDataSource(ds: {archive?: string, chain?: ChainRpc})` (deprecated) {#set-data-source}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Replace the old `setDataSource()` processor configuration call with a combinatio
+ rateLimit: 10
+ })
```
We recommend using a private RPC endpoint for the best performance, e.g. from [Dwellir](https://www.dwellir.com). For squids deployed to [Subsquid Cloud](/cloud/overview) you may also consider using our [RPC proxies](/cloud/resources/rpc-proxy).
We recommend using a private RPC endpoint for the best performance, e.g. from [Dwellir](https://www.dwellir.com). For squids deployed to [Subsquid Cloud](/cloud/overview) you may also consider using our [RPC addon](/cloud/resources/rpc-proxy).

Your squid will work with just an RPC endpoint, but it will sync significantly slower. With a Subsquid Network gateway available the processor will only use RPC to retrieve metadata **and** sync the few most recent blocks not yet made available by the gateway; without it it will retrieve all data from the endpoint.

Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/resources/migrate/migrate-to-arrowsquid.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Replace the old `setDataSource()` processor configuration call with a combinatio
+ })
+ .setFinalityConfirmation(75)
```
We recommend using a private RPC endpoint for the best performance, e.g. from [BlastAPI](https://blastapi.io/). For squids deployed to [Subsquid Cloud](/cloud/overview/) you may also consider using our [RPC proxies](/cloud/resources/rpc-proxy).
We recommend using a private RPC endpoint for the best performance, e.g. from [BlastAPI](https://blastapi.io/). For squids deployed to [Subsquid Cloud](/cloud/overview/) you may also consider using our [RPC addon](/cloud/resources/rpc-proxy).

Your squid will work without an RPC endpoint, but with a significantly increased chain latency (a few hours for most chains, roughly a day for BSC). If that works for you, you can use just the Subsquid Network gateway without setting an RPC here and skip [Step 7](#step-7) altogether.

Expand Down
4 changes: 2 additions & 2 deletions docs/sdk/resources/tools/typegen/state-queries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import TabItem from '@theme/TabItem';
<TabItem value="evm" label="squid-evm-typegen">
```

In order to make on-chain calls, one must set up a JSON-RPC endpoint using [setRpcEndpoint()](/sdk/reference/processors/evm-batch/general/#set-rpc-endpoint). We recommend using a private endpoint from e.g. [BlastAPI](https://blastapi.io/) or the Subsquid Cloud's [RPC proxy](/cloud/resources/rpc-proxy) service, and set it via an environment variable:
In order to make on-chain calls, one must set up a JSON-RPC endpoint using [setRpcEndpoint()](/sdk/reference/processors/evm-batch/general/#set-rpc-endpoint). We recommend using a private endpoint from e.g. [BlastAPI](https://blastapi.io/) or the Subsquid Cloud's [RPC addon](/cloud/resources/rpc-proxy), and set it via an environment variable:

```ts
//...
Expand All @@ -24,7 +24,7 @@ In order to make on-chain calls, one must set up a JSON-RPC endpoint using [setR
You can define the `RPC_ETH_HTTP` in three ways:
- for local runs, simply update the local `.env` file;
- for squids deployed to Cloud define it as a [secret](/cloud/resources/env-variables) on your Cloud account;
- if you are using the [RPC proxy service](/cloud/resources/rpc-proxy), leave it to the Cloud to define it for you.
- if you are using the [RPC addon](/cloud/resources/rpc-proxy), leave it to the Cloud to define it for you.

## `Contract` class

Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/tutorials/bayc/step-one-indexing-transfers.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const processor = new EvmBatchProcessor()

Here,
* `'https://v2.archive.subsquid.io/network/ethereum-mainnet'` is the URL the public Subsquid Network gateway for Ethereum mainnet. Check out [Subsquid Network reference pages](/subsquid-network/reference) for lists of public gateways for all supported networks.
* `'<eth_rpc_endpoint_url>'` is a public RPC endpoint we chose to use in this example. When an endpoint is available, the processor will begin ingesting data from it once it reaches the highest block available within Subsquid Network. Please use a private endpoint or Subsquid Cloud's [RPC proxy service](/cloud/resources/rpc-proxy) in production.
* `'<eth_rpc_endpoint_url>'` is a public RPC endpoint we chose to use in this example. When an endpoint is available, the processor will begin ingesting data from it once it reaches the highest block available within Subsquid Network. Please use a private endpoint or Subsquid Cloud's [RPC addon](/cloud/resources/rpc-proxy) in production.
* `setFinalityConfirmation(75)` call instructs the processor to consider blocks final after 75 confirmations when ingesting data from an RPC endpoint.
* `12_287_507` is the block at which the BAYC token contract was deployed. Can be found on the [contract's Etherscan page](https://etherscan.io/address/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d).
* The argument of [`addLog()`](/sdk/reference/processors/evm-batch/logs) is a set of filters that tells the processor to retrieve all event logs emitted by the BAYC contract with topic0 matching the hash of the full signature of the `Transfer` event. The hash is taken from the previously generated Typescript ABI.
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/tutorials/frontier-evm.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export type ProcessorContext<Store> = DataHandlerContext<Store, Fields>
```
:::warning
This code expects to find an URL of a working Astar RPC endpoint in the `RPC_ENDPOINT` environment variable. Set it in the `.env` file and in [Subsquid Cloud secrets](/cloud/resources/env-variables) if and when you deploy your squid there. We tested the code using a public endpoint available at `wss://astar.public.blastapi.io`; for production, we recommend using private endpoints or our [RPC proxy](/cloud/resources/rpc-proxy) service.
This code expects to find an URL of a working Astar RPC endpoint in the `RPC_ENDPOINT` environment variable. Set it in the `.env` file and in [Subsquid Cloud secrets](/cloud/resources/env-variables) if and when you deploy your squid there. We tested the code using a public endpoint available at `wss://astar.public.blastapi.io`; for production, we recommend using private endpoints or our [RPC addon](/cloud/resources/rpc-proxy).
:::

## Define the batch handler
Expand Down
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { urlList } = require('./redirectRules');
const config = {
title: 'Subsquid',
tagline: 'This documentation provides information for all degrees of expertise, varying from complete beginner, to those who only need a refresher on specific commands.',
url: 'https://docs.subsquid.io/',
url: 'https://docs.sqd.dev/',
baseUrl: '/',
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
Expand Down
12 changes: 12 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ html[class*="docs-doc-id-sdk/examples"] .pagination-nav {
--tags-navigation-cl-nonactive-text: #424242;
--tags-navigation-tooltip-bg: #ffffff;
--tags-navigation-tooltip-cl: #000000;

--ifm-pre-line-height: 1.2;
--ifm-pre-padding: 0.7rem;
}

/* A hack for tweaking the font size in code blocks. --ifm-code-font-size does not work with the rest of the configuration. */
.token-line span {
font-size: 15px;
}

/* For readability concerns, you should choose a lighter palette in dark mode. */
Expand Down Expand Up @@ -222,6 +230,10 @@ body p, body span {
font-size: 17px;
}

body code {
font-size: 15px;
}

.markdown h1:not(:where(.onboarding-homepage *)) {
font-family: var(--ifm-heading-font-family);
font-style: normal;
Expand Down

0 comments on commit 227fe01

Please sign in to comment.