-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03071cc
commit 79861f2
Showing
28 changed files
with
295 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
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,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 |
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 |
---|---|---|
@@ -1 +1,20 @@ | ||
[] | ||
- name: default | ||
kind: postgres | ||
configuration: | ||
connection_info: | ||
database_url: | ||
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" |
3 changes: 3 additions & 0 deletions
3
hubble/hasura/metadata/databases/default/tables/public_addresses.yaml
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,3 @@ | ||
table: | ||
name: addresses | ||
schema: public |
28 changes: 28 additions & 0 deletions
28
hubble/hasura/metadata/databases/default/tables/public_blocks.yaml
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,28 @@ | ||
table: | ||
name: blocks | ||
schema: public | ||
object_relationships: | ||
- name: chain | ||
using: | ||
foreign_key_constraint_on: chain_id | ||
array_relationships: | ||
- name: events | ||
using: | ||
foreign_key_constraint_on: | ||
column: block_id | ||
table: | ||
name: events | ||
schema: public | ||
select_permissions: | ||
- role: user | ||
permission: | ||
columns: | ||
- is_finalized | ||
- chain_id | ||
- height | ||
- id | ||
- hash | ||
filter: {} | ||
limit: 50 | ||
allow_aggregations: true | ||
comment: "" |
11 changes: 11 additions & 0 deletions
11
hubble/hasura/metadata/databases/default/tables/public_chains.yaml
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,11 @@ | ||
table: | ||
name: chains | ||
schema: public | ||
array_relationships: | ||
- name: blocks | ||
using: | ||
foreign_key_constraint_on: | ||
column: chain_id | ||
table: | ||
name: blocks | ||
schema: public |
13 changes: 13 additions & 0 deletions
13
hubble/hasura/metadata/databases/default/tables/public_coin_receiveds.yaml
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,13 @@ | ||
table: | ||
name: coin_receiveds | ||
schema: public | ||
object_relationships: | ||
- name: event | ||
using: | ||
manual_configuration: | ||
column_mapping: | ||
id: id | ||
insertion_order: null | ||
remote_table: | ||
name: events | ||
schema: public |
3 changes: 3 additions & 0 deletions
3
hubble/hasura/metadata/databases/default/tables/public_coin_spents.yaml
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,3 @@ | ||
table: | ||
name: coin_spents | ||
schema: public |
3 changes: 3 additions & 0 deletions
3
hubble/hasura/metadata/databases/default/tables/public_coinbases.yaml
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,3 @@ | ||
table: | ||
name: coinbases | ||
schema: public |
3 changes: 3 additions & 0 deletions
3
hubble/hasura/metadata/databases/default/tables/public_commissions.yaml
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,3 @@ | ||
table: | ||
name: commissions | ||
schema: public |
7 changes: 7 additions & 0 deletions
7
hubble/hasura/metadata/databases/default/tables/public_events.yaml
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,7 @@ | ||
table: | ||
name: events | ||
schema: public | ||
object_relationships: | ||
- name: block | ||
using: | ||
foreign_key_constraint_on: block_id |
3 changes: 3 additions & 0 deletions
3
hubble/hasura/metadata/databases/default/tables/public_messages.yaml
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,3 @@ | ||
table: | ||
name: messages | ||
schema: public |
3 changes: 3 additions & 0 deletions
3
hubble/hasura/metadata/databases/default/tables/public_mints.yaml
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,3 @@ | ||
table: | ||
name: mints | ||
schema: public |
3 changes: 3 additions & 0 deletions
3
hubble/hasura/metadata/databases/default/tables/public_rewards.yaml
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,3 @@ | ||
table: | ||
name: rewards | ||
schema: public |
3 changes: 3 additions & 0 deletions
3
hubble/hasura/metadata/databases/default/tables/public_transfers.yaml
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,3 @@ | ||
table: | ||
name: transfers | ||
schema: public |
12 changes: 12 additions & 0 deletions
12
hubble/hasura/metadata/databases/default/tables/tables.yaml
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,12 @@ | ||
- "!include public_addresses.yaml" | ||
- "!include public_blocks.yaml" | ||
- "!include public_chains.yaml" | ||
- "!include public_coin_receiveds.yaml" | ||
- "!include public_coin_spents.yaml" | ||
- "!include public_coinbases.yaml" | ||
- "!include public_commissions.yaml" | ||
- "!include public_events.yaml" | ||
- "!include public_messages.yaml" | ||
- "!include public_mints.yaml" | ||
- "!include public_rewards.yaml" | ||
- "!include public_transfers.yaml" |
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 @@ | ||
disabled_for_roles: [] |
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 @@ | ||
[] |
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 @@ | ||
analyze_query_variables: true | ||
analyze_response_body: true |
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 @@ | ||
{} |
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 @@ | ||
{} |
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 @@ | ||
[] |
138 changes: 138 additions & 0 deletions
138
hubble/hasura/migrations/default/1693576035737_init/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,138 @@ | ||
SET check_function_bodies = false; | ||
CREATE TABLE public.addresses ( | ||
address text NOT NULL, | ||
chain_id integer NOT NULL, | ||
id integer NOT NULL | ||
); | ||
CREATE SEQUENCE public.addresses_id_seq | ||
AS integer | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
ALTER SEQUENCE public.addresses_id_seq OWNED BY public.addresses.id; | ||
CREATE TABLE public.blocks ( | ||
hash text NOT NULL, | ||
chain_id integer NOT NULL, | ||
height integer NOT NULL, | ||
id integer NOT NULL, | ||
is_finalized boolean DEFAULT false | ||
); | ||
CREATE SEQUENCE public.blocks_id_seq | ||
AS integer | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
ALTER SEQUENCE public.blocks_id_seq OWNED BY public.blocks.id; | ||
CREATE TABLE public.chains ( | ||
id integer NOT NULL, | ||
chain_id text NOT NULL | ||
); | ||
CREATE SEQUENCE public.chains_id_seq | ||
AS integer | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
ALTER SEQUENCE public.chains_id_seq OWNED BY public.chains.id; | ||
CREATE TABLE public.events ( | ||
id integer NOT NULL, | ||
index integer NOT NULL, | ||
data jsonb NOT NULL, | ||
block_id integer NOT NULL | ||
); | ||
CREATE VIEW public.coin_receiveds AS | ||
SELECT events.id, | ||
(((events.data -> 'attributes'::text) -> 0) ->> 'value'::text) AS receiver, | ||
"substring"((((events.data -> 'attributes'::text) -> 1) ->> 'value'::text), '^\d+'::text) AS amount, | ||
"substring"((((events.data -> 'attributes'::text) -> 1) ->> 'value'::text), '[a-zA-Z].*'::text) AS denom | ||
FROM public.events | ||
WHERE ((events.data ->> 'type'::text) = 'coin_received'::text); | ||
CREATE VIEW public.coin_spents AS | ||
SELECT events.id, | ||
(((events.data -> 'attributes'::text) -> 0) ->> 'value'::text) AS spender, | ||
"substring"((((events.data -> 'attributes'::text) -> 1) ->> 'value'::text), '^\d+'::text) AS amount, | ||
"substring"((((events.data -> 'attributes'::text) -> 1) ->> 'value'::text), '[a-zA-Z].*'::text) AS denom | ||
FROM public.events | ||
WHERE ((events.data ->> 'type'::text) = 'coin_spent'::text); | ||
CREATE VIEW public.coinbases AS | ||
SELECT events.id, | ||
(((events.data -> 'attributes'::text) -> 0) ->> 'value'::text) AS minter, | ||
"substring"((((events.data -> 'attributes'::text) -> 1) ->> 'value'::text), '^\d+'::text) AS amount, | ||
"substring"((((events.data -> 'attributes'::text) -> 1) ->> 'value'::text), '[a-zA-Z].*'::text) AS denom | ||
FROM public.events | ||
WHERE ((events.data ->> 'type'::text) = 'coinbase'::text); | ||
CREATE VIEW public.commissions AS | ||
SELECT events.id, | ||
(((events.data -> 'attributes'::text) -> 1) ->> 'value'::text) AS validator, | ||
"substring"((((events.data -> 'attributes'::text) -> 0) ->> 'value'::text), '^\d+'::text) AS amount, | ||
"substring"((((events.data -> 'attributes'::text) -> 0) ->> 'value'::text), '[a-zA-Z].*'::text) AS denom | ||
FROM public.events | ||
WHERE ((events.data ->> 'type'::text) = 'commission'::text); | ||
CREATE SEQUENCE public.events_id_seq | ||
AS integer | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
ALTER SEQUENCE public.events_id_seq OWNED BY public.events.id; | ||
CREATE VIEW public.messages AS | ||
SELECT events.id, | ||
(((events.data -> 'attributes'::text) -> 0) ->> 'value'::text) AS sender | ||
FROM public.events | ||
WHERE ((events.data ->> 'type'::text) = 'message'::text); | ||
CREATE VIEW public.mints AS | ||
SELECT events.id, | ||
(((events.data -> 'attributes'::text) -> 0) ->> 'value'::text) AS bonded_ratio, | ||
(((events.data -> 'attributes'::text) -> 1) ->> 'value'::text) AS inflation, | ||
(((events.data -> 'attributes'::text) -> 2) ->> 'value'::text) AS annual_provisions, | ||
(((events.data -> 'attributes'::text) -> 3) ->> 'value'::text) AS amount | ||
FROM public.events | ||
WHERE ((events.data ->> 'type'::text) = 'mint'::text); | ||
CREATE VIEW public.rewards AS | ||
SELECT events.id, | ||
(((events.data -> 'attributes'::text) -> 1) ->> 'value'::text) AS validator, | ||
"substring"((((events.data -> 'attributes'::text) -> 0) ->> 'value'::text), '^\d+'::text) AS amount, | ||
"substring"((((events.data -> 'attributes'::text) -> 0) ->> 'value'::text), '[a-zA-Z].*'::text) AS denom | ||
FROM public.events | ||
WHERE ((events.data ->> 'type'::text) = 'rewards'::text); | ||
CREATE VIEW public.transfers AS | ||
SELECT events.id, | ||
(((events.data -> 'attributes'::text) -> 0) ->> 'value'::text) AS recipient, | ||
(((events.data -> 'attributes'::text) -> 1) ->> 'value'::text) AS sender, | ||
"substring"((((events.data -> 'attributes'::text) -> 2) ->> 'value'::text), '^\d+'::text) AS amount, | ||
"substring"((((events.data -> 'attributes'::text) -> 2) ->> 'value'::text), '[a-zA-Z].*'::text) AS denom | ||
FROM public.events | ||
WHERE ((events.data ->> 'type'::text) = 'transfer'::text); | ||
ALTER TABLE ONLY public.addresses ALTER COLUMN id SET DEFAULT nextval('public.addresses_id_seq'::regclass); | ||
ALTER TABLE ONLY public.blocks ALTER COLUMN id SET DEFAULT nextval('public.blocks_id_seq'::regclass); | ||
ALTER TABLE ONLY public.chains ALTER COLUMN id SET DEFAULT nextval('public.chains_id_seq'::regclass); | ||
ALTER TABLE ONLY public.events ALTER COLUMN id SET DEFAULT nextval('public.events_id_seq'::regclass); | ||
ALTER TABLE ONLY public.addresses | ||
ADD CONSTRAINT addresses_address_chain_id_key UNIQUE (address, chain_id); | ||
ALTER TABLE ONLY public.addresses | ||
ADD CONSTRAINT addresses_pkey PRIMARY KEY (id); | ||
ALTER TABLE ONLY public.blocks | ||
ADD CONSTRAINT blocks_pkey PRIMARY KEY (id); | ||
ALTER TABLE ONLY public.chains | ||
ADD CONSTRAINT chains_id_key UNIQUE (id); | ||
ALTER TABLE ONLY public.chains | ||
ADD CONSTRAINT chains_pkey PRIMARY KEY (id, chain_id); | ||
ALTER TABLE ONLY public.events | ||
ADD CONSTRAINT events_pkey PRIMARY KEY (id); | ||
CREATE INDEX coin_received_idx ON public.events USING btree (((data ->> 'type'::text))); | ||
CREATE INDEX idx_blocks_chain_id ON public.blocks USING btree (chain_id); | ||
CREATE INDEX idx_blocks_chain_id_height ON public.blocks USING btree (chain_id, height); | ||
CREATE INDEX idx_blocks_height_desc ON public.blocks USING btree (height DESC); | ||
CREATE INDEX idx_chains_chain_id ON public.chains USING btree (chain_id); | ||
CREATE INDEX idx_events_block_id ON public.events USING btree (block_id); | ||
CREATE INDEX receiver ON public.events USING gin (((((data -> 'attributes'::text) -> 0) -> 'value'::text))) WHERE ((data ->> 'type'::text) = 'coin_received'::text); | ||
ALTER TABLE ONLY public.blocks | ||
ADD CONSTRAINT blocks_chain_id_fkey FOREIGN KEY (chain_id) REFERENCES public.chains(id) ON UPDATE CASCADE ON DELETE CASCADE; | ||
ALTER TABLE ONLY public.events | ||
ADD CONSTRAINT events_block_id_fkey FOREIGN KEY (block_id) REFERENCES public.blocks(id) ON UPDATE CASCADE ON DELETE CASCADE; |
Empty file.
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