mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 14:22:06 +00:00
* fixed node urls * limited streamline_blocks to candidate node 7 root height --------- Co-authored-by: shah <info@shahnewazkhan.ca>
24 lines
745 B
SQL
24 lines
745 B
SQL
{{ config (
|
|
materialized = "view",
|
|
tags = ['streamline_view']
|
|
) }}
|
|
|
|
|
|
{% if execute %}
|
|
{% set height = run_query('SELECT streamline.udf_get_chainhead()') %}
|
|
{% set block_height = height.columns[0].values()[0] %}
|
|
{% else %}
|
|
{% set block_height = 0 %}
|
|
{% endif %}
|
|
|
|
SELECT
|
|
height as block_height,
|
|
node_url
|
|
FROM
|
|
TABLE(streamline.udtf_get_base_table({{block_height}}))
|
|
WHERE
|
|
block_height > 4132133 -- Root Height for Candidate node 7
|
|
-- the earliest available block we can ingest since earlier candidat nodes
|
|
-- do not have the get_block_by_height grpc method
|
|
-- https://developers.flow.com/concepts/nodes/node-operation/past-sporks#candidate-4
|