This commit is contained in:
Austin 2025-02-18 20:34:51 -05:00 committed by GitHub
parent 9974754c9c
commit 40d09d0eb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 41 additions and 20 deletions

View File

@ -35,7 +35,7 @@ SELECT
) :: INT AS partition_key,
{{ target.database }}.live.udf_api(
'POST',
'{Service}',
'{Service}/{Authentication}',
OBJECT_CONSTRUCT(
'Content-Type',
'application/json'
@ -53,7 +53,7 @@ SELECT
TRUE -- Include transactions
)
),
'Vault/{{ target.name }}/flow/evm/mainnet'
'Vault/prod/flow/quicknode/mainnet'
) AS request
FROM
tbl

View File

@ -41,7 +41,7 @@ SELECT
) :: INT AS partition_key,
{{ target.database }}.live.udf_api(
'POST',
'{Service}',
'{Service}/{Authentication}',
OBJECT_CONSTRUCT(
'Content-Type',
'application/json'
@ -58,7 +58,7 @@ SELECT
utils.udf_int_to_hex(block_number)
)
),
'Vault/{{ target.name }}/flow/evm/mainnet'
'Vault/prod/flow/quicknode/mainnet'
) AS request
FROM
ready_blocks

View File

@ -44,7 +44,7 @@ SELECT
) :: INT AS partition_key,
{{ target.database }}.live.udf_api(
'POST',
'{Service}',
'{Service}/{Authentication}',
OBJECT_CONSTRUCT(
'Content-Type',
'application/json'
@ -65,7 +65,7 @@ SELECT
)
)
),
'Vault/{{ target.name }}/flow/evm/mainnet'
'Vault/prod/flow/quicknode/mainnet'
) AS request
FROM
ready_blocks

View File

@ -63,7 +63,7 @@ SELECT
) :: INT AS partition_key,
{{ target.database }}.live.udf_api(
'POST',
'{Service}',
'{Service}/{Authentication}',
OBJECT_CONSTRUCT(
'Content-Type',
'application/json'
@ -81,7 +81,7 @@ SELECT
TRUE -- Include transactions
)
),
'Vault/{{ target.name }}/flow/evm/mainnet'
'Vault/prod/flow/quicknode/mainnet'
) AS request
FROM
tbl

View File

@ -74,7 +74,7 @@ SELECT
) :: INT AS partition_key,
{{ target.database }}.live.udf_api(
'POST',
'{Service}',
'{Service}/{Authentication}',
OBJECT_CONSTRUCT(
'Content-Type',
'application/json'
@ -91,7 +91,7 @@ SELECT
utils.udf_int_to_hex(block_number)
)
),
'Vault/{{ target.name }}/flow/evm/mainnet'
'Vault/prod/flow/quicknode/mainnet'
) AS request
FROM
ready_blocks

View File

@ -71,7 +71,7 @@ SELECT
) :: INT AS partition_key,
{{ target.database }}.live.udf_api(
'POST',
'{Service}',
'{Service}/{Authentication}',
OBJECT_CONSTRUCT(
'Content-Type',
'application/json'
@ -92,7 +92,7 @@ SELECT
)
)
),
'Vault/{{ target.name }}/flow/evm/mainnet'
'Vault/prod/flow/quicknode/mainnet'
) AS request
FROM
ready_blocks

View File

@ -3,13 +3,6 @@
tags = ['streamline_realtime_evm', 'streamline_history_evm']
) }}
{% if execute %}
{% set height = run_query("SELECT streamline.udf_get_evm_chainhead()") %}
{% set block_number = height.columns [0].values() [0] %}
{% else %}
{% set block_number = 0 %}
{% endif %}
SELECT
_id AS block_number
FROM
@ -18,4 +11,4 @@ FROM
'number_sequence'
) }}
WHERE
_id <= {{ block_number }}
_id <= (SELECT block_number FROM {{ ref('streamline__evm_chainhead') }})

View File

@ -0,0 +1,28 @@
{{ config (
materialized = 'table',
tags = ['streamline_realtime_evm', 'streamline_history_evm']
) }}
SELECT
live.udf_api(
'POST',
'{Service}/{Authentication}',
OBJECT_CONSTRUCT(
'Content-Type', 'application/json',
'fsc-quantum-state', 'LiveQuery'
),
OBJECT_CONSTRUCT(
'id',
0,
'jsonrpc',
'2.0',
'method',
'eth_blockNumber',
'params',
[]
),
'Vault/prod/flow/quicknode/mainnet'
) AS resp,
utils.udf_hex_to_int(
resp :data :result :: STRING
) AS block_number