Skip to content

Commit

Permalink
Dz/fuel contract import 5 (#43)
Browse files Browse the repository at this point in the history
* Prompt to get a single fuel contract

* A semi-working contract import for Fuel

* Fix contract import templates for Fuel

* Vendor Fuel abi

* Fix evm indexer

* Fix rescript_types tests

* Human readable names for Fuel logs

* Support setting only one log_id per event

* Events selection

* Add shared_prompts mod

* Prompt multiple contracts for Fuel

* Refactor prompt_to_continue_adding to reuse for multiple ecosystems

* Fix event_name index

* Add first non-etherscan contract verification

* Remove unused block

* Remove Addresses import from Test file

---------

Co-authored-by: Jason <[email protected]>
  • Loading branch information
DZakh and JasoonS authored Jun 24, 2024
1 parent f271f7c commit e960fe9
Show file tree
Hide file tree
Showing 26 changed files with 2,132 additions and 737 deletions.
35 changes: 31 additions & 4 deletions codegenerator/Cargo.lock

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

2 changes: 2 additions & 0 deletions codegenerator/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ sqlx = { version = "0.7.2", features = [
"postgres",
] }
thiserror = "1.0.50"
fuel-abi-types = "0.5.2"

[dev-dependencies]
tempdir = "0.3"
paste = "1.0.12"
Expand Down
34 changes: 34 additions & 0 deletions codegenerator/cli/CommandLineHelp.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ This document contains the help content for the `envio` command-line program.
* [`envio init contract-import local`](#envio-init-contract-import-local)
* [`envio init fuel`](#envio-init-fuel)
* [`envio init fuel template`](#envio-init-fuel-template)
* [`envio init fuel contract-import`](#envio-init-fuel-contract-import)
* [`envio init fuel contract-import local`](#envio-init-fuel-contract-import-local)
* [`envio dev`](#envio-dev)
* [`envio stop`](#envio-stop)
* [`envio codegen`](#envio-codegen)
Expand Down Expand Up @@ -145,6 +147,7 @@ Initialization option for creating Fuel indexer
###### **Subcommands:**

* `template` — Initialize Fuel indexer from an example template
* `contract-import` — Initialize Fuel indexer by importing config from a contract for a given chain



Expand All @@ -163,6 +166,37 @@ Initialize Fuel indexer from an example template



## `envio init fuel contract-import`

Initialize Fuel indexer by importing config from a contract for a given chain

**Usage:** `envio init fuel contract-import [OPTIONS] [COMMAND]`

###### **Subcommands:**

* `local` — Initialize from a local json ABI file

###### **Options:**

* `-c`, `--contract-address <CONTRACT_ADDRESS>` — Contract address to generate the config from
* `--single-contract` — If selected, prompt will not ask for additional contracts/addresses/networks
* `--all-events` — If selected, prompt will not ask to confirm selection of events on a contract



## `envio init fuel contract-import local`

Initialize from a local json ABI file

**Usage:** `envio init fuel contract-import local [OPTIONS]`

###### **Options:**

* `-a`, `--abi-file <ABI_FILE>` — The path to a json abi file
* `--contract-name <CONTRACT_NAME>` — The name of the contract



## `envio dev`

Development commands for starting, stopping, and restarting the indexer with automatic codegen for any changed files
Expand Down
6 changes: 3 additions & 3 deletions codegenerator/cli/src/cli_args/clap_definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ pub mod fuel {
pub enum InitFlow {
///Initialize Fuel indexer from an example template
Template(TemplateArgs),
// ///Initialize Fuel indexer by importing config from a contract for a given chain
// #[strum(serialize = "Contract Import")]
// ContractImport(ContractImportArgs),
///Initialize Fuel indexer by importing config from a contract for a given chain
#[strum(serialize = "Contract Import")]
ContractImport(ContractImportArgs),
}

#[derive(Args, Debug, Default, Clone)]
Expand Down
Loading

0 comments on commit e960fe9

Please sign in to comment.