mirror of
https://github.com/FlipsideCrypto/arbitrum-models.git
synced 2026-02-06 18:01:52 +00:00
* workflow changes * models macro * logs table docs * gold layer changes * silver legacy changes * silver core tests * timestamp cast type * workflow changes schedule * gas price column names
67 lines
1.3 KiB
SQL
67 lines
1.3 KiB
SQL
{{ config(
|
|
materialized = 'view',
|
|
persist_docs ={ "relation": true,
|
|
"columns": true }
|
|
) }}
|
|
|
|
SELECT
|
|
block_number,
|
|
block_timestamp,
|
|
'mainnet' AS network,
|
|
'arbitrum' AS blockchain,
|
|
tx_count,
|
|
difficulty,
|
|
total_difficulty,
|
|
extra_data,
|
|
gas_limit,
|
|
gas_used,
|
|
HASH,
|
|
parent_hash,
|
|
receipts_root,
|
|
sha3_uncles,
|
|
SIZE,
|
|
uncles as uncle_blocks,
|
|
OBJECT_CONSTRUCT(
|
|
'baseFeePerGas',
|
|
base_fee_per_gas,
|
|
'difficulty',
|
|
difficulty,
|
|
'extraData',
|
|
extra_data,
|
|
'gasLimit',
|
|
gas_limit,
|
|
'gasUsed',
|
|
gas_used,
|
|
'hash',
|
|
HASH,
|
|
'logsBloom',
|
|
logs_bloom,
|
|
'miner',
|
|
miner,
|
|
'nonce',
|
|
nonce,
|
|
'number',
|
|
NUMBER,
|
|
'parentHash',
|
|
parent_hash,
|
|
'receiptsRoot',
|
|
receipts_root,
|
|
'sha3Uncles',
|
|
sha3_uncles,
|
|
'size',
|
|
SIZE,
|
|
'stateRoot',
|
|
state_root,
|
|
'timestamp',
|
|
block_timestamp,
|
|
'totalDifficulty',
|
|
total_difficulty,
|
|
'transactionsRoot',
|
|
transactions_root,
|
|
'uncles',
|
|
uncles
|
|
) AS block_header_json
|
|
FROM
|
|
{{ ref('silver__blocks') }}
|
|
LEFT JOIN {{ ref('silver__tx_count') }} USING (block_number)
|