-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/prometheus
# Conflicts: # src/clickhouse/handleSinkRequest.ts
- Loading branch information
Showing
10 changed files
with
96 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,5 @@ dist/ | |
substreams-sink-clickhouse | ||
.env | ||
replay.log | ||
*.sql | ||
package-lock.json | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLE IF NOT EXISTS blocks ( | ||
block_id FixedString(64), | ||
block_number UInt32(), | ||
chain LowCardinality(String), | ||
timestamp DateTime64(3, 'UTC'), | ||
) | ||
ENGINE = ReplacingMergeTree | ||
PRIMARY KEY (block_id) | ||
ORDER BY (block_id, block_number, chain, timestamp); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CREATE TABLE IF NOT EXISTS final_blocks ( | ||
block_id FixedString(64), | ||
) | ||
ENGINE = ReplacingMergeTree | ||
ORDER BY (block_id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import blocks_sql from "./blocks.sql"; | ||
import final_blocks_sql from "./final_blocks.sql"; | ||
import module_hashes_sql from "./module_hashes.sql"; | ||
import unparsed_json_sql from "./unparsed_json.sql"; | ||
|
||
export const blocks = await Bun.file(blocks_sql).text() | ||
export const final_blocks = await Bun.file(final_blocks_sql).text() | ||
export const module_hashes = await Bun.file(module_hashes_sql).text() | ||
export const unparsed_json = await Bun.file(unparsed_json_sql).text() | ||
|
||
export default [ | ||
["blocks", blocks], | ||
["final_blocks", final_blocks], | ||
["module_hashes", module_hashes], | ||
["unparsed_json", unparsed_json], | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CREATE TABLE IF NOT EXISTS module_hashes ( | ||
module_hash FixedString(40), | ||
module_name String(), | ||
chain LowCardinality(String), | ||
type String(), | ||
) | ||
ENGINE = ReplacingMergeTree | ||
ORDER BY (module_hash); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
CREATE TABLE IF NOT EXISTS unparsed_json ( | ||
raw_data JSON, | ||
source LowCardinality(String), | ||
id String, | ||
block_id FixedString(64), | ||
module_hash FixedString(40), | ||
chain LowCardinality(String) | ||
) | ||
ENGINE = MergeTree | ||
ORDER BY (source, chain, module_hash, block_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters