Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ NATS_SERVERS="127.0.0.1:4222"

DATA_API_HOST="https://data.0l.fyi"
DATABASE_URL="postgresql://olfyi:olfyi@127.0.0.1:5432/olfyi?schema=public"

NUMIA_API_KEY="************************************"
2 changes: 2 additions & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ lerna-debug.log*

.env
.geoip

*service_account.json
87 changes: 85 additions & 2 deletions api/olfyiv5-tables.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,93 @@
CREATE TABLE "state" (
CREATE DATABASE IF NOT EXISTS "olfyi_v5" ON CLUSTER "olfyi";

CREATE TABLE "state" ON CLUSTER "olfyi" (
"version" UInt64,
"address" UInt128,
"module_address" UInt128,
"struct_name" String,
"module_name" String,
"payload" String
)
ENGINE = MergeTree
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "burn" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"amount" UInt64,
"currency" String,
"preburn_address" UInt128
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "create_account" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"role_id" UInt64,
"created_address" UInt128
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "mint" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"amount" UInt64,
"currency" String
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "new_block" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"round" UInt64,
"proposer" UInt128,
"proposed_time" UInt64,
"gas_used" UInt64
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "received_payment" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"amount" UInt64,
"currency" String,
"sender" UInt128,
"receiver" UInt128,
"metadata" String
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "sent_payment" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"amount" UInt64,
"currency" String,
"sender" UInt128,
"receiver" UInt128,
"metadata" String
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";

CREATE TABLE "user_transaction" ON CLUSTER "olfyi" (
"version" UInt64,
"timestamp_usecs" UInt64,
"sender" UInt128,
"sequence_number" UInt64,
"max_gas_amount" UInt64,
"gas_unit_price" UInt64,
"gas_currency" String,
"module_address" UInt128,
"module_name" String,
"function_name" String,
"arguments" Array(String),
"vm_status" String,
"gas_used" UInt64
)
ENGINE = ReplicatedMergeTree
ORDER BY "version";
2 changes: 2 additions & 0 deletions api/olfyiv6-tables.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE DATABASE IF NOT EXISTS olfyi_v6 ON CLUSTER olfyi;

Loading