Running DBT
Step 1
1- install the web3 package on your server by running the following command:
yes | pip install --force-reinstall web3==6.19.0
2- execute the psql in the indexer database container using the following command:
docker exec -it <container_id> psql -U <db_username> -W <db_name>
Note: after executing psql in the db container, run the next step queries with psql (in tumux terminal) to make sure all the migrations are done successfully.
3- run the archive/additional_migrations.sql query file on the indexer db.
Step 2
there are two methods to run the DBT, including the DBT cloud or running on a VPS.
Method 1 - Running dbt on DBT Cloud
Note: Head to the dbt cloud page to get started and see how you can deploy your dbt project on dbt cloud.
the dbt repo that you need to deploy for Poply is in this repo.
Note: to access the repo or indexer database credentials, please send a message to the project manager of poply
Method 2 - Running dbt on a VPS
coming soon!
Step 3
1- run the archive/post_first_run_migrations_activity.sql query file on the indexer db using the psql.
2- run the archive/post_first_run_migrations.sql query file on the indexer db using the psql.
Step 4
1- open the state_query repo
2- run the queries in the collection_stats.SQL file.
3- run the queries in the item_trigger.sql file.
4- run the queries in the volume_trigger.sql file.
5- run the queries in the collection_owners.sql file.
Note:
collection_ownerstable depends on thestatetable.
6- run the queries in the listed.sql file.