Skip to content

Commit

Permalink
update date
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisCarriere committed Jul 29, 2024
1 parent 4a56ef1 commit 300f62c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions blocks/evm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ info:

.PHONY: run
run:
substreams run -e eth.substreams.pinax.network:443 ch_out -s 1500000 -t 1500001 -o json
substreams run -e eth.substreams.pinax.network:443 ch_out -s 9 -t 10 -o json

.PHONY: gui
gui:
Expand All @@ -35,7 +35,7 @@ sql-setup:

.PHONY: sql-run
sql-run:
substreams-sink-sql run clickhouse://default:default@localhost:9000/default substreams.yaml -e eth.substreams.pinax.network:443 1: --final-blocks-only --undo-buffer-size 100 --on-module-hash-mistmatch=warn --batch-block-flush-interval 1000 --development-mode
substreams-sink-sql run clickhouse://default:default@localhost:9000/default substreams.yaml -e eth.substreams.pinax.network:443 1: --final-blocks-only --undo-buffer-size 100 --on-module-hash-mistmatch=warn --batch-block-flush-interval 10 --development-mode

.PHONY: deploy
deploy:
Expand Down
6 changes: 3 additions & 3 deletions blocks/evm/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS blocks
(
time DateTime('UTC'),
number UInt64,
date LowCardinality(String),
date Date,
hash String,
parent_hash String,
nonce UInt64,
Expand Down Expand Up @@ -52,7 +52,7 @@ CREATE TABLE IF NOT EXISTS logs
block_time DateTime('UTC'),
block_number UInt64,
block_hash String,
block_date LowCardinality(String),
block_date Date,
contract_address String,
topic0 String,
topic1 String DEFAULT '',
Expand All @@ -75,7 +75,7 @@ CREATE TABLE IF NOT EXISTS balance_changes
block_time DateTime('UTC'),
block_number UInt64,
block_hash String,
block_date LowCardinality(String),
block_date Date,
address String,
new_value UInt256,
old_value UInt256,
Expand Down
2 changes: 2 additions & 0 deletions blocks/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ mod balance_changes;
mod blocks;
mod logs;
mod sinks;
// mod traces;
// mod transactions;
5 changes: 2 additions & 3 deletions common/src/sinks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ pub fn insert_timestamp(row: &mut TableChange, clock: &Clock, is_block: bool) {
let block_hash = format!("0x{}", clock.id);
let prefix = if is_block { "" } else { "block_" };

row
.change(format!("{}date", prefix).as_str(), ("", block_date.as_str()))
row.change(format!("{}date", prefix).as_str(), ("", block_date.as_str()))
.change(format!("{}time", prefix).as_str(), ("", block_time.as_str()))
.change(format!("{}number", prefix).as_str(), ("", block_number.as_str()))
.change(format!("{}hash", prefix).as_str(), ("", block_hash.as_str()));
}
}

0 comments on commit 300f62c

Please sign in to comment.