mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 13:06:59 +00:00
qn (#411)
This commit is contained in:
parent
9974754c9c
commit
40d09d0eb7
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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') }})
|
||||
28
models/evm/streamline/core/streamline__evm_chainhead.sql
Normal file
28
models/evm/streamline/core/streamline__evm_chainhead.sql
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user