Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: update fuel explorer #946

Merged
merged 8 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Use the new resolver to prevent dev-deps and build-deps from enabling debugging or test features in production.
resolver = "2"
members = [
"examples/block-explorer/explorer-indexer",
"examples/fuel-explorer/fuel-explorer",
"examples/hello-world-native/hello-indexer-native",
"examples/hello-world/hello-indexer",
Expand Down
1 change: 0 additions & 1 deletion docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# Examples

- [Hello World](./examples/hello-world.md)
- [Block Explorer](./examples/block-explorer.md)

# Reference Guide

Expand Down
49 changes: 0 additions & 49 deletions docs/src/examples/block-explorer.md

This file was deleted.

2 changes: 0 additions & 2 deletions docs/src/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@

- [Hello World](./hello-world.md)
- A "Hello World" type of program for the Fuel Indexer service.
- [Block Explorer](./block-explorer.md)
- An extremely basic block explorer implementation that shows how blocks, transactions, contracts, and accounts can be persisted into the database.
1 change: 0 additions & 1 deletion docs/src/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ After you've installed all required dependencies. Feel free to checkout a few ex

- [Examples](./../examples/index.md)
- [Hello World](./../examples/hello-world.md)
- [Block Explorer](./../examples/block-explorer.md)

## Architecture

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ query {

The `entity` field corresponds to the name of an entity defined in your [schema](./schema.md) and the sub-fields are the fields defined on that entity type; entities and fields are stored in the database using the names defined in the schema, so make sure that your query uses those same names as well.

Let's refer back to the [block explorer](../../../examples/block-explorer.md) example for an illustration. After the block data has been indexed, we can retrieve information about the blocks by querying for information on the indexer's playground; you can get to the playground by starting the block explorer example using the instructions on the page and navigating to `http://localhost:29987/api/graph/fuel_examples/explorer_indexer`.

```txt
query {
block {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ A paginated query can be made using three keywords:
- `first` - limit on number of results (required)
- `offset` - the amount of records to skip before returning results (optional)

Let's use the [block explorer](../../../examples/block-explorer.md) example to illustrate how to use pagination.

```graphql
query {
blocks: block(order: { height: asc }, first: 5) {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference-guide/components/graphql/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type SecondThing {
The types you see above (e.g., `ID`, `UInt8`, etc) are Fuel abstractions that were created to more seamlessly integrate with the Fuel VM and are not native to GraphQL. A deeper explanation on these
types can be found in [the Types section](../../data-types/types.md).

> Important: It is up to developers to manage their own unique IDs for each type, meaning that a data structure's `ID` field needs to be manually generated prior to saving it to the database. This generation can be as simple or complex as you want in order to fit your particular situation; the only requirement is that the developer implement their own custom generation. Examples can be found in the [Block Explorer](../../../examples/block-explorer.md) and [Hello World](../../../examples/hello-world.md) sections.
> Important: It is up to developers to manage their own unique IDs for each type, meaning that a data structure's `ID` field needs to be manually generated prior to saving it to the database. This generation can be as simple or complex as you want in order to fit your particular situation; the only requirement is that the developer implement their own custom generation.

## Required and Optional Fields

Expand Down
4 changes: 2 additions & 2 deletions docs/src/reference-guide/indexing/receipts/call.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ pub struct Call {
- 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://github.com/FuelLabs/fuel-specs/blob/master/src/protocol/abi/receipts.md#return-receipt)

You can handle functions that produce a `Call` receipt type by adding a parameter with the type `abi::Call`.
You can handle functions that produce a `Call` receipt type by adding a parameter with the type `Call`.

```rust, ignore
fn handle_call(call: abi::Call) {
fn handle_call(call: Call) {
// handle the emitted Call receipt
}
```
4 changes: 2 additions & 2 deletions docs/src/reference-guide/indexing/receipts/log.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ pub struct Log {
- 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://github.com/FuelLabs/fuel-specs/blob/master/src/protocol/abi/receipts.md#log-receipt)

You can handle functions that produce a `Log` receipt type by adding a parameter with the type `abi::Log`.
You can handle functions that produce a `Log` receipt type by adding a parameter with the type `Log`.

```rust, ignore
fn handle_log(log: abi::Log) {
fn handle_log(log: Log) {
// handle the emitted Log receipt
}
```
4 changes: 2 additions & 2 deletions docs/src/reference-guide/indexing/receipts/messageout.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ pub struct MessageOut {
- 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://github.com/FuelLabs/fuel-specs/blob/master/src/protocol/abi/receipts.md#messageout-receipt)

You can handle functions that produce a `MessageOut` receipt type by adding a parameter with the type `abi::MessageOut`.
You can handle functions that produce a `MessageOut` receipt type by adding a parameter with the type `MessageOut`.

```rust, ignore
fn handle_message_out(message_out: abi::MessageOut) {
fn handle_message_out(message_out: MessageOut) {
// handle the emitted MessageOut receipt
}
```
4 changes: 2 additions & 2 deletions docs/src/reference-guide/indexing/receipts/panic.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ pub struct 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://github.com/FuelLabs/fuel-specs/blob/master/src/protocol/abi/receipts.md#panic-receipt)
- You can handle functions that could produce a `Panic` receipt by adding a parameter with the type `abi::Panic`.
- You can handle functions that could produce a `Panic` receipt by adding a parameter with the type `Panic`.

```rust, ignore
fn handle_panic(panic: abi::Panic) {
fn handle_panic(panic: Panic) {
// handle the emitted Panic receipt
}
```
Expand Down
4 changes: 2 additions & 2 deletions docs/src/reference-guide/indexing/receipts/return.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ pub struct Return {
- The `val` field includes the value being returned.
- [Read more about `Log` in the Fuel protocol ABI spec](https://github.com/FuelLabs/fuel-specs/blob/master/src/protocol/abi/receipts.md#return-receipt)

You can handle functions that produce a `Return` receipt type by adding a parameter with the type `abi::Return`.
You can handle functions that produce a `Return` receipt type by adding a parameter with the type `Return`.

```rust, ignore
fn handle_return(data: abi::Return) {
fn handle_return(data: Return) {
// handle the emitted Return receipt
}
```
4 changes: 2 additions & 2 deletions docs/src/reference-guide/indexing/receipts/revert.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ pub struct Revert {

- [Read more about `Revert` in the Fuel Protocol spec](https://github.com/FuelLabs/fuel-specs/blob/master/src/protocol/abi/receipts.md#revert-receipt)

You can handle functions that could produce a `Revert` receipt by adding a parameter with the type `abi::Revert`.
You can handle functions that could produce a `Revert` receipt by adding a parameter with the type `Revert`.

```rust, ignore
fn handle_revert(revert: abi::Revert) {
fn handle_revert(revert: Revert) {
// handle the emitted Revert receipt
}
```
4 changes: 2 additions & 2 deletions docs/src/reference-guide/indexing/receipts/scriptresult.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ pub struct ScriptResult {
- The `result` field will contain a `0` for success, and a non-zero value otherwise.
- [Read more about `ScriptResult` in the Fuel protocol ABI spec](https://github.com/FuelLabs/fuel-specs/blob/master/src/protocol/abi/receipts.md#scriptresult-receipt)

You can handle functions that produce a `ScriptResult` receipt type by adding a parameter with the type `abi::ScriptResult`.
You can handle functions that produce a `ScriptResult` receipt type by adding a parameter with the type `ScriptResult`.

```rust, ignore
fn handle_script_result(script_result: abi::ScriptResult) {
fn handle_script_result(script_result: ScriptResult) {
// handle the emitted ScriptResult receipt
}
```
4 changes: 2 additions & 2 deletions docs/src/reference-guide/indexing/receipts/transfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ pub struct Transfer {
- The `pc` and `is` fields aren't currently used for anything, but are included for completeness.
- [Read more about `Transfer` in the Fuel protocol ABI spec](https://github.com/FuelLabs/fuel-specs/blob/master/src/protocol/abi/receipts.md#transfer-receipt)

You can handle functions that produce a `Transfer` receipt type by adding a parameter with the type `abi::Transfer`.
You can handle functions that produce a `Transfer` receipt type by adding a parameter with the type `Transfer`.

```rust, ignore
fn handle_transfer(transfer: abi::Transfer) {
fn handle_transfer(transfer: Transfer) {
// handle the emitted Transfer receipt
}
```
4 changes: 2 additions & 2 deletions docs/src/reference-guide/indexing/receipts/transferout.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ pub struct TransferOut {
- 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 ABI spec](https://github.com/FuelLabs/fuel-specs/blob/master/src/protocol/abi/receipts.md#transferout-receipt)

You can handle functions that produce a `TransferOut` receipt type by adding a parameter with the type `abi::TransferOut`.
You can handle functions that produce a `TransferOut` receipt type by adding a parameter with the type `TransferOut`.

```rust, ignore
fn handle_transferout(transfer_out: abi::TransferOut) {
fn handle_transferout(transfer_out: TransferOut) {
// handle the emitted TransferOut receipt
}
```
37 changes: 0 additions & 37 deletions examples/block-explorer/README.md

This file was deleted.

Empty file.
27 changes: 0 additions & 27 deletions examples/block-explorer/docker-compose.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions examples/block-explorer/explorer-indexer/.cargo/config

This file was deleted.

17 changes: 0 additions & 17 deletions examples/block-explorer/explorer-indexer/Cargo.toml

This file was deleted.

This file was deleted.

Loading