General: New Project Set Up - FlipsideCrypto/fsc-evm GitHub Wiki
Requires fsc-evm v4.0.0+
The fsc-evm package enables standardized deployment of new EVM blockchain projects through a structured, phased approach. This process leverages repository templates, configuration management, and automated deployment commands to ensure consistent and reliable project setup.
- Copy the evm-models-template repo and set up for new chain (
Use this template->Create a new repository) - Name:
<chain>-models - Add branch protections to
mainbranch - Add
analytics-engineeringcollaborators - Add
workflow_secretsenvironment to GitHub repo with these keys:-
PASSWORD- e.g.,DBT_CLOUD_<database>snowflake user password sourced viaVault/prod/snowflake_users -
SLACK_WEBHOOK_URL- sourced viaVault/prod/evm/slack
-
- Git clone the new
<chain>-modelsrepository and open in IDEgit clone https://github.com/FlipsideCrypto/<chain>-models.git
- Set up
profiles.yml - Add latest fsc-evm package version
- Replace
<evm_chain>references with current chain name (case sensitive find & replace) - Set up virtual environment:
python -m venv dbt-env source dbt-env/bin/activate pip install dbt-snowflake==1.7.0 # or latest stable version export DBT_PROFILES_DIR=/Users/<my_user>/.dbt
- Open new terminal and run the following to verify set up:
dbt debug dbt deps
2. Update dbt_project.yml
- Enable/disable models under
fsc_evm:where necessary - Verify
overview.mdmatches enabled models/packages
Add API_INTEGRATION and EXTERNAL_FUNCTION_URI details. Use these example queries to gather the required information:
-- Source integration name
SHOW INTEGRATIONS;
-- View integration details
DESCRIBE INTEGRATION AWS_<EVM_CHAIN>_API_STG_V2;
-- STG Environment
SELECT *
FROM TABLE(STREAMLINE.AWS.CLOUDFORMATION_LIST_STACKS('stg', []));
-- PROD Environment
SELECT *
FROM TABLE(STREAMLINE.AWS.CLOUDFORMATION_LIST_STACKS('prod', ['CREATE_COMPLETE']));
-- DESCRIBE STACKS with ALL Stacks in Environment
SELECT *
FROM TABLE(STREAMLINE.AWS.CLOUDFORMATION_DESCRIBE_STACKS(
'stg',
NULL::STRING -- or specify stack name from previous query
))
WHERE stack_name ilike '%scroll%';- Quicknode
- Add node secret to vault under
prod/evm/<node_provider>/<chain>/<network>/..path - Key =
URL
- Add node secret to vault under
- DRPC: No action needed
- Other: Request support from EVM engineering team
Call the node sample SP to assist with Gold variables:
dbt run-operation call_sample_rpc_node --target prod
or
dbt run-operation call_sample_rpc_node --args '{"vault_path_override": '', "node_url_override": "<insert_url_with_key>", "sample_blocks_override": [759880,756399,...]}' --target prodThen check the results:
SELECT *
FROM fsc_evm.admin.rpc_node_logs
ORDER BY inserted_at DESC
LIMIT 10;Query crosschain.price.dim/ez_asset_metadata to assist with Price variables.
Query to view all available variables in master list:
SELECT * FROM fsc_evm.admin.dim_variables;- Add new
project_vars/macro file for new chain with appropriate variables - Submit PR, tag package adhering to semantic versioning standards
- Update fsc-evm package version in
<chain>-modelsrepository - Run
make cleanup_timeif testing in dev - Confirm
MAIN_GHA_STREAMLINE_CHAINHEAD_CRONis applied infsc-evm/project_varsbefore proceeding
Deploy external tables in streamline-snowflake repository:
make create_evm_tables DBT_TARGET=prod CHAIN=scrollSubject to change. Please reference the makefile for the most up to date commands.
make deploy_chain_phase_1 DBT_TARGET=prodmake deploy_chain_phase_2 DBT_TARGET=prodmake deploy_chain_phase_3 DBT_TARGET=prodmake deploy_chain_phase_4 DBT_TARGET=prodThis phased approach ensures systematic deployment of all components while allowing for proper testing and validation at each stage.