-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cl-mimicry): Add Gossipsub_beacon_block events (#315)
* feat(cl-mimicry): Add Gossipsub_beacon_block events * feat: Add script to drop tables in ClickHouse * fix: Comment before distributed table * Merge master * style: Remove unnecessary empty line in constructor function
- Loading branch information
Showing
24 changed files
with
3,753 additions
and
1,946 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
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
2 changes: 2 additions & 0 deletions
2
deploy/migrations/clickhouse/034_libp2p_gossipsub_beacon_block.down.sql
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,2 @@ | ||
DROP TABLE IF EXISTS libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}'; | ||
DROP TABLE IF EXISTS libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}'; |
80 changes: 80 additions & 0 deletions
80
deploy/migrations/clickhouse/034_libp2p_gossipsub_beacon_block.up.sql
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,80 @@ | ||
CREATE TABLE libp2p_gossipsub_beacon_block_local on cluster '{cluster}' ( | ||
event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), | ||
slot UInt32 Codec(DoubleDelta, ZSTD(1)), | ||
slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), | ||
epoch UInt32 Codec(DoubleDelta, ZSTD(1)), | ||
epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), | ||
wallclock_slot UInt32 Codec(DoubleDelta, ZSTD(1)), | ||
wallclock_slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), | ||
wallclock_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), | ||
wallclock_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), | ||
propagation_slot_start_diff UInt32 Codec(ZSTD(1)), | ||
block FixedString(66) Codec(ZSTD(1)), | ||
proposer_index UInt32 CODEC(ZSTD(1)), | ||
peer_id_unique_key Int64, | ||
message_id String CODEC(ZSTD(1)), | ||
message_size UInt32 Codec(ZSTD(1)), | ||
topic_layer LowCardinality(String), | ||
topic_fork_digest_value LowCardinality(String), | ||
topic_name LowCardinality(String), | ||
topic_encoding LowCardinality(String), | ||
meta_client_name LowCardinality(String), | ||
meta_client_id String Codec(ZSTD(1)), | ||
meta_client_version LowCardinality(String), | ||
meta_client_implementation LowCardinality(String), | ||
meta_client_os LowCardinality(String), | ||
meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), | ||
meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), | ||
meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), | ||
meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), | ||
meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), | ||
meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), | ||
meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), | ||
meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), | ||
meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), | ||
meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), | ||
meta_network_name LowCardinality(String) | ||
) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') | ||
PARTITION BY toStartOfMonth(slot_start_date_time) | ||
ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); | ||
|
||
ALTER TABLE libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}' | ||
MODIFY COMMENT 'Table for libp2p gossipsub beacon block data.', | ||
COMMENT COLUMN event_date_time 'Timestamp of the event with millisecond precision', | ||
COMMENT COLUMN slot 'Slot number associated with the event', | ||
COMMENT COLUMN slot_start_date_time 'Start date and time of the slot', | ||
COMMENT COLUMN epoch 'Epoch number associated with the event', | ||
COMMENT COLUMN epoch_start_date_time 'Start date and time of the epoch', | ||
COMMENT COLUMN wallclock_slot 'Slot number of the wall clock when the event was received', | ||
COMMENT COLUMN wallclock_slot_start_date_time 'Start date and time of the wall clock slot when the event was received', | ||
COMMENT COLUMN wallclock_epoch 'Epoch number of the wall clock when the event was received', | ||
COMMENT COLUMN wallclock_epoch_start_date_time 'Start date and time of the wall clock epoch when the event was received', | ||
COMMENT COLUMN propagation_slot_start_diff 'Difference in slot start time for propagation', | ||
COMMENT COLUMN proposer_index 'The proposer index of the beacon block', | ||
COMMENT COLUMN block 'The beacon block root hash', | ||
COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer', | ||
COMMENT COLUMN message_id 'Identifier of the message', | ||
COMMENT COLUMN message_size 'Size of the message in bytes', | ||
COMMENT COLUMN topic_layer 'Layer of the topic in the gossipsub protocol', | ||
COMMENT COLUMN topic_fork_digest_value 'Fork digest value of the topic', | ||
COMMENT COLUMN topic_name 'Name of the topic', | ||
COMMENT COLUMN topic_encoding 'Encoding used for the topic', | ||
COMMENT COLUMN meta_client_name 'Name of the client that generated the event', | ||
COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', | ||
COMMENT COLUMN meta_client_version 'Version of the client that generated the event', | ||
COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', | ||
COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', | ||
COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', | ||
COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', | ||
COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', | ||
COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', | ||
COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', | ||
COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', | ||
COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', | ||
COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', | ||
COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', | ||
COMMENT COLUMN meta_network_id 'Network ID associated with the client', | ||
COMMENT COLUMN meta_network_name 'Name of the network associated with the client'; | ||
|
||
CREATE TABLE libp2p_gossipsub_beacon_block on cluster '{cluster}' AS libp2p_gossipsub_beacon_block_local | ||
ENGINE = Distributed('{cluster}', default, libp2p_gossipsub_beacon_block_local, rand()); |
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
Oops, something went wrong.