From 3644a04c7d387c58d0765b75fff26e7a62c6ac9e Mon Sep 17 00:00:00 2001 From: Sarah Schwartz <58856580+sarahschwartz@users.noreply.github.com> Date: Fri, 8 Dec 2023 06:36:53 -0700 Subject: [PATCH] docs: configure spell-check (#1496) * docs: add spell check, minor fixes * edit * use master for docs CI --- .github/workflows/ci.yml | 1 + docs/.spellcheck.yml | 30 +++ docs/CONTRIBUTING.md | 6 +- docs/PULL_REQUEST_TEMPLATE.md | 2 +- docs/spell-check-custom-words.txt | 217 ++++++++++++++++++ docs/src/SUMMARY.md | 32 +-- docs/src/designing-a-schema/directives.md | 2 +- docs/src/designing-a-schema/relationships.md | 2 +- docs/src/designing-a-schema/scalars.md | 48 ++-- docs/src/designing-a-schema/types.md | 2 +- .../contributing-standards.md | 6 +- .../for-contributors/system-dependencies.md | 38 +-- docs/src/forc-postgres/index.md | 2 +- docs/src/getting-started/dependencies.md | 14 +- docs/src/getting-started/how-it-compares.md | 4 +- .../indexer-service-infrastructure.md | 2 +- docs/src/getting-started/quickstart.md | 4 +- docs/src/indexing-fuel-types/receipts.md | 64 +++--- docs/src/project-components/index.md | 2 +- docs/src/project-components/manifest.md | 2 +- docs/src/querying/full-example.md | 2 +- docs/src/querying/playground.md | 4 +- docs/src/querying/search-and-filtering.md | 4 +- docs/src/storing-records/index.md | 42 ++-- 24 files changed, 390 insertions(+), 142 deletions(-) create mode 100644 docs/.spellcheck.yml create mode 100644 docs/spell-check-custom-words.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35b0a5fd4..075425ee6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,6 +69,7 @@ jobs: uses: FuelLabs/github-actions/.github/workflows/mdbook-docs.yml@master with: docs-src-path: docs/src + spellcheck-config-path: 'docs/.spellcheck.yml' mdbook-build: needs: - docs-test diff --git a/docs/.spellcheck.yml b/docs/.spellcheck.yml new file mode 100644 index 000000000..cff5e2447 --- /dev/null +++ b/docs/.spellcheck.yml @@ -0,0 +1,30 @@ +matrix: + - name: SPCheck + aspell: + lang: en + dictionary: + encoding: utf-8 + wordlists: + - docs/spell-check-custom-words.txt + pipeline: + - pyspelling.filters.context: + context_visible_first: true + escapes: \\[\\`~] + delimiters: + # Ignore all code blocks + - open: '(?s)^(?P *`{3,}\s*(\w+\s*,?\s*)+.*?)$' + close: '^( *`{3,})$' + - pyspelling.filters.markdown: + markdown_extensions: + - pymdownx.superfences: + - pyspelling.filters.html: + comments: false + ignores: + - code + - pre + sources: + - 'docs/*.md' + - 'docs/src/*.md' + - 'docs/src/**/*.md' + default_encoding: utf-8 + \ No newline at end of file diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 6351370cc..17f7c863c 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -6,7 +6,7 @@ Fuel Indexer has many dependent repositories. If you need any help or mentoring ## Code Standards -- [ ] If you've added a new function, method, class or abstraction, please include rustdoc comments for the new code so others can better understand the change. +- [ ] If you've added a new function, method, class or abstraction, please include `rustdoc` comments for the new code so others can better understand the change. - [ ] If your change is non-trivial and testable, please try to include at least one happy path test to ensure that your change works. - "Trivial" changes would be changes to docs, comments, or small style/syntactic changes @@ -47,7 +47,7 @@ You can build Fuel Indexer: cargo build -p fuel-indexer -p fuel-indexer-api-server --release --locked ``` -Linting is done using rustfmt and clippy, which are each separate commands: +Linting is done using `rustfmt` and `clippy`, which are each separate commands: ```sh cargo fmt --all --check @@ -88,7 +88,7 @@ This is a rough outline of what a contributor's workflow looks like: - Examples: - If you fixed a bug, your message is `fix: database locking issue` - If you added new functionality, your message would be `enhancement: i added something super cool` - - If you just did a chore your message is: `chore: i did somthing not fun` + - If you just did a chore your message is: `chore: i helped do the chores` - Keeping commit messages short and consistent helps users parse release notes - Push up your branch to Github then (on the right hand side of the Github UI): - Assign yourself as the owner of the PR diff --git a/docs/PULL_REQUEST_TEMPLATE.md b/docs/PULL_REQUEST_TEMPLATE.md index 8f19c4a95..8cf50b7d6 100644 --- a/docs/PULL_REQUEST_TEMPLATE.md +++ b/docs/PULL_REQUEST_TEMPLATE.md @@ -6,7 +6,7 @@ Thanks for opening a PR with the Fuel Indexer project. Please review the **Check - [ ] Please add proper labels. - [ ] If there is an issue associated with this PR, please link the issue (right-hand sidebar) - [ ] If there is not an issue associated with this PR, add this PR to the "Fuel Indexer" project (right-hand sidebar) -- [ ] Please allow Codeowners at least 24 hours to do a first-pass review. +- [ ] Please allow code owners at least 24 hours to do a first-pass review. - [ ] Please add thoroughly detailed testing steps below. - [ ] Please keep your Changelog message short and sweet. diff --git a/docs/spell-check-custom-words.txt b/docs/spell-check-custom-words.txt new file mode 100644 index 000000000..5f462faa7 --- /dev/null +++ b/docs/spell-check-custom-words.txt @@ -0,0 +1,217 @@ +ABI +ABIs +ASM +IDE +IDEs +LSP +namespace +ALU +APIs +JSON +BrowserStack +CLI +Deserialization +deserializing +DApp +subcurrency +Subcurrency +intrinsics +Intrinsics +workspace +workspaces +Workspaces +neovim +EVM +EVM's +EOA +ERC +Ethereum +Ethereum's +FVM +FuelVM +Fuelup +Github +GraphQL +Infura +JSON +LSP +Merkle +PoA +PoS +PoW +RPC +SDK +SDK's +SDKs +SauceLabs +Sepolia +Structs +Sway +TAI +TODO +TypeScript +UTF +UTXO +UTXOs +Utils +VM +VSCode +abigen +args +async +backend +backtraces +blockchain +blockchain's +bytecode +codespace +codespaces +config +cryptographic +customizable +customizations +dapp +dev +dropdown +enum +enums +env +forc +frontend +fuelup +fullstack +graphQL +graphql +http +https +js +localhost +mainnet +mempool +merkle +monorepo +monorepos +natively +npm +nvm +onboarding +params +pnpm +prerelease +queryable +quickstart +relayer +relayers +repo +repos +runnable +stateful +struct +structs +struct's +testnet +testnets +toolchain +toolchains +urql +validator +validators +superABI +superABIs +SuperABIs +supertraits +compositional +typeclass +turbofish +DSL +TOML +IPFS +Bitwise +Bitwise +runtime +runtimes +formatter +deployable +Utils +ETH +initializer +initializers +destructuring +instantiation +VMs +superset +CEI +pre +entrancy +interoperable +blockchains +keccak +SHA +UI +backtrace +Collateralized +collateralized +submodule +DEX +TypeChain +inlines +inlining +MiB +FuelVM's +deterministically +CLI +VS +GraphViz +DOT +DCA +AST +GitHub +decrypt +subcommand +subcommands +Subcommands +supertrait +supertraits +Supertraits +incrementor +monomorphization +Booleans +boolean +Orchestrator +orchestrator +growable +arity +tuple's +unary +SRC +DEX +FuelLabs +PRs +codebase +PostgreSQL +Postgres +MacOS +macOS +backends +hoc +semver +SQLx +Homebrew +Changelog +lookups +namespaces +YAML +WASM +WebAssembly +dApp +dApps +JWT +Schemas +schemas +AssemblyScript +indexable +Macbook +Dockerized +TLDR +IaaS +Updatable \ No newline at end of file diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 970c27264..d21af0e53 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -34,21 +34,21 @@ - [Pagination](./querying/pagination.md) - [A Full Example](./querying/full-example.md) - [Authentication](./authentication/index.md) -- [forc index](./forc-index/index.md) - - [auth](./forc-index/auth.md) - - [build](./forc-index/build.md) - - [check](./forc-index/check.md) - - [deploy](./forc-index/deploy.md) - - [kill](./forc-index/kill.md) - - [new](./forc-index/new.md) - - [remove](./forc-index/remove.md) - - [start](./forc-index/start.md) - - [status](./forc-index/status.md) -- [forc postgres](./forc-postgres/index.md) - - [create](./forc-postgres/create.md) - - [drop](./forc-postgres/drop.md) - - [start](./forc-postgres/start.md) - - [stop](./forc-postgres/stop.md) +- [`forc index`](./forc-index/index.md) + - [`auth`](./forc-index/auth.md) + - [`build`](./forc-index/build.md) + - [`check`](./forc-index/check.md) + - [`deploy`](./forc-index/deploy.md) + - [`kill`](./forc-index/kill.md) + - [`new`](./forc-index/new.md) + - [`remove`](./forc-index/remove.md) + - [`start`](./forc-index/start.md) + - [`status`](./forc-index/status.md) +- [`forc postgres`](./forc-postgres/index.md) + - [`create`](./forc-postgres/create.md) + - [`drop`](./forc-postgres/drop.md) + - [`start`](./forc-postgres/start.md) + - [`stop`](./forc-postgres/stop.md) # For Contributors @@ -56,7 +56,7 @@ - [Contributing Standards](./for-contributors/contributing-standards.md) - [Release Schedule](./for-contributors/release-schedule.md) - [Building From Source](./for-contributors/building-from-source.md) -- [System Dependencides](./for-contributors/system-dependencies.md) +- [System Dependencies](./for-contributors/system-dependencies.md) # Appendix diff --git a/docs/src/designing-a-schema/directives.md b/docs/src/designing-a-schema/directives.md index 8426d0ca6..13d9395ba 100644 --- a/docs/src/designing-a-schema/directives.md +++ b/docs/src/designing-a-schema/directives.md @@ -46,7 +46,7 @@ type Library @entity { A `UNIQUE` constraint will be created on the `book` table's `name` column, ensuring that no books can share the same name. -> Important: When using explict or implicit foreign keys, it is required that the reference column name in your foreign key relationship be unique. `ID` types are by default unique, but all other types will have to be explicitly specified as being unique via the `@unique` directive. +> Important: When using explicit or implicit foreign keys, it is required that the reference column name in your foreign key relationship be unique. `ID` types are by default unique, but all other types will have to be explicitly specified as being unique via the `@unique` directive. ## `@join` diff --git a/docs/src/designing-a-schema/relationships.md b/docs/src/designing-a-schema/relationships.md index 5b2444c35..74f4d8432 100644 --- a/docs/src/designing-a-schema/relationships.md +++ b/docs/src/designing-a-schema/relationships.md @@ -4,7 +4,7 @@ The Fuel indexer service supports foreign key relationships and constraints. The > IMPORTANT: > -> Implicit foreign keys do not require a `@join` directive. When using implicit foreign key references, merely add the referenced object as a field type (shown below). A lookup will automagically be done to add a foreign key constraint using this object's' `id` field. +> Implicit foreign keys do not require a `@join` directive. When using implicit foreign key references, merely add the referenced object as a field type (shown below). A lookup will automatically be done to add a foreign key constraint using this object's' `id` field. > > Note that implicit foreign key relationships _only_ use the `id` field on the referenced table. If you plan to use implicit foreign keys, the object being referenced _must_ have an `id` field. > diff --git a/docs/src/designing-a-schema/scalars.md b/docs/src/designing-a-schema/scalars.md index 83cf4df79..03d906ba8 100644 --- a/docs/src/designing-a-schema/scalars.md +++ b/docs/src/designing-a-schema/scalars.md @@ -4,27 +4,27 @@ The Fuel indexer has a collection of GraphQL scalars that cover virtually any va | GraphQL Scalar | Rust Type | Notes | --- | --- | --- -| Address | `u8[32]` | -| AssetId | `u8[32]` | -| Boolean | `bool` | -| Bytes | `Vec` | Byte blob of arbitary size | -| Bytes32 | `u8[32]` | -| Bytes4 | `u8[4]` | -| Bytes64 | `u8[64]` | -| Bytes8 | `u8[8]` | -| ContractId | `u8[32]` | -| HexString | `Vec` | Byte blob of arbitrary size | -| I128 | `i128` | -| I16 | `i16` | -| I32 | `i32` | -| I64 | `i64` | -| I8 | `i8` | -| ID | `SizedAsciiString<64>` | Alias of `UID` -| Json | `String` | JSON string of arbitary size | -| String | `String` | String of arbitrary size | -| U128 | `u128` | -| U16 | `u16` | -| U32 | `u32` | -| U64 | `u64` | -| U8 | `u8` | -| UID | `SizedAsciiString<64>` | 32-byte unique ID | +| `Address` | `u8[32]` | +| `AssetId` | `u8[32]` | +| `Boolean` | `bool` | +| `Bytes` | `Vec` | Byte blob of arbitrary size | +| `Bytes32` | `u8[32]` | +| `Bytes4` | `u8[4]` | +| `Bytes64` | `u8[64]` | +| `Bytes8` | `u8[8]` | +| `ContractId` | `u8[32]` | +| `HexString` | `Vec` | Byte blob of arbitrary size | +| `I128` | `i128` | +| `I16` | `i16` | +| `I32` | `i32` | +| `I64` | `i64` | +| `I8` | `i8` | +| `ID` | `SizedAsciiString<64>` | Alias of `UID` +| `Json` | `String` | JSON string of arbitrary size | +| `String` | `String` | String of arbitrary size | +| `U128` | `u128` | +| `U16` | `u16` | +| `U32` | `u32` | +| `U64` | `u64` | +| `U8` | `u8` | +| `UID` | `SizedAsciiString<64>` | 32-byte unique ID | diff --git a/docs/src/designing-a-schema/types.md b/docs/src/designing-a-schema/types.md index 534904f79..d8137e76c 100644 --- a/docs/src/designing-a-schema/types.md +++ b/docs/src/designing-a-schema/types.md @@ -104,7 +104,7 @@ type Transaction @entity { > IMPORTANT: Note the order of the fields in the derived `Transaction` object type: the fields are ordered according to the unique set of fields from each of the union's members. > -> The `id`, `bytecode_length`, `contract_id`, and `label` fields come first, from the `CreateTransaction` object type. Next comes the `maturity` field from the `ScriptTransaction` object - because the `ScriptTransaction`'s `id` and `label` fiels are already a part of the derived `Transaction` object, courtesy of the `CreateTransaction` object type. Finally, comes the `metadata` field, as part of the `MintTransaction` object type. +> The `id`, `bytecode_length`, `contract_id`, and `label` fields come first, from the `CreateTransaction` object type. Next comes the `maturity` field from the `ScriptTransaction` object - because the `ScriptTransaction`'s `id` and `label` fields are already a part of the derived `Transaction` object, courtesy of the `CreateTransaction` object type. Finally, comes the `metadata` field, as part of the `MintTransaction` object type. This `Transaction` union type from the GraphQL schema, might be used in an indexer module like so: ```rust, ignore diff --git a/docs/src/for-contributors/contributing-standards.md b/docs/src/for-contributors/contributing-standards.md index 29a946c21..ed31aa639 100644 --- a/docs/src/for-contributors/contributing-standards.md +++ b/docs/src/for-contributors/contributing-standards.md @@ -6,7 +6,7 @@ Fuel Indexer has many dependent repositories. If you need any help or mentoring ## Code Standards -- [ ] If you've added a new function, method, class or abstraction, please include rustdoc comments for the new code so others can better understand the change. +- [ ] If you've added a new function, method, class or abstraction, please include `rustdoc` comments for the new code so others can better understand the change. - [ ] If your change is non-trivial and testable, please try to include at least one happy path test to ensure that your change works. - "Trivial" changes would be changes to docs, comments, or small style/syntactic changes @@ -47,7 +47,7 @@ You can build Fuel Indexer: cargo build -p fuel-indexer -p fuel-indexer-api-server --release --locked ``` -Linting is done using rustfmt and clippy, which are each separate commands: +Linting is done using `rustfmt` and `clippy`, which are each separate commands: ```sh cargo fmt --all --check @@ -82,7 +82,7 @@ This is a rough outline of what a contributor's workflow looks like: - Examples: - If you fixed a bug, your message is `fix: database locking issue` - If you added new functionality, your message would be `enhancement: i added something super cool` - - If you just did a chore your message is: `chore: i did somthing not fun` + - If you just did a chore your message is: `chore: i helped do the chores` - Keeping commit messages short and consistent helps users parse release notes - Push up your branch to Github then (on the right hand side of the Github UI): - Assign yourself as the owner of the PR diff --git a/docs/src/for-contributors/system-dependencies.md b/docs/src/for-contributors/system-dependencies.md index 9d3405bd7..bab3a7b1e 100644 --- a/docs/src/for-contributors/system-dependencies.md +++ b/docs/src/for-contributors/system-dependencies.md @@ -19,13 +19,13 @@ apt update && apt install -y \ | Dependency | Required For | | --------------- | --------------- | -| cmake | Manages the build process in an operating system and in a compiler-independent manner | -| pkg-config | Language-agnostic helper tool used when compiling applications and libraries | -| git | Version control system | -| gcc | Compiler tools required to build various Fuel indexer crates | -| clang/libclang-dev | Compiler tools required to build various Fuel indexer crates on Unix-like OSes | -| llvm | Required for building Fuel indexer crate dependencies | -| libpq-dev | Set of library function helping facilitate interaction with the PostgreSQL backend | +| `cmake` | Manages the build process in an operating system and in a compiler-independent manner | +| `pkg-config` | Language-agnostic helper tool used when compiling applications and libraries | +| `git` | Version control system | +| `gcc` | Compiler tools required to build various Fuel indexer crates | +| `clang`/`libclang-dev` | Compiler tools required to build various Fuel indexer crates on Unix-like OSes | +| `llvm` | Required for building Fuel indexer crate dependencies | +| `libpq-dev` | Set of library function helping facilitate interaction with the PostgreSQL backend | ## MacOS @@ -39,10 +39,10 @@ brew update && brew install \ | Dependency | Required For | | --------------- | --------------- | -| cmake | Manages the build process in an operating system and in a compiler-independent manner | -| llvm| Compiler infrastructure for building Fuel indexer crate dependencies | -| libpq | Postgres C API library | -| postgresql | Installs the command line console (psql) as well as a PostgreSQL server locally | +| `cmake` | Manages the build process in an operating system and in a compiler-independent manner | +| `llvm`| Compiler infrastructure for building Fuel indexer crate dependencies | +| `libpq` | Postgres C API library | +| `postgresql` | Installs the command line console (`psql`) as well as a PostgreSQL server locally | ## Arch @@ -60,11 +60,11 @@ pacman -Syu --needed --noconfirm \ | Dependency | Required For | | --------------- | --------------- | -| cmake | Manages the build process in an operating system and in a compiler-independent manner | -| git | Version control system | -| gcc | Compiler tools required to build various Fuel indexer crates | -| llvm11 | Compiler infrastructure for building Fuel indexer crate dependencies | -| llvm11-libs | Compiler infrastructure libs for building Fuel indexer crate dependencies | -| pkgconf | System for configuring build dependency information | -| postgresql-libs | Provides the essential shared libraries for any PostgreSQL client program or interface | -| clang | Compiler required to build various Fuel indexer crates Unix-like OSes | +| `cmake` | Manages the build process in an operating system and in a compiler-independent manner | +| `git` | Version control system | +| `gcc` | Compiler tools required to build various Fuel indexer crates | +| `llvm11` | Compiler infrastructure for building Fuel indexer crate dependencies | +| `llvm11-libs` | Compiler infrastructure libraries for building Fuel indexer crate dependencies | +| `pkgconf` | System for configuring build dependency information | +| `postgresql-libs` | Provides the essential shared libraries for any PostgreSQL client program or interface | +| `clang` | Compiler required to build various Fuel indexer crates Unix-like OSes | diff --git a/docs/src/forc-postgres/index.md b/docs/src/forc-postgres/index.md index b346b2439..0bea15fa0 100644 --- a/docs/src/forc-postgres/index.md +++ b/docs/src/forc-postgres/index.md @@ -1,4 +1,4 @@ -# forc index postgres +# `forc index postgres` `forc index postgres` is provided as a way to simplify the setup and management of an embedded Postgres database. After you have installed `fuelup`, you can run the `forc index postgres help` command in your terminal to view the available commands. diff --git a/docs/src/getting-started/dependencies.md b/docs/src/getting-started/dependencies.md index b89823e33..98d0f160f 100644 --- a/docs/src/getting-started/dependencies.md +++ b/docs/src/getting-started/dependencies.md @@ -7,13 +7,13 @@ To run the Fuel indexer, you'll need to install a few dependencies on your system: 1. The [Fuel toolchain](https://docs.fuel.network/guides/installation) -2. A [PostgresQL](#postgresql) server backend +2. A [PostgreSQL](#postgresql) server backend 3. The [`wasm32-unknown-unknown`](#web-assembly-wasm) `rustup` target -4. [`wasm-snip`](#web-assembly-wasm), a utility for stripping symbols from WebAssemly binaries. +4. [`wasm-snip`](#web-assembly-wasm), a utility for stripping symbols from WebAssembly binaries. > 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. +> 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 PostgreSQL server and a Fuel indexer service. ## The `Fuel` toolchain @@ -21,11 +21,11 @@ Please visit the Fuel [installation guide](https://docs.fuel.network/guides/inst ## PostgreSQL -The Fuel indexer requires the use of a database. We currently support [PostgresSQL](https://www.postgresql.org/docs/). +The Fuel indexer requires the use of a database. We currently support [PostgreSQL](https://www.postgresql.org/docs/). -> IMPORTANT: Fuel Indexer users on most platforms don't need to explicitly install PostgresQL software via a package manager. When starting the indexer service via `forc index start` simply pass the `--embedded-database` flag in order to have the indexer service download and start an embedded PostgresQL instance via [`forc index postgres`](../forc-postgres/index.md). +> IMPORTANT: Fuel Indexer users on most platforms don't need to explicitly install PostgreSQL software via a package manager. When starting the indexer service via `forc index start` simply pass the `--embedded-database` flag in order to have the indexer service download and start an embedded PostgreSQL instance via [`forc index postgres`](../forc-postgres/index.md). > -> However note that this `--embedded-database` functionality can be a bit brittle or flaky on some platforms, so alternative methods of installing or using PostgresQL are briefly mentioned below. +> However note that this `--embedded-database` functionality can be a bit brittle or flaky on some platforms, so alternative methods of installing or using PostgreSQL are briefly mentioned below. ### macOS @@ -62,7 +62,7 @@ rustup target add wasm32-unknown-unknown > - `AR=/opt/homebrew/opt/llvm/bin/llvm-ar` > - `CC=/opt/homebrew/opt/llvm/bin/clang` > -> Addtionally, on some systems you need to explictly link clang to llvm. +> Additionally, on some systems you need to explicitly link `clang` to `llvm`. > > - `LIBCLANG_PATH="/opt/homebrew/opt/llvm/lib"` > - `LDFLAGS="-L/opt/homebrew/opt/llvm/lib"` diff --git a/docs/src/getting-started/how-it-compares.md b/docs/src/getting-started/how-it-compares.md index 41b0caaaf..f747cb404 100644 --- a/docs/src/getting-started/how-it-compares.md +++ b/docs/src/getting-started/how-it-compares.md @@ -16,7 +16,7 @@ Unlike other indexing services, users can use the forc index CLI tool to create, ### What you can index -The Fuel indexer is tailored for compatibility with the FuelVM. This means that instead of being limited to the primitives of the Etherem virtual machine (EVM), users of the Fuel indexer gain access to a much richer set of indexable abstractions provided by the FuelVM (e.g. predicates, transaction receipts, etc). +The Fuel indexer is tailored for compatibility with the FuelVM. This means that instead of being limited to the primitives of the Ethereum virtual machine (EVM), users of the Fuel indexer gain access to a much richer set of indexable abstractions provided by the FuelVM (e.g. predicates, transaction receipts, etc). Legend: @@ -29,7 +29,7 @@ Legend: | Hosted Indexers | 🟩 | 🟩 | | | WASM Execution | 🟩 | 🟩 | | | Handlers | 🟩 | 🟩 | see [Indexing Fuel Types](../indexing-fuel-types/index.md) and [Indexing Custom Types](../indexing-custom-types/index.md)| -| Updateable Schemas | 🟩 | 🟩 | | +| Updatable Schemas | 🟩 | 🟩 | | | API Authentication | 🟩 | 🟩 | | | Starting Block Configuration | 🟩 | 🟩 | | | Native Unit Testing Framework | 🟩 | 🟥 | Users are able to use `cargo test` | diff --git a/docs/src/getting-started/indexer-service-infrastructure.md b/docs/src/getting-started/indexer-service-infrastructure.md index 2775f9cc2..b38806c48 100644 --- a/docs/src/getting-started/indexer-service-infrastructure.md +++ b/docs/src/getting-started/indexer-service-infrastructure.md @@ -12,7 +12,7 @@ A Fuel indexer service instance requires just three components: - 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 **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. diff --git a/docs/src/getting-started/quickstart.md b/docs/src/getting-started/quickstart.md index 475c6ea7f..7f63c8e77 100644 --- a/docs/src/getting-started/quickstart.md +++ b/docs/src/getting-started/quickstart.md @@ -102,7 +102,7 @@ To quickly setup and bootstrap the PostgreSQL database that we'll need, we'll us We can quickly create a bootstrapped database and start the Fuel indexer service by running the following command: -> IMPORTANT: Below we're specifying our Postgres hostname as `--postgres-host postgresql`, but you might need to change this based on your own Postgres instance details (see `forc index start --help` for more details). +> IMPORTANT: Below we're specifying our Postgres `hostname` as `--postgres-host postgresql`, but you might need to change this based on your own Postgres instance details (see `forc index start --help` for more details). > > Additionally, you can try using the `--embedded-database` flag in order to quickly use an embedded instance of Postgres, but this flag can be flaky, and its ease of use often depends on what platform you're using. > @@ -240,7 +240,7 @@ Indexers: > > A _deployment_ within the context of Fuel's indexer is a series of steps taken to get your indexer project running in the wild. > -> This series of steps involves compiling your indexer project to a wasm32-unknown-unknown target and uploading the indexer to a running Fuel indexer service. The service will then register an executor and build database tables for this indexer. Once this series of steps has completed, your indexer is considered to be ["deployed"](https://en.wikipedia.org/wiki/Software_deployment). +> This series of steps involves compiling your indexer project to a `wasm32-unknown-unknown` target and uploading the indexer to a running Fuel indexer service. The service will then register an executor and build database tables for this indexer. Once this series of steps has completed, your indexer is considered to be ["deployed"](https://en.wikipedia.org/wiki/Software_deployment). > > Users will often find that they're simply deploying their indexers to a Fuel indexer service running on their local machine; this is just one valid use-case described in [our infrastructure docs](./indexer-service-infrastructure.md). Keep in mind that the intended use of a Fuel indexer service is as a standalone remote service that may run many different indexers at any given time. diff --git a/docs/src/indexing-fuel-types/receipts.md b/docs/src/indexing-fuel-types/receipts.md index a000df9dd..408d30502 100644 --- a/docs/src/indexing-fuel-types/receipts.md +++ b/docs/src/indexing-fuel-types/receipts.md @@ -4,21 +4,21 @@ Every transaction in the Fuel network contains a list of receipts with informati There are several types of receipts that can be attached to a transaction and indexed. You can learn more about each of these in the sections below. -- [**Burn**](#burn) -- [**Call**](#call) -- [**Log**](#log) -- [**LogData**](#logdata) -- [**MessageOut**](#messageout) -- [**Mint**](#mint) -- [**Panic**](#panic) -- [**Return**](#return) -- [**ReturnData**](#returndata) -- [**Revert**](#revert) -- [**ScriptResult**](#scriptresult) -- [**Transfer**](#transfer) -- [**TransferOut**](#transferout) - -## Burn +- [**`Burn`**](#burn) +- [**`Call`**](#call) +- [**`Log`**](#log) +- [**`LogData`**](#logdata) +- [**`MessageOut`**](#messageout) +- [**`Mint`**](#mint) +- [**`Panic`**](#panic) +- [**`Return`**](#return) +- [**`ReturnData`**](#returndata) +- [**`Revert`**](#revert) +- [**`ScriptResult`**](#scriptresult) +- [**`Transfer`**](#transfer) +- [**`TransferOut`**](#transferout) + +## `Burn` A `Burn` receipt is generated whenever an asset is burned in a Sway contract. [Read more about `Burn` in the Fuel protocol ABI spec](https://docs.fuel.network/docs/specs/abi/receipts/#burn-receipt). @@ -51,7 +51,7 @@ mod indexer_mod { } ``` -## Call +## `Call` A `Call` receipt is generated whenever a function is called in a Sway contract. The `fn_name` field contains the name of the called function from the aforementioned contract. [Read more about `Call` in the Fuel protocol ABI spec](https://docs.fuel.network/docs/specs/abi/receipts/#call-receipt). @@ -89,7 +89,7 @@ mod indexer_mod { } ``` -## Log +## `Log` A `Log` receipt is generated when calling `log()` on a non-reference types in a Sway contracts - specifically `bool`, `u8`, `u16`, `u32`, and `u64`. The `ra` field includes the value being logged while `rb` may include a non-zero value representing a unique ID for the `log` instance. [Read more about `Log` in the Fuel protocol ABI spec](https://docs.fuel.network/docs/specs/abi/receipts/#log-receipt). @@ -124,7 +124,7 @@ mod indexer_mod { } ``` -## LogData +## `LogData` A `LogData` receipt is generated when calling `log()` in a Sway contract on a reference type; this includes all types _except_ non-reference types. The `data` field will include the logged value as a hexadecimal. The `rb` field will contain a unique ID that can be used to look up the logged data type. [Read more about `LogData` in the Fuel protocol ABI spec](https://docs.fuel.network/docs/specs/abi/receipts/#logdata-receipt). > @@ -154,7 +154,7 @@ mod indexer_mod { } ``` -## MessageOut +## `MessageOut` A `MessageOut` receipt is generated as a result of the `send_typed_message()` Sway method in which a message is sent to a recipient address along with a certain amount of coins. The `data` field supports data of an arbitrary type `T` and will be decoded by the indexer upon receipt. [Read more about `MessageOut` in the Fuel protocol ABI spec](https://docs.fuel.network/docs/specs/abi/receipts/#messageout-receipt). @@ -184,7 +184,7 @@ mod indexer_mod { } ``` -## Mint +## `Mint` A `Mint` receipt is generated whenever an asset is burned in a Sway contract. [Read more about `Mint` in the Fuel protocol ABI spec](https://docs.fuel.network/docs/specs/abi/receipts/#mint-receipt). @@ -221,7 +221,7 @@ mod indexer_mod { } ``` -## Panic +## `Panic` A `Panic` receipt is produced when a Sway smart contract call fails for a reason that doesn't produce a revert. The reason field records the reason for the panic, which is represented by a number between 0 and 255. You can find the mapping between the values and their meanings here in the FuelVM [source code](https://github.com/FuelLabs/fuel-vm/blob/master/fuel-asm/src/panic_reason.rs). [Read more about `Panic` in the Fuel protocol spec](https://docs.fuel.network/docs/specs/abi/receipts/#mint-receipt). @@ -255,7 +255,7 @@ mod indexer_mod { } ``` -## Return +## `Return` A `Return` receipt is generated when returning a non-reference type in a Sway contract, specifically `bool`, `u8`, `u16`, `u32`, and `u64`. The `val` field includes the value being returned. [Read more about `Return` in the Fuel protocol spec](https://docs.fuel.network/docs/specs/abi/receipts/#return-receipt). @@ -293,7 +293,7 @@ mod indexer_mod { } ``` -## ReturnData +## `ReturnData` A `ReturnData` receipt is generated when returning a reference type in a Sway contract; this includes all types _except_ non-reference types. The `data` field will include the returned value as a hexadecimal. [Read more about `ReturnData` in the Fuel protocol ABI spec](https://docs.fuel.network/docs/specs/abi/receipts/#returndata-receipt). @@ -319,7 +319,7 @@ mod indexer_mod { } ``` -## Revert +## `Revert` A `Revert` receipt is produced when a Sway smart contract function call fails. The table below lists possible reasons for the failure and their values. The `error_val` field records these values, enabling your indexer to identify the specific cause of the reversion. [Read more about `Revert` in the Fuel protocol spec](https://docs.fuel.network/docs/specs/abi/receipts/#revert-receipt). @@ -333,11 +333,11 @@ pub struct Revert { | Reason | Value | |-----------------------|-------| -| FailedRequire | 0 | -| FailedTransferToAddress | 1 | -| FailedSendMessage | 2 | -| FailedAssertEq | 3 | -| FailedAssert | 4 | +| `FailedRequire` | 0 | +| `FailedTransferToAddress` | 1 | +| `FailedSendMessage` | 2 | +| `FailedAssertEq` | 3 | +| `FailedAssert` | 4 | ```rust, ignore extern crate alloc; @@ -361,7 +361,7 @@ mod indexer_mod { } ``` -## ScriptResult +## `ScriptResult` A `ScriptResult` receipt is generated when a contract call resolves; that is, it's generated as a result of the `RET`, `RETD`, and `RVRT` instructions. The `result` field will contain a `0` for success, and a non-zero value otherwise. [Read more about `ScriptResult` in the Fuel protocol spec](https://docs.fuel.network/docs/specs/abi/receipts/#scriptresult-receipt). @@ -394,7 +394,7 @@ mod indexer_mod { } ``` -## Transfer +## `Transfer` A `Transfer` receipt is generated when coins are transferred to a contract as part of a Sway contract. The `asset_id` field contains the asset ID of the transferred coins, as the FuelVM has built-in support for working with multiple assets. The `pc` and `is` fields aren't currently used for anything, but are included for completeness. [Read more about `Transfer` in the Fuel protocol spec](https://docs.fuel.network/docs/specs/abi/receipts/#transfer-receipt). @@ -432,7 +432,7 @@ mod indexer_mod { } ``` -## TransferOut +## `TransferOut` A `TransferOut` receipt is generated when coins are transferred to an address rather than a contract. Every other field of the receipt works the same way as it does in the `Transfer` receipt. [Read more about `TransferOut` in the Fuel protocol spec](https://docs.fuel.network/docs/specs/abi/receipts/#transferout-receipt). diff --git a/docs/src/project-components/index.md b/docs/src/project-components/index.md index 224a4b583..6f51adf21 100644 --- a/docs/src/project-components/index.md +++ b/docs/src/project-components/index.md @@ -13,7 +13,7 @@ We'll describe these three different use cases below. ### As tooling to interact with indexers -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. +The Fuel indexer provides functionality to make it easy to build and compile arbitrary 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 diff --git a/docs/src/project-components/manifest.md b/docs/src/project-components/manifest.md index 96ed9c883..0d0025c67 100644 --- a/docs/src/project-components/manifest.md +++ b/docs/src/project-components/manifest.md @@ -48,7 +48,7 @@ _Optional._ The `contract_id` specifies the particular contract to which you would like an indexer to subscribe. Setting this field to an empty string will index events from any contract that is currently executing on the network. This field accepts either a single string, or a list of strings. The indexer will index events from all IDs if a list is passed. > Important: Contract IDs are unique to the content of a contract. If you are subscribing to a certain contract and then the contract itself is changed or updated, you will need to change the `contract_id` field of the manifest to the new ID. -> Note: This parameter supports both Bech32 contract IDs and non-Bech32 contract IDs +> Note: This parameter supports both `Bech32` contract IDs and non-`Bech32` contract IDs ## `graphql_schema` diff --git a/docs/src/querying/full-example.md b/docs/src/querying/full-example.md index d5facc066..5409b5e05 100644 --- a/docs/src/querying/full-example.md +++ b/docs/src/querying/full-example.md @@ -37,7 +37,7 @@ query { The Fuel indexer's GraphQL API allows you to add filters on multiple entity fields and even nested entities! In the query above, we're asking for the two most recent transactions with a value greater than zero. Also, we're applying two filters to the nested `block` entity by using the `and` operator in order to help us narrow down the set of results. -The response returns the results in the expected format and includes additional information that informs us about how many total results satisy the criteria. +The response returns the results in the expected format and includes additional information that informs us about how many total results satisfy the criteria. ```json { diff --git a/docs/src/querying/playground.md b/docs/src/querying/playground.md index ec2ed5f42..0e245f1fc 100644 --- a/docs/src/querying/playground.md +++ b/docs/src/querying/playground.md @@ -2,11 +2,11 @@ The Fuel indexer's GraphQL Playground is an interactive, in-browser GraphQL IDE that allows developers to easily explore and test the indexer's GraphQL API server. You can read more about the GraphQL playground in general [here](https://github.com/graphql/graphql-playground). -Every public indexer can access the GraphQL playground of the Fuel indexer node on which the given indexer runs, so users and devs can get to querying their data right away. +Every public indexer can access the GraphQL playground of the Fuel indexer node on which the given indexer runs, so users and developers can get to querying their data right away. ## Usage -To use the GraphQL playground to explor your indices, simply [start your indexer service](../getting-started/indexer-service-infrastructure.md) - then open the following URL in your browser - where `namespace` and `identifier` correspond to the namespace and identifier of the index that you'd like to explore. +To use the GraphQL playground to explore your indices, [start your indexer service](../getting-started/indexer-service-infrastructure.md), then open the following URL in your browser - where `namespace` and `identifier` correspond to the namespace and identifier of the index that you'd like to explore. ```bash http://localhost:29987/api/playground/:namespace/:identifier diff --git a/docs/src/querying/search-and-filtering.md b/docs/src/querying/search-and-filtering.md index 7ff448fd9..2ee742db1 100644 --- a/docs/src/querying/search-and-filtering.md +++ b/docs/src/querying/search-and-filtering.md @@ -9,7 +9,7 @@ The Fuel indexer currently supports the following search and filtering operation Additionally, you can combine these operations using the `and` or `or` keywords, and invert operations by using the `not` keyword. -> You should practice sensible database design when filtering records. Apply database indicies to the underlying columns in order to make search operations more efficient; however, be advised that an overuse of database indicies will lead to degraded performance. +> You should practice sensible database design when filtering records. Apply database indices to the underlying columns in order to make search operations more efficient; however, be advised that an overuse of database indices will lead to degraded performance. ## ID Selection @@ -43,7 +43,7 @@ query { ## Excluding Null Values -You can store null values in your records if the corresponding entity fields are configured to allow for it. You can exclude records that contain null values in a particular column or set of coulmns by using the `has` operator inside of a `filter` object. +You can store null values in your records if the corresponding entity fields are configured to allow for it. You can exclude records that contain null values in a particular column or set of columns by using the `has` operator inside of a `filter` object. ```graphql query { diff --git a/docs/src/storing-records/index.md b/docs/src/storing-records/index.md index 2f06a2fb0..cfd18ddf6 100644 --- a/docs/src/storing-records/index.md +++ b/docs/src/storing-records/index.md @@ -10,27 +10,27 @@ Below is a mapping of GraphQL schema types to their Sway and database equivalent | GraphQL Scalar | Sway Type | Postgres Type | --- | --- | --- -| Address | `b256` | varchar(64) | -| AssetId | `u8[32]` | varchar(64) | -| Boolean | `bool` | boolean | -| Bytes | `str[]` | varchar(10485760) | -| Bytes32 | `str[32]` | varchar(64) | -| Bytes4 | `str[4]` | varchar(8) | -| Bytes64 | `str[64]` | varchar(128) | -| Bytes8 | `str[8]` | varchar(16) | -| ContractId | `b256` | varchar(64) | -| I128 | | numeric(39,0) | -| I32 | `u32` | integer | -| I64 | `u64` | bigint | -| I8 | `u8` | integer | -| ID | | varchar(64) primary key | -| Json | `str[]` | json | -| U128 | | numeric(39, 0) | -| U32 | `u32` | integer | -| U64 | `u64` | numeric(20, 0) | -| U8 | `u8` | integer | -| UID | | varchar(64) | -| String | `str[]` | varchar(255) | +| `Address` | `b256` | `varchar(64)` | +| `AssetId` | `u8[32]` | `varchar(64)` | +| `Boolean` | `bool` | `boolean` | +| `Bytes` | `str[]` | `varchar(10485760)` | +| `Bytes32` | `str[32]` | `varchar(64)` | +| `Bytes4` | `str[4]` | `varchar(8)` | +| `Bytes64` | `str[64]` | `varchar(128)` | +| `Bytes8` | `str[8]` | `varchar(16)` | +| `ContractId` | `b256` | `varchar(64)` | +| `I128` | | `numeric(39,0)` | +| `I32` | `u32` | `integer` | +| `I64` | `u64` | `bigint` | +| `I8` | `u8` | `integer` | +| `ID` | | `varchar(64) primary key` | +| `Json` | `str[]` | `json` | +| `U128` | | `numeric(39, 0)` | +| `U32` | `u32` | `integer` | +| `U64` | `u64` | `numeric(20, 0)` | +| `U8` | `u8` | `integer` | +| `UID` | | `varchar(64)` | +| `String` | `str[]` | `varchar(255)` | ## Example