From 367b2f0cd7dfb1d1b9c4593abf9b93beac2556ee Mon Sep 17 00:00:00 2001 From: sam Date: Thu, 6 Mar 2025 20:50:18 +0800 Subject: [PATCH] add --- .github/workflows/dbt_run_scheduled_main.yml | 12 ++++--- dbt_project.yml | 35 ++++++++++++-------- models/sources.yml | 10 ++++-- packages.yml | 2 +- 4 files changed, 38 insertions(+), 21 deletions(-) diff --git a/.github/workflows/dbt_run_scheduled_main.yml b/.github/workflows/dbt_run_scheduled_main.yml index 5f8cf4c..cd5223a 100644 --- a/.github/workflows/dbt_run_scheduled_main.yml +++ b/.github/workflows/dbt_run_scheduled_main.yml @@ -39,11 +39,15 @@ jobs: run: | pip install -r requirements.txt dbt deps - + - name: Run Main Models run: | - dbt run -m "fsc_evm,tag:silver_core" "fsc_evm,tag:gold_core" "fsc_evm,tag:silver_confirm_blocks" "fsc_evm,tag:bronze_abis" "fsc_evm,tag:silver_labels" "fsc_evm,tag:gold_labels" "fsc_evm,tag:nft_core" "fsc_evm,tag:bronze_core" --exclude "fsc_evm,tag:ez_prices_model" - + dbt run -m "fsc_evm,tag:silver_core" "fsc_evm,tag:gold_core" "fsc_evm,tag:silver_confirm_blocks" "fsc_evm,tag:silver_labels" "fsc_evm,tag:gold_labels" "fsc_evm,tag:nft_core" "fsc_evm,tag:bronze_core" --exclude "fsc_evm,tag:ez_prices_model" + - name: Send new logs for decoding run: | - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "fsc_evm,tag:bronze_decoded_logs" "fsc_evm,tag:streamline_decoded_logs_realtime" "fsc_evm,tag:streamline_decoded_logs_complete" \ No newline at end of file + dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "fsc_evm,tag:bronze_decoded_logs" "fsc_evm,tag:streamline_decoded_logs_realtime" "fsc_evm,tag:streamline_decoded_logs_complete" + + - name: Get new contract ABIs + run: | + dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "fsc_evm,tag:bronze_abis" "fsc_evm,tag:streamline_abis_realtime" "fsc_evm,tag:streamline_abis_complete" diff --git a/dbt_project.yml b/dbt_project.yml index 75563e2..b60887f 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -17,7 +17,8 @@ test-paths: ["tests"] seed-paths: ["data"] macro-paths: ["macros"] snapshot-paths: ["snapshots"] -docs-paths: ["dbt_packages/fsc_evm/doc_descriptions", "models/doc_descriptions", "models"] +docs-paths: + ["dbt_packages/fsc_evm/doc_descriptions", "models/doc_descriptions", "models"] target-path: "target" # directory which will store compiled SQL files clean-targets: # directories to be removed by `dbt clean` @@ -36,7 +37,7 @@ on-run-start: - "{{ fsc_evm.create_udfs() }}" on-run-end: - - '{{ fsc_evm.apply_meta_as_tags(results) }}' + - "{{ fsc_evm.apply_meta_as_tags(results) }}" dispatch: - macro_namespace: dbt @@ -46,7 +47,7 @@ dispatch: - dbt query-comment: - comment: '{{ dbt_snowflake_query_tags.get_query_comment(node) }}' + comment: "{{ dbt_snowflake_query_tags.get_query_comment(node) }}" append: true # Snowflake removes prefixed comments. # Configuring models @@ -101,7 +102,7 @@ vars: HEAL_MODELS: [] START_GHA_TASKS: False -#### STREAMLINE 2.0 BEGIN #### + #### STREAMLINE 2.0 BEGIN #### API_INTEGRATION: '{{ var("config")[target.name]["API_INTEGRATION"] if var("config")[target.name] else var("config")["dev"]["API_INTEGRATION"] }}' EXTERNAL_FUNCTION_URI: '{{ var("config")[target.name]["EXTERNAL_FUNCTION_URI"] if var("config")[target.name] else var("config")["dev"]["EXTERNAL_FUNCTION_URI"] }}' @@ -109,7 +110,7 @@ vars: ["INTERNAL_DEV"] config: - # The keys correspond to dbt profiles and are case sensitive + # The keys correspond to dbt profiles and are case sensitive dev: API_INTEGRATION: AWS_SWELL_API_STG_V2 EXTERNAL_FUNCTION_URI: jbi9lp4dnf.execute-api.us-east-1.amazonaws.com/stg/ @@ -125,26 +126,32 @@ vars: - INTERNAL_DEV - DBT_CLOUD_SWELL # replace with the name of the chain -#### STREAMLINE 2.0 END #### + #### STREAMLINE 2.0 END #### -#### FSC_EVM BEGIN #### + #### FSC_EVM BEGIN #### -# Please visit https://github.com/FlipsideCrypto/fsc-evm/wiki for more information on required and optional variables + # Please visit https://github.com/FlipsideCrypto/fsc-evm/wiki for more information on required and optional variables ### GLOBAL VARIABLES BEGIN ### - + ## REQUIRED GLOBAL_PROD_DB_NAME: "swell" GLOBAL_NODE_SECRET_PATH: "Vault/prod/swell/ankr/mainnet" GLOBAL_BLOCKS_PER_HOUR: 1800 - GLOBAL_WRAPPED_ASSET_ADDRESS: '0x4200000000000000000000000000000000000006' + GLOBAL_WRAPPED_ASSET_ADDRESS: "0x4200000000000000000000000000000000000006" ### GLOBAL VARIABLES END ### TRACES_FULL_RELOAD_START_BLOCK: 3000000 - ## ABIS - BLOCK_EXPLORER_NAME: "SwellExplorer" - BLOCK_EXPLORER_ABI_URL: "https://explorer.swellnetwork.io/api/v2/smart-contracts/" + ### DECODER_PACKAGE VARIABLES BEGIN ### + DECODER_ABIS_BLOCK_EXPLORER_NAME: "SwellExplorer" + DECODER_ABIS_BLOCK_EXPLORER_URL: "https://explorer.swellnetwork.io/api/v2/smart-contracts/" + DECODER_ABIS_BLOCK_EXPLORER_URL_SUFFIX: "" + DECODER_ABIS_BLOCK_EXPLORER_SECRET_PATH: "" + DECODER_ABIS_RELEVANT_CONTRACT_LIMIT: 50 + DECODER_ABIS_RELEVANT_CONTRACT_COUNT: 200 + DECODER_ABIS_BRONZE_API_TABLE_ENABLED: True -#### FSC_EVM END #### \ No newline at end of file + ### DECODER_PACKAGE VARIABLES END ### +#### FSC_EVM END #### diff --git a/models/sources.yml b/models/sources.yml index d8d168e..a11ee43 100644 --- a/models/sources.yml +++ b/models/sources.yml @@ -1,4 +1,4 @@ -version: 2 +version: 2 sources: - name: github_actions @@ -43,4 +43,10 @@ sources: database: "{{ target.database }}" schema: silver tables: - - name: verified_abis \ No newline at end of file + - name: verified_abis + - name: bronze_abi + database: >- + {{ var('GLOBAL_PROD_DB_NAME') ~ ('_dev' if var("STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES", False) else '') }} + schema: streamline + tables: + - name: complete_contract_abis diff --git a/packages.yml b/packages.yml index b4657f3..477ec66 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,3 @@ packages: - git: https://github.com/FlipsideCrypto/fsc-evm.git - revision: v3.22.3 \ No newline at end of file + revision: v3.27.0