From 17bbba06bd4646bbc559cac542064b138bd3f668 Mon Sep 17 00:00:00 2001 From: Rashad Alston Date: Mon, 18 Sep 2023 10:16:41 -0400 Subject: [PATCH] up until 'designing a schema' --- config.yaml | 4 +- docs/src/forc-index/start.md | 4 +- docs/src/getting-started/dependencies.md | 22 +++--- .../indexer-service-infrastructure.md | 71 +++++++++++++------ docs/src/project-components/index.md | 23 ++++++ docs/src/project-components/module.md | 8 ++- docs/src/project-components/schema.md | 2 +- examples/fuel-explorer/README.md | 2 +- examples/hello-world-native/README.md | 2 +- examples/hello-world/README.md | 2 +- packages/fuel-indexer-api-server/src/api.rs | 4 +- .../fuel-indexer-api-server/src/models.rs | 4 +- packages/fuel-indexer-api-server/src/sql.rs | 2 +- packages/fuel-indexer-lib/src/config/cli.rs | 16 ++--- packages/fuel-indexer-lib/src/config/web.rs | 2 +- packages/fuel-indexer-lib/src/defaults.rs | 2 +- ...ommands__forc_index_start_help_output.snap | 4 +- ...__fuel_indexer_api_server_help_output.snap | 2 +- ...el_indexer_api_server_run_help_output.snap | 4 +- ...ommands__fuel_indexer_run_help_output.snap | 4 +- ...apshots__forc_index_start_help_output.snap | 4 +- ...__fuel_indexer_api_server_help_output.snap | 2 +- ...el_indexer_api_server_run_help_output.snap | 4 +- ...apshots__fuel_indexer_run_help_output.snap | 4 +- packages/fuel-indexer/src/service.rs | 2 +- 25 files changed, 129 insertions(+), 71 deletions(-) diff --git a/config.yaml b/config.yaml index 794465086..85bf4dc3b 100644 --- a/config.yaml +++ b/config.yaml @@ -35,7 +35,7 @@ indexer_net_config: false # The number of WASM opcodes after which the indexer will stop execution. metering_points: 30000000000 -# Allow the web API to accept raw SQL queries. +# Allow the web server to accept raw SQL queries. accept_sql_queries: false # Amount of blocks to return in a request to a Fuel node. @@ -64,7 +64,7 @@ web_api: # Web API port. port: 29987 - # Max body size for web API requests. + # Max body size for web server requests. max_body_size: "5242880" # ****************************** diff --git a/docs/src/forc-index/start.md b/docs/src/forc-index/start.md index bd208bf35..826f1e60e 100644 --- a/docs/src/forc-index/start.md +++ b/docs/src/forc-index/start.md @@ -14,7 +14,7 @@ USAGE: OPTIONS: --accept-sql-queries - Allow the web API to accept raw SQL queries. + Allow the web server to accept raw SQL queries. --auth-enabled Require users to authenticate for some operations. @@ -66,7 +66,7 @@ OPTIONS: Indexer config file. --max-body-size - Max body size for web API requests. [default: 5242880] + Max body size for web server requests. [default: 5242880] --metering-points The number of WASM opcodes after which the indexer's event handler will stop execution. diff --git a/docs/src/getting-started/dependencies.md b/docs/src/getting-started/dependencies.md index 84bfbd2a6..24b61742f 100644 --- a/docs/src/getting-started/dependencies.md +++ b/docs/src/getting-started/dependencies.md @@ -1,20 +1,26 @@ # Dependencies -> This guide covers some of the basics with regard to installing dependencies for the Fuel indexer service. However, note that this guide is meant to be a general overview for most platforms and by no means covers all platforms. If you're having trouble with dependencies on your system, we recommend that you use `docker`. +> This guide covers some of the basics with regard to installing dependencies for the Fuel indexer service. However, note that this guide is meant to be a general overview for most platforms and by no means covers all platforms. +> +> If you're having trouble with dependencies on your system, we recommend that you use `docker`. To run the Fuel indexer, you'll need to install a few dependencies on your system: -- The [Rust programming language, with its package manager](https://www.rust-lang.org/tools/install) -- [`fuelup`](#fuelup), the Fuel toolchain manager -- A [PostgresQL](#postgresql) server backend -- The [`wasm32-unknown-unknown`](#web-assembly-wasm) `rustup` target -- [`wasm-snip`](#web-assembly-wasm), a utility for stripping symbols from WebAssemly binaries. +1. The [Rust programming language, with its package manager](https://www.rust-lang.org/tools/install) +2. [`fuelup`](#fuelup), the Fuel toolchain manager +3. A [PostgresQL](#postgresql) server backend +4. The [`wasm32-unknown-unknown`](#web-assembly-wasm) `rustup` target +5. [`wasm-snip`](#web-assembly-wasm), a utility for stripping symbols from WebAssemly binaries. -> If you don't want to install a database directly onto your system, you can use Docker to run it as an isolated container. You can install Docker by following the [install instructions](https://docs.docker.com/get-docker/). For reference purposes, we provide a [`docker compose` file](https://github.com/FuelLabs/fuel-indexer/blob/develop/scripts/docker-compose.yaml) that comes with a PostgresSQL server and a Fuel indexer service. +> If you don't want to install a database directly onto your system, you can use Docker to run a database in an isolated container. You can install Docker by following its [installation instructions](https://docs.docker.com/get-docker/). +> +> For reference purposes, we provide a [`docker compose` file](https://github.com/FuelLabs/fuel-indexer/blob/develop/scripts/docker-compose.yaml) that comes with a PostgresSQL server and a Fuel indexer service. ## `fuelup` -We strongly recommend that you use the Fuel indexer through [`forc`, the Fuel orchestrator](https://fuellabs.github.io/sway/master/book/forc/index.html). You can get `forc` (and other Fuel components) by way of [`fuelup`, the Fuel toolchain manager](https://fuellabs.github.io/fuelup/latest). Install `fuelup` by running the following command, which downloads and runs the installation script. +We strongly recommend that you use the Fuel indexer that's made available via [`forc`, the Fuel orchestrator](https://fuellabs.github.io/sway/master/book/forc/index.html). You can get `forc` (and other Fuel components) by way of [`fuelup`, the Fuel toolchain manager](https://fuellabs.github.io/fuelup/latest). + +Install `fuelup` by running the following command, which downloads and runs the installation script. ```bash curl --proto '=https' --tlsv1.2 -sSf https://install.fuel.network/fuelup-init.sh | sh diff --git a/docs/src/getting-started/indexer-service-infrastructure.md b/docs/src/getting-started/indexer-service-infrastructure.md index e77ba16ed..60831c723 100644 --- a/docs/src/getting-started/indexer-service-infrastructure.md +++ b/docs/src/getting-started/indexer-service-infrastructure.md @@ -1,28 +1,44 @@ # Indexer Service Infrastructure +- [Service Components](#components) +- [Fuel Indexer Service](#fuel-indexer-service) + - [Starting the service via CLI options](#using-cli-options-indexer-service) + - [Starting the service via a config file](#using-a-configuration-file-indexer-service) +- [Fuel Indexer Web Server](#web-api-server) + - [Starting the service via CLI options](#using-cli-options-web-server) + - [Starting the service via a config file](#using-a-configuration-file-web-server) + A Fuel indexer service instance requires just three components: -- a **Fuel node**: Custom indexers monitor incoming blocks from a Fuel node and extract information about the state of the Fuel blockchain. +- a **Fuel Node**: Custom indexers monitor incoming blocks via a Fuel GraphQL server and extract information about the state of the Fuel blockchain. - a **PostgresQL database server**: Extracted information is saved into a database. -- a **web server**: dApps can query indexers for up-to-date information and operators can deploy/remove indexers as needed. +- a **Web Server**: dApps can query indexers for up-to-date information and operators can deploy/remove indexers as needed. --- -The Fuel indexer service will connect to any Fuel node, which means you can run your own node or use a node provided by Fuel. The indexer service web API is included with the Fuel indexer; it's available as soon as the indexer is started through `fuel-indexer run`. The only component that isn't provided for you is a Postgres database server. You should set up a server according to your own needs and specifications. - ## Components | Component | Default Host | Default Port | CLI Argument | Environment Variable | |---|---|---|---|---| -| Fuel Node | localhost | 4000 | `--fuel-node-host` / `--fuel-node-port` | | -| Database Server | localhost | 5432 | `--postgres-user` / `--postgres--password` / `--postgres-host` / `--postgres--port` / `--postgres-database` | | -| Indexer Service Web API | localhost | 29987 | `--web-api-host` / `--web-api-port` | | +| Fuel Node | localhost | 4000 | `--fuel-node-{host,port}` | $FUEL_NODE_{HOST,PORT} | +| Database Server | localhost | 5432 | `--postgres-{username,database,password,host,port}` | $POSTGRES_{USERNAME,DATABASE,PASSWORD,HOST,PORT} | +| Indexer Service Web API | localhost | 29987 | `--web-api-{host,port}` | $WEB_API_{HOST,PORT} | + +--- + +## Fuel Indexer Service + +The Fuel indexer service will connect to any Fuel GraphQL server, which means you can run your own node or use a node provided by Fuel. The indexer service web server is included with the Fuel indexer; it's available as soon as the indexer is started through `fuel-indexer run`. The only component that isn't provided for you is a Postgres database server. You should set up a server according to your own needs and specifications. -## Starting the Fuel indexer +> You can start the indexer service with an array of CLI options. Note that most (if not all) of these options include sensible defaults. -### Using CLI options +### Using CLI options (Indexer Service) + +```bash +fuel-indexer run --help +``` ```text Standalone binary for the fuel indexer service. @@ -32,7 +48,7 @@ USAGE: OPTIONS: --accept-sql-queries - Allow the web API to accept raw SQL queries. + Allow the web server to accept raw SQL queries. --auth-enabled Require users to authenticate for some operations. @@ -84,7 +100,7 @@ OPTIONS: Indexer config file. --max-body-size - Max body size for web API requests. [default: 5242880] + Max body size for web server requests. [default: 5242880] --metering-points The number of WASM opcodes after which the indexer's event handler will stop execution. @@ -141,39 +157,37 @@ OPTIONS: ``` -### Using a configuration file +### Using a configuration file (Indexer Service) ```yaml {{#include ../../../config.yaml}} ``` +---- + ## Web API Server -The `fuel-indexer-api-server` crate of the Fuel indexer contains a standalone web API server that acts as a queryable endpoint on top of the database. Note that the main `fuel-indexer` binary of the indexer project also contains the same web API endpoint. +The `fuel-indexer-api-server` crate of the Fuel indexer contains a standalone web server server that acts as a queryable endpoint on top of the database. Note that the main `fuel-indexer` binary of the indexer project also contains the same web server endpoint. -> The `fuel-indexer-api-server` crate offers a _standalone_ web API endpoint, whereas the API endpoint offered in `fuel-indexer` is bundled with other Fuel indexer functionality (e.g., execution, handling, data-layer construction, etc). Offering the API server as a separate piece allows users to separate components and run them on different systems, if desired. +> The `fuel-indexer-api-server` crate offers a _standalone_ web server endpoint, whereas the API endpoint offered in `fuel-indexer` is bundled with other Fuel indexer functionality (e.g., execution, handling, data-layer construction, etc). Offering the API server as a separate piece allows users to separate components and run them on different systems, if desired. -### Usage +### Using CLI Options (Web Server) -To run the standalone Fuel indexer web API server using a configuration file: +> You can start the indexer service with an array of CLI options. Note that most (if not all) of these options include sensible defaults. ```bash -fuel-indexer-api-server run --config config.yaml +fuel-indexer-api-server run --help ``` -In the above example, `config.yaml` is based on [the default service configuration file](https://github.com/FuelLabs/fuel-indexer/blob/develop/config.yaml). - -### Options - ```text -Fuel indexer web API +Fuel indexer web server USAGE: fuel-indexer-api-server run [OPTIONS] OPTIONS: --accept-sql-queries - Allow the web API to accept raw SQL queries. + Allow the web server to accept raw SQL queries. --auth-enabled Require users to authenticate for some operations. @@ -254,3 +268,14 @@ OPTIONS: --web-api-port Web API port. [default: 29987] ``` + +### Using A Configuration File (Web Server) + +To run the standalone Fuel indexer web server server using a configuration file: + +```bash +fuel-indexer-api-server run --config config.yaml +``` + +In the above example, `config.yaml` is based on [the default service configuration file](https://github.com/FuelLabs/fuel-indexer/blob/develop/config.yaml). + diff --git a/docs/src/project-components/index.md b/docs/src/project-components/index.md index 3439b92ab..a763512ef 100644 --- a/docs/src/project-components/index.md +++ b/docs/src/project-components/index.md @@ -14,10 +14,33 @@ We'll describe these three different use cases below. The Fuel indexer provides functionality to make it easy to build and compile abitrary indexers by using the [`forc index`](../forc-index/index.md) CLI tool. Using `forc index`, users can create, build, deploy, and remove indexers, as well as authenticate against a running indexer service, and check the status of running indexers. +#### Example + +Create, deploy, and check the status of a new indexer. + +```bash +forc index new fuel && \ + cd fuel && forc index deploy --url http://indexer.fuel.network && \ + forc index status --url http://indexer.fuel.network --auth $MY_TOKEN +``` + ### As a standalone service You can also start the Fuel indexer as a standalone service that connects to a Fuel node in order to monitor the Fuel blockchain for new blocks and transactions. To do so, run the requisite database migrations, adjust the configuration to connect to a Fuel node, and start the service. +#### Example + +Create, deploy, and check the status of a new indexer. + +```bash +fuel-indexer run \ + --fuel-node-host beta-4.fuel.network \ + --fuel-node-port 80 \ + --run-migrations \ + --accept-sql-queries \ + --replace-indexer +``` + ### As part of a Fuel project Finally, you can run the Fuel indexer as part of a project that uses other components of the Fuel ecosystem, such as Sway. The convention for a Fuel project layout including an indexer is as follows: diff --git a/docs/src/project-components/module.md b/docs/src/project-components/module.md index cf259f8fc..75214663e 100644 --- a/docs/src/project-components/module.md +++ b/docs/src/project-components/module.md @@ -22,9 +22,13 @@ mod indexer_mod { } ``` -The first line imports the [prelude](https://docs.rs/fuel-indexer-utils/latest/fuel_indexer_utils/prelude/index.html) from `fuel_indexer_utils`; this allows you to quickly bootstrap an indexer by using common types and traits. Then, we have a module decorated with the `#[indexer]` macro. This macro processes a manifest at the supplied file path, parses your schema and Sway contract ABI (if supplied), and generates code that is combined with handler functions in order to create a complete indexer module. +## What's going on here? -Finally, we have an example handler function. You can define which functions handle different events by using the function parameters. If you add a function parameter of a certain type `T`, the function will be triggered whenever that type is found as part of a block, transaction, or receipt. In this example, let's say that you have a Sway contract with a function that logs a `Greeting` struct. When that function executes as part of a transaction, the logged struct will be included in the data that is processed from the Fuel blockchain. Your indexer module will see the struct and execute `log_the_greeting`. +- The first line imports the [prelude](https://docs.rs/fuel-indexer-utils/latest/fuel_indexer_utils/prelude/index.html) from `fuel_indexer_utils`; this allows you to quickly bootstrap an indexer by using common types and traits. Then, we have a module decorated with the `#[indexer]` macro. + - This macro processes a manifest at the supplied file path, parses your schema and Sway contract ABI (if supplied), and generates code that is combined with handler functions in order to create a complete indexer module. + +- Finally, we have an example handler function. You can define which functions handle different events by using the function parameters. If you add a function parameter of a certain type `T`, the function will be triggered whenever that type is found as part of a block, transaction, or receipt. + - In this example, let's say that you have a Sway contract with a function that logs a `Greeting` struct. When that function executes as part of a transaction, the logged struct will be included in the data that is processed from the Fuel blockchain. Your indexer module will see the struct and execute `log_the_greeting`. > You can learn more about what data can be indexed and find example handlers in the [Indexing Fuel Types](../indexing-fuel-types/index.md) and [Indexing Custom Types](../indexing-custom-types/index.md) sections. diff --git a/docs/src/project-components/schema.md b/docs/src/project-components/schema.md index ef3e7df05..f4c93bf20 100644 --- a/docs/src/project-components/schema.md +++ b/docs/src/project-components/schema.md @@ -1,6 +1,6 @@ # GraphQL Schema -The GraphQL schema is a required component of the Fuel indexer. When data is indexed into the database, the actual values that are persisted to the database will be values created using the data structures defined in the schema. +The GraphQL schema is a required component of the Fuel indexer. When data is indexed into the database, the actual values that are persisted to the database will be values created using the data structures defined in the GraphQL schema. Below is a sample GraphQL schema for a Fuel indexer. diff --git a/examples/fuel-explorer/README.md b/examples/fuel-explorer/README.md index cedc46ca2..20a7f8ff8 100644 --- a/examples/fuel-explorer/README.md +++ b/examples/fuel-explorer/README.md @@ -43,7 +43,7 @@ query { ``` > IMPORTANT: Since this example uses a dockerized indexer service, with the GraphQL -> web API being bound at interface `0.0.0.0` your LAN IP might differ from the +> web server being bound at interface `0.0.0.0` your LAN IP might differ from the > `192.168.1.34` mentioned above. > > On *nix platforms you can typically find your LAN IP via `ifconfig | grep inet` \ No newline at end of file diff --git a/examples/hello-world-native/README.md b/examples/hello-world-native/README.md index f51b65e7b..e5ddecd01 100644 --- a/examples/hello-world-native/README.md +++ b/examples/hello-world-native/README.md @@ -52,7 +52,7 @@ query { ``` > IMPORTANT: Since this example uses a dockerized indexer service, with the GraphQL -> web API being bound at interface `0.0.0.0` your LAN IP might differ from the +> web server being bound at interface `0.0.0.0` your LAN IP might differ from the > `192.168.1.34` mentioned above. > > On *nix platforms you can typically find your LAN IP via `ifconfig | grep inet` \ No newline at end of file diff --git a/examples/hello-world/README.md b/examples/hello-world/README.md index 434edb236..3bc0af5f0 100644 --- a/examples/hello-world/README.md +++ b/examples/hello-world/README.md @@ -50,7 +50,7 @@ query { ``` > IMPORTANT: Since this example uses a dockerized indexer service, with the GraphQL -> web API being bound at interface `0.0.0.0` your LAN IP might differ from the +> web server being bound at interface `0.0.0.0` your LAN IP might differ from the > `192.168.1.34` mentioned above. > > On *nix platforms you can typically find your LAN IP via `ifconfig | grep inet` diff --git a/packages/fuel-indexer-api-server/src/api.rs b/packages/fuel-indexer-api-server/src/api.rs index 5aba634a1..bd772bb93 100644 --- a/packages/fuel-indexer-api-server/src/api.rs +++ b/packages/fuel-indexer-api-server/src/api.rs @@ -41,7 +41,7 @@ use tower_http::{ }; use tracing::{error, Level}; -/// Result type returned by web API operations. +/// Result type returned by web server operations. pub type ApiResult = core::result::Result; /// Size of the buffer for reqeusts being passed to the `RateLimitLayer`. @@ -70,7 +70,7 @@ impl From for HttpError { } } -/// Error type returned by web API operations. +/// Error type returned by web server operations. #[derive(Debug, Error)] pub enum ApiError { #[error("Query builder error {0:?}")] diff --git a/packages/fuel-indexer-api-server/src/models.rs b/packages/fuel-indexer-api-server/src/models.rs index 1cddffacd..2b1d19210 100644 --- a/packages/fuel-indexer-api-server/src/models.rs +++ b/packages/fuel-indexer-api-server/src/models.rs @@ -12,7 +12,7 @@ pub struct VerifySignatureRequest { pub message: String, } -/// GraphQL web API response. +/// GraphQL web server response. #[derive(Serialize)] pub(crate) struct QueryResponse { /// Arbitrarily sized JSON response. @@ -74,7 +74,7 @@ impl Claims { } } -/// A SQL query posted to the web API. +/// A SQL query posted to the web server. #[derive(Serialize, Deserialize, Clone, Debug)] pub struct SqlQuery { /// The literal raw SQL query. diff --git a/packages/fuel-indexer-api-server/src/sql.rs b/packages/fuel-indexer-api-server/src/sql.rs index 3d002ead0..2545d7fdf 100644 --- a/packages/fuel-indexer-api-server/src/sql.rs +++ b/packages/fuel-indexer-api-server/src/sql.rs @@ -15,7 +15,7 @@ pub enum SqlValidatorError { /// A validator for SQL queries. /// -/// Intended to ensure that users posting raw SQL queries to web API endpoints +/// Intended to ensure that users posting raw SQL queries to web server endpoints /// are not attempting to do anything malicious. pub struct SqlQueryValidator; diff --git a/packages/fuel-indexer-lib/src/config/cli.rs b/packages/fuel-indexer-lib/src/config/cli.rs index 167608f02..798c9e570 100644 --- a/packages/fuel-indexer-lib/src/config/cli.rs +++ b/packages/fuel-indexer-lib/src/config/cli.rs @@ -63,8 +63,8 @@ pub struct IndexerArgs { #[clap(long, help = "Database type.", default_value = defaults::DATABASE, value_parser(["postgres"]))] pub database: String, - /// Max body size for web API requests. - #[clap(long, help = "Max body size for web API requests.", default_value_t = defaults::MAX_BODY_SIZE )] + /// Max body size for web server requests. + #[clap(long, help = "Max body size for web server requests.", default_value_t = defaults::MAX_BODY_SIZE )] pub max_body_size: usize, /// Postgres username. @@ -184,8 +184,8 @@ pub struct IndexerArgs { )] pub remove_data: bool, - /// Allow the web API to accept raw SQL queries. - #[clap(long, help = "Allow the web API to accept raw SQL queries.")] + /// Allow the web server to accept raw SQL queries. + #[clap(long, help = "Allow the web server to accept raw SQL queries.")] pub accept_sql_queries: bool, /// Amount of blocks to return in a request to a Fuel node. @@ -196,7 +196,7 @@ pub struct IndexerArgs { #[derive(Debug, Parser, Clone)] #[clap( name = "Fuel Indexer API Server", - about = "Fuel indexer web API", + about = "Fuel indexer web server", version )] pub struct ApiServerArgs { @@ -236,7 +236,7 @@ pub struct ApiServerArgs { #[clap(long, help = "Database type.", default_value = defaults::DATABASE, value_parser(["postgres"]))] pub database: String, - /// Max body size for web API requests. + /// Max body size for web server requests. #[clap(long, help = "Max body size for web requests.", default_value_t = defaults::MAX_BODY_SIZE )] pub max_body_size: usize, @@ -313,7 +313,7 @@ pub struct ApiServerArgs { #[clap(long, help = "Number of seconds over which to allow --rate-limit-rps.")] pub rate_limit_window_size: Option, - /// Allow the web API to accept raw SQL queries. - #[clap(long, help = "Allow the web API to accept raw SQL queries.")] + /// Allow the web server to accept raw SQL queries. + #[clap(long, help = "Allow the web server to accept raw SQL queries.")] pub accept_sql_queries: bool, } diff --git a/packages/fuel-indexer-lib/src/config/web.rs b/packages/fuel-indexer-lib/src/config/web.rs index 0506c8417..5dc92189e 100644 --- a/packages/fuel-indexer-lib/src/config/web.rs +++ b/packages/fuel-indexer-lib/src/config/web.rs @@ -19,7 +19,7 @@ pub struct WebApiConfig { #[serde(default)] pub port: String, - /// Max body size for web API requests. + /// Max body size for web server requests. #[serde(default)] pub max_body_size: usize, } diff --git a/packages/fuel-indexer-lib/src/defaults.rs b/packages/fuel-indexer-lib/src/defaults.rs index 2e88f6590..14d5c4e2d 100644 --- a/packages/fuel-indexer-lib/src/defaults.rs +++ b/packages/fuel-indexer-lib/src/defaults.rs @@ -132,5 +132,5 @@ pub const REPLACE_INDEXER: bool = false; /// Whether to remove the indexed data when replacing an indexer. pub const REMOVE_DATA: bool = false; -/// Allow the web API to accept raw SQL queries. +/// Allow the web server to accept raw SQL queries. pub const ACCEPT_SQL: bool = false; diff --git a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__forc_index_start_help_output.snap b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__forc_index_start_help_output.snap index 2cc462b08..d7fac7506 100644 --- a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__forc_index_start_help_output.snap +++ b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__forc_index_start_help_output.snap @@ -9,7 +9,7 @@ USAGE: OPTIONS: --accept-sql-queries - Allow the web API to accept raw SQL queries. + Allow the web server to accept raw SQL queries. --auth-enabled Require users to authenticate for some operations. @@ -61,7 +61,7 @@ OPTIONS: Indexer config file. --max-body-size - Max body size for web API requests. [default: 5242880] + Max body size for web server requests. [default: 5242880] --metering-points The number of WASM opcodes after which the indexer's event handler will stop execution. diff --git a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__fuel_indexer_api_server_help_output.snap b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__fuel_indexer_api_server_help_output.snap index 62f934cb6..f3bb86d04 100644 --- a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__fuel_indexer_api_server_help_output.snap +++ b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__fuel_indexer_api_server_help_output.snap @@ -13,4 +13,4 @@ OPTIONS: SUBCOMMANDS: help Print this message or the help of the given subcommand(s) - run Fuel indexer web API + run Fuel indexer web server diff --git a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__fuel_indexer_api_server_run_help_output.snap b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__fuel_indexer_api_server_run_help_output.snap index afe11352d..1564a42e7 100644 --- a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__fuel_indexer_api_server_run_help_output.snap +++ b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__fuel_indexer_api_server_run_help_output.snap @@ -2,14 +2,14 @@ source: packages/fuel-indexer-tests/tests/commands.rs expression: output --- -Fuel indexer web API +Fuel indexer web server USAGE: fuel-indexer-api-server run [OPTIONS] OPTIONS: --accept-sql-queries - Allow the web API to accept raw SQL queries. + Allow the web server to accept raw SQL queries. --auth-enabled Require users to authenticate for some operations. diff --git a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__fuel_indexer_run_help_output.snap b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__fuel_indexer_run_help_output.snap index 939df7f58..46f9952af 100644 --- a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__fuel_indexer_run_help_output.snap +++ b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__commands__fuel_indexer_run_help_output.snap @@ -9,7 +9,7 @@ USAGE: OPTIONS: --accept-sql-queries - Allow the web API to accept raw SQL queries. + Allow the web server to accept raw SQL queries. --auth-enabled Require users to authenticate for some operations. @@ -61,7 +61,7 @@ OPTIONS: Indexer config file. --max-body-size - Max body size for web API requests. [default: 5242880] + Max body size for web server requests. [default: 5242880] --metering-points The number of WASM opcodes after which the indexer's event handler will stop execution. diff --git a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__forc_index_start_help_output.snap b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__forc_index_start_help_output.snap index df6bc81e4..fb5e7a9c2 100644 --- a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__forc_index_start_help_output.snap +++ b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__forc_index_start_help_output.snap @@ -9,7 +9,7 @@ USAGE: OPTIONS: --accept-sql-queries - Allow the web API to accept raw SQL queries. + Allow the web server to accept raw SQL queries. --auth-enabled Require users to authenticate for some operations. @@ -61,7 +61,7 @@ OPTIONS: Indexer config file. --max-body-size - Max body size for web API requests. [default: 5242880] + Max body size for web server requests. [default: 5242880] --metering-points The number of WASM opcodes after which the indexer's event handler will stop execution. diff --git a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__fuel_indexer_api_server_help_output.snap b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__fuel_indexer_api_server_help_output.snap index 445bc01b9..a0b2193b3 100644 --- a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__fuel_indexer_api_server_help_output.snap +++ b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__fuel_indexer_api_server_help_output.snap @@ -13,4 +13,4 @@ OPTIONS: SUBCOMMANDS: help Print this message or the help of the given subcommand(s) - run Fuel indexer web API + run Fuel indexer web server diff --git a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__fuel_indexer_api_server_run_help_output.snap b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__fuel_indexer_api_server_run_help_output.snap index dbd54724b..e3c217c1f 100644 --- a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__fuel_indexer_api_server_run_help_output.snap +++ b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__fuel_indexer_api_server_run_help_output.snap @@ -2,14 +2,14 @@ source: packages/fuel-indexer-tests/tests/snapshots.rs expression: output --- -Fuel indexer web API +Fuel indexer web server USAGE: fuel-indexer-api-server run [OPTIONS] OPTIONS: --accept-sql-queries - Allow the web API to accept raw SQL queries. + Allow the web server to accept raw SQL queries. --auth-enabled Require users to authenticate for some operations. diff --git a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__fuel_indexer_run_help_output.snap b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__fuel_indexer_run_help_output.snap index 6d6d3ba40..48aeb1018 100644 --- a/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__fuel_indexer_run_help_output.snap +++ b/packages/fuel-indexer-tests/tests/snapshots/integration_tests__snapshots__fuel_indexer_run_help_output.snap @@ -9,7 +9,7 @@ USAGE: OPTIONS: --accept-sql-queries - Allow the web API to accept raw SQL queries. + Allow the web server to accept raw SQL queries. --auth-enabled Require users to authenticate for some operations. @@ -61,7 +61,7 @@ OPTIONS: Indexer config file. --max-body-size - Max body size for web API requests. [default: 5242880] + Max body size for web server requests. [default: 5242880] --metering-points The number of WASM opcodes after which the indexer's event handler will stop execution. diff --git a/packages/fuel-indexer/src/service.rs b/packages/fuel-indexer/src/service.rs index a7a01e49f..78c8646db 100644 --- a/packages/fuel-indexer/src/service.rs +++ b/packages/fuel-indexer/src/service.rs @@ -258,7 +258,7 @@ impl IndexerService { Ok(()) } - /// Kick it off! Run the indexer service loop, listening to service messages primarily coming from the web API. + /// Kick it off! Run the indexer service loop, listening to service messages primarily coming from the web server. pub async fn run(mut self) -> IndexerResult<()> { loop { tokio::select! {