mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 13:06:59 +00:00
parent
1d89e84073
commit
ee7efe3851
26
data/seeds__network_version.csv
Normal file
26
data/seeds__network_version.csv
Normal file
@ -0,0 +1,26 @@
|
||||
root_height,network_version
|
||||
1065711,candidate-04
|
||||
2033592,candidate-05
|
||||
3187931,candidate-06
|
||||
4132133,candidate-07
|
||||
4972987,candidate-08
|
||||
6483246,candidate-09
|
||||
7601063,mainnet-01
|
||||
8742959,mainnet-02
|
||||
9737133,mainnet-03
|
||||
9992020,mainnet-04
|
||||
12020337,mainnet-05
|
||||
12609237,mainnet-06
|
||||
13404174,mainnet-07
|
||||
13950742,mainnet-08
|
||||
14892104,mainnet-09
|
||||
15791891,mainnet-10
|
||||
16755602,mainnet-11
|
||||
17544523,mainnet-12
|
||||
18587478,mainnet-13
|
||||
19050753,mainnet-14
|
||||
21291692,mainnet-15
|
||||
23830813,mainnet-16
|
||||
27341470,mainnet-17
|
||||
31735955,mainnet-18
|
||||
35858811,mainnet-19
|
||||
|
@ -16,6 +16,7 @@ gold_blocks AS (
|
||||
block_height,
|
||||
block_timestamp,
|
||||
network,
|
||||
network_version,
|
||||
chain_id,
|
||||
tx_count,
|
||||
id,
|
||||
|
||||
@ -39,6 +39,15 @@ models:
|
||||
- STRING
|
||||
- VARCHAR
|
||||
|
||||
- name: NETWORK_VERSION
|
||||
description: "{{ doc('network_version') }}"
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- STRING
|
||||
- VARCHAR
|
||||
|
||||
- name: CHAIN_ID
|
||||
description: "{{ doc('chain_id') }}"
|
||||
tests:
|
||||
|
||||
5
models/descriptions/network_version.md
Normal file
5
models/descriptions/network_version.md
Normal file
@ -0,0 +1,5 @@
|
||||
{% docs network_version %}
|
||||
|
||||
The version of the Blockchain that cooresponds with the block height. For more information on Flow's network upgrades (Sporks), see https://developers.flow.com/nodes/node-operation/spork
|
||||
|
||||
{% enddocs %}
|
||||
@ -49,8 +49,36 @@ silver_blocks AS (
|
||||
_inserted_timestamp
|
||||
FROM
|
||||
bronze_blocks
|
||||
),
|
||||
network_version AS (
|
||||
SELECT
|
||||
root_height,
|
||||
network_version,
|
||||
COALESCE(LAG(root_height) over (
|
||||
ORDER BY
|
||||
network_version DESC) - 1, 'inf' :: FLOAT) AS end_height
|
||||
FROM
|
||||
{{ ref('seeds__network_version') }}
|
||||
),
|
||||
add_version AS (
|
||||
SELECT
|
||||
block_height,
|
||||
block_timestamp,
|
||||
network,
|
||||
v.network_version,
|
||||
chain_id,
|
||||
tx_count,
|
||||
id,
|
||||
parent_id,
|
||||
_ingested_at,
|
||||
_inserted_timestamp
|
||||
FROM
|
||||
silver_blocks b
|
||||
LEFT JOIN network_version v
|
||||
ON b.block_height BETWEEN v.root_height
|
||||
AND v.end_height
|
||||
)
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
silver_blocks
|
||||
add_version
|
||||
|
||||
@ -39,6 +39,15 @@ models:
|
||||
- STRING
|
||||
- VARCHAR
|
||||
|
||||
- name: network_version
|
||||
description: "{{ doc('network_version') }}"
|
||||
tests:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
column_type_list:
|
||||
- STRING
|
||||
- VARCHAR
|
||||
|
||||
- name: chain_id
|
||||
description: "{{ doc('chain_id') }}"
|
||||
tests:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user