Skip to content

Commit

Permalink
feat(hubble): index tendermint headers and consensus changes (#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiserKarel authored Sep 15, 2023
1 parent 5297c6a commit ab63c91
Show file tree
Hide file tree
Showing 14 changed files with 294 additions and 29 deletions.
4 changes: 2 additions & 2 deletions hubble/hasura/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 3
metadata_directory: metadata
endpoint: http://localhost:8080
endpoint: https://localhost:8080
admin_secret: secret
metadata_directory: metadata
actions:
kind: synchronous
handler_webhook_baseurl: http://localhost:3000
1 change: 1 addition & 0 deletions hubble/hasura/metadata/api_limits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
13 changes: 13 additions & 0 deletions hubble/hasura/metadata/backend_configs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dataconnector:
athena:
uri: http://localhost:8081/api/v1/athena
mariadb:
uri: http://localhost:8081/api/v1/mariadb
mongodb:
uri: http://localhost:8082
mysql8:
uri: http://localhost:8081/api/v1/mysql
oracle:
uri: http://localhost:8081/api/v1/oracle
snowflake:
uri: http://localhost:8081/api/v1/snowflake
11 changes: 11 additions & 0 deletions hubble/hasura/metadata/databases/databases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,15 @@
from_env: PG_DATABASE_URL
isolation_level: read-committed
use_prepared_statements: false
logical_models:
- fields:
- name: receiver
type:
nullable: false
scalar: text
- name: amount
type:
nullable: true
scalar: text
name: coin_received
tables: "!include default/tables/tables.yaml"
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ array_relationships:
name: events
schema: public
select_permissions:
- comment: ""
- role: user
permission:
allow_aggregations: true
columns:
- is_finalized
- chain_id
Expand All @@ -25,4 +24,5 @@ select_permissions:
- hash
filter: {}
limit: 50
role: user
allow_aggregations: true
comment: ""
1 change: 1 addition & 0 deletions hubble/hasura/metadata/graphql_schema_introspection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disabled_for_roles: []
1 change: 1 addition & 0 deletions hubble/hasura/metadata/inherited_roles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
2 changes: 2 additions & 0 deletions hubble/hasura/metadata/metrics_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
analyze_query_variables: true
analyze_response_body: true
1 change: 1 addition & 0 deletions hubble/hasura/metadata/network.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions hubble/hasura/metadata/opentelemetry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ CREATE TABLE public.blocks (
id integer NOT NULL,
is_finalized boolean DEFAULT false,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone DEFAULT now()
updated_at timestamp with time zone DEFAULT now(),
extra_data jsonb
);
CREATE SEQUENCE public.blocks_id_seq
AS integer
Expand Down
5 changes: 3 additions & 2 deletions hubble/src/graphql/operations.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mutation InsertBlock($chain_id: Int!, $hash: String!, $height: Int!, $finalized: Boolean!, $events: events_arr_rel_insert_input) {
insert_blocks_one(object: {chain_id: $chain_id, hash: $hash, height: $height, is_finalized: $finalized, events: $events}) {

mutation InsertBlock($object: blocks_insert_input!) {
insert_blocks_one(object: $object) {
id
}
}
Expand Down
109 changes: 109 additions & 0 deletions hubble/src/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ type blocks {
"""filter the rows returned"""
where: events_bool_exp
): events_aggregate!
extra_data(
"""JSON select path"""
path: String
): jsonb
hash: String!
height: Int!
id: Int!
Expand Down Expand Up @@ -454,6 +458,11 @@ input blocks_aggregate_order_by {
variance: blocks_variance_order_by
}

"""append existing jsonb value of filtered columns with new jsonb value"""
input blocks_append_input {
extra_data: jsonb
}

"""
input type for inserting array relation for remote table "blocks"
"""
Expand Down Expand Up @@ -492,6 +501,7 @@ input blocks_bool_exp {
created_at: timestamptz_comparison_exp
events: events_bool_exp
events_aggregate: events_aggregate_bool_exp
extra_data: jsonb_comparison_exp
hash: String_comparison_exp
height: Int_comparison_exp
id: Int_comparison_exp
Expand All @@ -509,6 +519,27 @@ enum blocks_constraint {
blocks_pkey
}

"""
delete the field or element with specified path (for JSON arrays, negative integers count from the end)
"""
input blocks_delete_at_path_input {
extra_data: [String!]
}

"""
delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array
"""
input blocks_delete_elem_input {
extra_data: Int
}

"""
delete key/value pair or string element. key/value pairs are matched based on their key value
"""
input blocks_delete_key_input {
extra_data: String
}

"""
input type for incrementing numeric columns in table "blocks"
"""
Expand All @@ -526,6 +557,7 @@ input blocks_insert_input {
chain_id: Int
created_at: timestamptz
events: events_arr_rel_insert_input
extra_data: jsonb
hash: String
height: Int
id: Int
Expand Down Expand Up @@ -613,6 +645,7 @@ input blocks_order_by {
chain_id: order_by
created_at: order_by
events_aggregate: events_aggregate_order_by
extra_data: order_by
hash: order_by
height: order_by
id: order_by
Expand All @@ -625,6 +658,11 @@ input blocks_pk_columns_input {
id: Int!
}

"""prepend existing jsonb value of filtered columns with new jsonb value"""
input blocks_prepend_input {
extra_data: jsonb
}

"""
select columns of table "blocks"
"""
Expand All @@ -635,6 +673,9 @@ enum blocks_select_column {
"""column name"""
created_at

"""column name"""
extra_data

"""column name"""
hash

Expand Down Expand Up @@ -673,6 +714,7 @@ input type for updating data in table "blocks"
input blocks_set_input {
chain_id: Int
created_at: timestamptz
extra_data: jsonb
hash: String
height: Int
id: Int
Expand Down Expand Up @@ -743,6 +785,7 @@ input blocks_stream_cursor_input {
input blocks_stream_cursor_value_input {
chain_id: Int
created_at: timestamptz
extra_data: jsonb
hash: String
height: Int
id: Int
Expand Down Expand Up @@ -776,6 +819,9 @@ enum blocks_update_column {
"""column name"""
created_at

"""column name"""
extra_data

"""column name"""
hash

Expand All @@ -793,9 +839,30 @@ enum blocks_update_column {
}

input blocks_updates {
"""append existing jsonb value of filtered columns with new jsonb value"""
_append: blocks_append_input

"""
delete the field or element with specified path (for JSON arrays, negative integers count from the end)
"""
_delete_at_path: blocks_delete_at_path_input

"""
delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array
"""
_delete_elem: blocks_delete_elem_input

"""
delete key/value pair or string element. key/value pairs are matched based on their key value
"""
_delete_key: blocks_delete_key_input

"""increments the numeric columns with given value of the filtered values"""
_inc: blocks_inc_input

"""prepend existing jsonb value of filtered columns with new jsonb value"""
_prepend: blocks_prepend_input

"""sets the columns of the filtered rows to the given values"""
_set: blocks_set_input

Expand Down Expand Up @@ -3163,9 +3230,30 @@ type mutation_root {
update data of the table: "blocks"
"""
update_blocks(
"""append existing jsonb value of filtered columns with new jsonb value"""
_append: blocks_append_input

"""
delete the field or element with specified path (for JSON arrays, negative integers count from the end)
"""
_delete_at_path: blocks_delete_at_path_input

"""
delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array
"""
_delete_elem: blocks_delete_elem_input

"""
delete key/value pair or string element. key/value pairs are matched based on their key value
"""
_delete_key: blocks_delete_key_input

"""increments the numeric columns with given value of the filtered values"""
_inc: blocks_inc_input

"""prepend existing jsonb value of filtered columns with new jsonb value"""
_prepend: blocks_prepend_input

"""sets the columns of the filtered rows to the given values"""
_set: blocks_set_input

Expand All @@ -3177,9 +3265,30 @@ type mutation_root {
update single row of the table: "blocks"
"""
update_blocks_by_pk(
"""append existing jsonb value of filtered columns with new jsonb value"""
_append: blocks_append_input

"""
delete the field or element with specified path (for JSON arrays, negative integers count from the end)
"""
_delete_at_path: blocks_delete_at_path_input

"""
delete the array element with specified index (negative integers count from the end). throws an error if top level container is not an array
"""
_delete_elem: blocks_delete_elem_input

"""
delete key/value pair or string element. key/value pairs are matched based on their key value
"""
_delete_key: blocks_delete_key_input

"""increments the numeric columns with given value of the filtered values"""
_inc: blocks_inc_input

"""prepend existing jsonb value of filtered columns with new jsonb value"""
_prepend: blocks_prepend_input

"""sets the columns of the filtered rows to the given values"""
_set: blocks_set_input
pk_columns: blocks_pk_columns_input!
Expand Down
Loading

0 comments on commit ab63c91

Please sign in to comment.